@Override public SpriteBatch getBatch() { return beginBatch(); }
public void setOpacity(int opacity) { endBatch(); if (!alphaEnabled) { alphaEnabled = true; } beginBatch(); this.alpha = opacity; currentColor.a = this.alpha / (float) Layer.MAX_OPACITY; batch.setColor(1, 1, 1, currentColor.a); }
public void drawString(String text, int x, int y) { beginBatch(); drawFont(text, x, y - font.getFont().getCapHeight()); }
public void drawString(String text, int x, int y, int w, int h) { beginBatch(); GlyphLayout layout = new GlyphLayout(); layout.setText(font.getFont(), text); float cx = w / 2 - layout.width / 2; float cy = h / 2 - layout.height / 2; drawFont(text, x + cx, y + cy); }
public void drawStringX(String text, int y) { beginBatch(); GlyphLayout layout = new GlyphLayout(); layout.setText(font.getFont(), text); float cx = width / 2 - layout.width / 2; drawFont(text, cx, y); }