Add BLACK and GOLD colors to Colors.kt
This commit is contained in:
parent
a8c4bf4709
commit
b6b001cad0
|
@ -2,9 +2,10 @@ package fr.username404.snowygui.gui
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack
|
import com.mojang.blaze3d.vertex.PoseStack
|
||||||
import net.minecraft.client.Minecraft
|
import net.minecraft.client.Minecraft
|
||||||
|
import fr.username404.snowygui.gui.feature.Colors
|
||||||
|
|
||||||
object FontUtil {
|
object FontUtil {
|
||||||
fun drawScaled(stack: PoseStack, text: String, x: Double, y: Double, scaleFactor: Float, color: Int = 0x000000) {
|
fun drawScaled(stack: PoseStack, text: String, x: Double, y: Double, scaleFactor: Float, color: Colors = Colors.BLACK) {
|
||||||
stack.scale(scaleFactor, scaleFactor, scaleFactor)
|
stack.scale(scaleFactor, scaleFactor, scaleFactor)
|
||||||
Minecraft.getInstance().font.draw(stack, text, (x / scaleFactor).toFloat(), (y / scaleFactor).toFloat(), color)
|
Minecraft.getInstance().font.draw(stack, text, (x / scaleFactor).toFloat(), (y / scaleFactor).toFloat(), color)
|
||||||
val factorToOriginal = 1F / scaleFactor
|
val factorToOriginal = 1F / scaleFactor
|
||||||
|
|
|
@ -17,7 +17,7 @@ object Clock: ButtonImpl() {
|
||||||
FontUtil.drawScaled(it.first() as PoseStack,
|
FontUtil.drawScaled(it.first() as PoseStack,
|
||||||
"$hour:$minute:${second.let { if (it >= 10) it else "0$it" }}",
|
"$hour:$minute:${second.let { if (it >= 10) it else "0$it" }}",
|
||||||
5.0, 5.0,
|
5.0, 5.0,
|
||||||
0.85F, color = 0xe69500
|
0.85F, color = Colors.GOLD
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package fr.username404.snowygui.gui.feature
|
||||||
|
|
||||||
enum class Colors(val hexValue: Int) {
|
enum class Colors(val hexValue: Int) {
|
||||||
TRANSPARENT(-0x1),
|
TRANSPARENT(-0x1),
|
||||||
|
BLACK(0x000000),
|
||||||
|
GOLD(0xe69500),
|
||||||
BLUE(0x6C9E9D),
|
BLUE(0x6C9E9D),
|
||||||
RED(0x660000);
|
RED(0x660000);
|
||||||
}
|
}
|
Loading…
Reference in New Issue