diff options
| author | ilotterytea <iltsu@alright.party> | 2022-08-29 00:48:31 +0600 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2022-08-29 00:48:31 +0600 |
| commit | 0d9064e47ccc486ee73127adb0bed4f74e741fd7 (patch) | |
| tree | 41afeeaa59e5051527ba42d6058c878e428a0620 /core | |
| parent | ced8c5d6bc6262277063d6d85093b80d0a0dc27d (diff) | |
dank save slot widget
Diffstat (limited to 'core')
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/ui/SaveSlot.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/ui/SaveSlot.java b/core/src/com/ilotterytea/maxoning/ui/SaveSlot.java new file mode 100644 index 0000000..4b413a9 --- /dev/null +++ b/core/src/com/ilotterytea/maxoning/ui/SaveSlot.java @@ -0,0 +1,30 @@ +package com.ilotterytea.maxoning.ui; + +import com.badlogic.gdx.graphics.g2d.NinePatch; +import com.badlogic.gdx.scenes.scene2d.Stage; +import com.badlogic.gdx.scenes.scene2d.ui.Image; +import com.badlogic.gdx.scenes.scene2d.ui.Label; +import com.badlogic.gdx.scenes.scene2d.ui.Skin; +import com.badlogic.gdx.scenes.scene2d.ui.Stack; +import com.rafaskoberg.gdx.typinglabel.TypingLabel; + +public class SaveSlot extends Stack { + public SaveSlot( + Skin skin, + NinePatch ninePatch, + float x, float y, + float width, float height, + CharSequence text + ) { + Image img = new Image(ninePatch); + TypingLabel label = new TypingLabel(text, skin); + + img.setPosition(x, y); + img.setSize(width, height); + + label.setPosition(img.getWidth() / 2, img.getHeight() / 2); + + super.add(img); + super.add(label); + } +} |
