public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { patch.draw(batch, x, y, originX, originY, width, height, scaleX, scaleY, rotation); }
public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { patch.draw(batch, x, y, originX, originY, width, height, scaleX, scaleY, rotation); }
public void draw (Batch batch, float x, float y, float width, float height) { patch.draw(batch, x, y, width, height); }
public void draw (Batch batch, float x, float y, float width, float height) { patch.draw(batch, x, y, width, height); }
@Override public void render () { Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); int size = Math.min(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); int quarterSize = (int) (size/4f); batch.begin(); batch.draw(textureRegions.get(pageToShow), 0, 0, size, size); ninePatch.draw(batch, 10, 10, quarterSize, quarterSize); officialPatch.draw(batch, (int)(size * 0.25f + 20), 10, quarterSize, quarterSize); batch.end(); shapeRenderer.begin(ShapeRenderer.ShapeType.Line); shapeRenderer.setColor(Color.GREEN); shapeRenderer.rect(0, 0, size, size); shapeRenderer.end(); }
@Override public void render () { Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); int size = Math.min(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); int quarterSize = (int) (size/4f); batch.begin(); batch.draw(textureRegions.get(pageToShow), 0, 0, size, size); ninePatch.draw(batch, 10, 10, quarterSize, quarterSize); officialPatch.draw(batch, (int)(size * 0.25f + 20), 10, quarterSize, quarterSize); batch.draw(animation.getKeyFrame(stateTime), 30 + (quarterSize * 2), 10, quarterSize, quarterSize); batch.end(); shapeRenderer.begin(ShapeRenderer.ShapeType.Line); shapeRenderer.setColor(Color.GREEN); shapeRenderer.rect(0, 0, size, size); shapeRenderer.end(); stateTime += Gdx.graphics.getDeltaTime(); }
public void render(SpriteBatch batch) { final float width = right - left; final float height = top - bottom; Assets.instance.platformAssets.platformNinePatch.draw(batch, left - 1, bottom - 1, width + 2, height + 2); }
public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { patch.draw(batch, x, y, originX, originY, width, height, scaleX, scaleY, rotation); }
public void draw (Batch batch, float x, float y, float width, float height) { patch.draw(batch, x, y, width, height); }
@Override public void render() { viewport.apply(); Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.setProjectionMatrix(viewport.getCamera().combined); batch.begin(); // TODO: Draw the platform texture at TEST_SIZE_1 batch.draw(platformTexture, WORLD_SIZE * 1 / 4 - TEST_SIZE_1 / 2, WORLD_SIZE * 1 / 4 - TEST_SIZE_1 / 2, TEST_SIZE_1, TEST_SIZE_1); // TODO: Draw the platform texture at TEST_SIZE_2 batch.draw(platformTexture, WORLD_SIZE * 3 / 4 - TEST_SIZE_2 / 2, WORLD_SIZE * 1 / 4 - TEST_SIZE_2 / 2, TEST_SIZE_2, TEST_SIZE_2); // TODO: Draw the nine patch at TEST_SIZE_1 platformNinePatch.draw(batch, WORLD_SIZE * 1 / 4 - TEST_SIZE_1 / 2, WORLD_SIZE * 3 / 4 - TEST_SIZE_1 / 2, TEST_SIZE_1, TEST_SIZE_1); // TODO: Draw the nine patch at TEST_SIZE_2 platformNinePatch.draw(batch, WORLD_SIZE * 3 / 4 - TEST_SIZE_2 / 2, WORLD_SIZE * 3 / 4 - TEST_SIZE_2 / 2, TEST_SIZE_2, TEST_SIZE_2); batch.end(); }
@Override public void draw(Batch batch, float parentAlpha) { if (region == null) return; // Frame float scale = PageGroup.this.getScaleX(); float x = getX() + (region.getX() - framePad) * scale; float y = getY() + (region.getPage().getHeight() - region.getY() - region.getHeight() - framePad) * scale; // Texture region has top-left axis origin float width = (region.getWidth() + framePad*2f) * scale; float height = (region.getHeight() + framePad*2f) * scale; batch.setColor(colorSpotlight); spotlightBorder.draw(batch, x, y, width, height); // Text float textX = x + width*0.5f - glText.width*0.5f; float textY = y - glText.height - 4f; batch.setColor(colorTextFrame); batch.draw(whiteTex, textX-10f, textY - 6f, glText.width+20f, glText.height + 10f); batch.setColor(Color.WHITE); font.getData().setScale(1f); font.draw(batch, glText, textX, textY + glText.height); }