From 1c2f28143a4050f7b76a11d5e16e859035e24e29 Mon Sep 17 00:00:00 2001 From: Filip Weiss Date: Fri, 10 Jul 2020 17:32:07 +0200 Subject: tiled-sprite: introduce getters for tileWidth/height (#72) --- .../io/github/cottonmc/cotton/gui/widget/WTiledSprite.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTiledSprite.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTiledSprite.java index d49074f..5ef49ab 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTiledSprite.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTiledSprite.java @@ -52,6 +52,14 @@ public class WTiledSprite extends WSprite { tileHeight = height; } + public int getTileWidth() { + return tileWidth; + } + + public int getTileHeight() { + return tileHeight; + } + @Environment(EnvType.CLIENT) @Override public void paintFrame(int x, int y, Identifier texture) { @@ -65,7 +73,7 @@ public class WTiledSprite extends WSprite { x + tileXOffset, y + tileYOffset, // but using the set tileWidth and tileHeight instead of the full height and // width - tileWidth, tileHeight, + getTileWidth(), getTileHeight(), // render the current texture texture, // clips the texture if wanted -- cgit