aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorFilip Weiss <me@fiws.net>2020-07-10 17:32:07 +0200
committerGitHub <noreply@github.com>2020-07-10 18:32:07 +0300
commit1c2f28143a4050f7b76a11d5e16e859035e24e29 (patch)
tree51a06e0c6b2905d31766abf228534f23d73beb37 /src/main/java
parent6adcfd6718646bc60921fe6f385461b993586d80 (diff)
downloadLibGui-1c2f28143a4050f7b76a11d5e16e859035e24e29.tar.gz
LibGui-1c2f28143a4050f7b76a11d5e16e859035e24e29.tar.bz2
LibGui-1c2f28143a4050f7b76a11d5e16e859035e24e29.zip
tiled-sprite: introduce getters for tileWidth/height (#72)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WTiledSprite.java10
1 files changed, 9 insertions, 1 deletions
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