Image Component

This commit is contained in:
Frank 2022-07-15 15:47:56 +02:00
parent 51da03f3c8
commit 877489c469
13 changed files with 263 additions and 36 deletions

View file

@ -1,7 +1,9 @@
package org.betterx.bclib.client.gui.modmenu;
import org.betterx.bclib.BCLib;
import org.betterx.ui.layout.components.*;
import org.betterx.ui.layout.values.DynamicSize;
import org.betterx.ui.layout.values.Size;
import org.betterx.ui.vanilla.LayoutScreen;
import net.minecraft.client.gui.screens.Screen;
@ -36,6 +38,13 @@ public class TestScreen extends LayoutScreen {
).centerHorizontal()
);
rows.addSpacer(16);
rows.add(new Image(
DynamicSize.fixed(24), DynamicSize.fixed(24),
BCLib.makeID("icon.png"),
new Size(512, 512)
).centerHorizontal()
);
rows.addSpacer(16);
rows.add(new Range<>(
DynamicSize.fill(), DynamicSize.fit(),
Component.literal("Integer"),
@ -72,7 +81,7 @@ public class TestScreen extends LayoutScreen {
}
));
rows.add(cb1);
rows.addSpacer(32);
rows.addSpacer(16);
rows.add(new Button(
DynamicSize.fit(), DynamicSize.fit(),
Component.literal("test"),