we need svg rendering
@@ -16,6 +16,6 @@ public class MainMenu extends SaturnUi {
|
||||
draw(
|
||||
new SaturnButton("Settings", () -> {
|
||||
client.setScreen(new SettingsMenu());
|
||||
}).setX(10).setY(10).setWidth(100).setHeight(20).setAnimation(SaturnAnimation.FADE_SLIDE.distance(15)));
|
||||
}).setX(10).setY(10).setWidth(96).setHeight(25).setAnimation(SaturnAnimation.FADE_SLIDE.distance(15)));
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,10 @@ import net.minecraft.util.math.ColorHelper;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class SaturnButton extends SaturnWidget {
|
||||
public static final Identifier BORDER_TEXTURE = Identifier.ofVanilla("widget/saturn/button_border");
|
||||
public static final ButtonTextures TEXTURES = new ButtonTextures(
|
||||
Identifier.ofVanilla("widget/saturn_button"), Identifier.ofVanilla("widget/saturn_button_disabled"),
|
||||
Identifier.ofVanilla("widget/saturn_button_highlighted"));
|
||||
Identifier.ofVanilla("widget/saturn/button"), Identifier.ofVanilla("widget/saturn/button_disabled"),
|
||||
Identifier.ofVanilla("widget/saturn/button"));
|
||||
|
||||
public boolean active = true;
|
||||
public String text;
|
||||
@@ -31,6 +32,11 @@ public class SaturnButton extends SaturnWidget {
|
||||
context.drawGuiTexture(RenderLayer::getGuiTextured, TEXTURES.get(this.active, hovering), this.x,
|
||||
this.y, this.width, this.height, ColorHelper.getWhite(this.alpha));
|
||||
|
||||
if (hovering) {
|
||||
context.drawGuiTexture(RenderLayer::getGuiTextured, BORDER_TEXTURE, this.x,
|
||||
this.y, this.width, this.height, ColorHelper.getArgb(255, 251, 60, 79));
|
||||
}
|
||||
|
||||
int i = this.active ? 16777215 : 10526880;
|
||||
context.drawText(minecraftClient.textRenderer, this.text,
|
||||
this.x + ((this.width - minecraftClient.textRenderer.getWidth(this.text)) / 2),
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.ColorHelper;
|
||||
|
||||
public class SaturnInputBox extends SaturnWidget {
|
||||
public static final Identifier TEXTURE = Identifier.ofVanilla("widget/saturn_button");
|
||||
public static final Identifier TEXTURE = Identifier.ofVanilla("widget/saturn/button");
|
||||
|
||||
public String text = "";
|
||||
public String placeholder = "";
|
||||
|
||||
|
After Width: | Height: | Size: 581 B |
@@ -2,9 +2,9 @@
|
||||
"gui": {
|
||||
"scaling": {
|
||||
"type": "nine_slice",
|
||||
"width": 300,
|
||||
"height": 30,
|
||||
"border": 9
|
||||
"width": 80,
|
||||
"height": 80,
|
||||
"border": 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 650 B |
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"gui": {
|
||||
"scaling": {
|
||||
"type": "nine_slice",
|
||||
"width": 80,
|
||||
"height": 80,
|
||||
"border": 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
|
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
|
Before Width: | Height: | Size: 391 B |
|
After Width: | Height: | Size: 1.7 KiB |