diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-04 13:58:55 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-06-04 13:58:55 +0200 |
commit | bc48ed611da2ee666651919cfcc4c7046bcede0a (patch) | |
tree | b08d5bd87382f8e3329236df9457847c6b2729fc /src/main/java/cc/polyfrost/oneconfig/test | |
parent | 8df18aacd08a0b6caf612a31d578dd6e6d5fa31a (diff) | |
download | OneConfig-bc48ed611da2ee666651919cfcc4c7046bcede0a.tar.gz OneConfig-bc48ed611da2ee666651919cfcc4c7046bcede0a.tar.bz2 OneConfig-bc48ed611da2ee666651919cfcc4c7046bcede0a.zip |
button test page
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java b/src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java new file mode 100644 index 0000000..5e2a864 --- /dev/null +++ b/src/main/java/cc/polyfrost/oneconfig/test/ButtonTestPage.java @@ -0,0 +1,55 @@ +package cc.polyfrost.oneconfig.test; + +import cc.polyfrost.oneconfig.gui.elements.BasicButton; +import cc.polyfrost.oneconfig.gui.pages.Page; +import cc.polyfrost.oneconfig.lwjgl.image.SVGs; +import cc.polyfrost.oneconfig.utils.color.ColorPalette; + +import java.util.ArrayList; + +public class ButtonTestPage extends Page { + private final ArrayList<BasicButton> row1 = new ArrayList<BasicButton>() {{ + add(new BasicButton(254, 48, "Primary", BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY)); + add(new BasicButton(254, 48, "Primary Destructive", BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY_DESTRUCTIVE)); + add(new BasicButton(254, 48, "Secondary", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY)); + add(new BasicButton(254, 48, "Secondary Destructive", BasicButton.ALIGNMENT_CENTER, ColorPalette.SECONDARY_DESTRUCTIVE)); + add(new BasicButton(254, 48, "Tertiary", BasicButton.ALIGNMENT_CENTER, ColorPalette.TERTIARY)); + add(new BasicButton(254, 48, "Tertiary Destructive", BasicButton.ALIGNMENT_CENTER, ColorPalette.TERTIARY_DESTRUCTIVE)); + }}; + + private final ArrayList<BasicButton> row2 = new ArrayList<BasicButton>() {{ + add(new BasicButton(170, 32, "32", SVGs.BOX, SVGs.BOX, BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY)); + add(new BasicButton(193, 36, "36", SVGs.BOX, SVGs.BOX, BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY)); + add(new BasicButton(208, 40, "40", SVGs.BOX, SVGs.BOX, BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY)); + add(new BasicButton(254, 48, "48", SVGs.BOX, SVGs.BOX, BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY)); + }}; + + private final ArrayList<BasicButton> row3 = new ArrayList<BasicButton>() {{ + add(new BasicButton(254, 48, "Left", SVGs.BOX, SVGs.BOX, BasicButton.ALIGNMENT_LEFT, ColorPalette.PRIMARY)); + add(new BasicButton(254, 48, "Center", SVGs.BOX, SVGs.BOX, BasicButton.ALIGNMENT_CENTER, ColorPalette.PRIMARY)); + add(new BasicButton(254, 48, "Justified", SVGs.BOX, SVGs.BOX, BasicButton.ALIGNMENT_JUSTIFIED, ColorPalette.PRIMARY)); + }}; + + public ButtonTestPage() { + super("Buttons"); + } + + @Override + public void draw(long vg, int x, int y) { + int buttonY = y + 16; + for (BasicButton button : row1) { + button.draw(vg, x + 16, buttonY); + buttonY += 64; + } + buttonY = y + 16; + for (BasicButton button : row2) { + button.draw(vg, x + 286, buttonY); + buttonY += 64; + } + buttonY = y + 16; + for (BasicButton button : row3) { + button.draw(vg, x + 556, buttonY); + buttonY += 64; + } + } +} |