public void flush() { endBatch(); }
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 drawRect(int x, int y, int w, int h) { endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Line); shapeRenderer.setColor(currentColor); shapeRenderer.rect(x, height - y - h, w, h); shapeRenderer.end(); }
@Override public void fillArc(int x, int y, int w, int h, int startAngle, int arcAngle) { int radius = w / 2 + 1; int cx = x + radius; int cy = height - y - h / 2 - 1; endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(currentColor); arc(cx, cy, radius, startAngle, arcAngle, ShapeRenderer.ShapeType.Filled); shapeRenderer.end(); }
public void fillRect(int x, int y, int w, int h) { endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(currentColor); shapeRenderer.rect(x, height - y - h, w, h); shapeRenderer.end(); }
@Override public void putPixel(int x, int y) { endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Point); shapeRenderer.setColor(currentColor); shapeRenderer.point(x, height - y, 0); shapeRenderer.end(); }
@Override public void drawArc(int x, int y, int w, int h, int startAngle, int arcAngle) { int radius = w / 2 + 1; int cx = x + radius; int cy = height - y - h / 2 - 1; endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Line); shapeRenderer.setColor(currentColor); arc(cx, cy, radius, startAngle, arcAngle, ShapeRenderer.ShapeType.Line); shapeRenderer.end(); }
public void drawOval(int x, int y, int w, int h) { endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Line); shapeRenderer.setColor(currentColor); shapeRenderer.ellipse(x, height - y - h, w, h); shapeRenderer.end(); }
public void fillOval(int x, int y, int w, int h) { endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(currentColor); shapeRenderer.ellipse(x, height - y - h, w, h); shapeRenderer.end(); }
public void drawLine(int x1, int y1, int x2, int y2) { endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Line); shapeRenderer.setColor(currentColor); shapeRenderer.line(x1, height - y1, x2, height - y2); shapeRenderer.end(); }