mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
re-draw floater gui texture
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
assets/graphics/gui/message_white_tileable.tga
LFS
Normal file
BIN
assets/graphics/gui/message_white_tileable.tga
LFS
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@ import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
|
|||||||
*/
|
*/
|
||||||
object FloatDrawer : Disposable {
|
object FloatDrawer : Disposable {
|
||||||
|
|
||||||
val tile = TextureRegionPack("assets/graphics/gui/message_black_tileable.tga", 8, 8)
|
val tile = TextureRegionPack("assets/graphics/gui/message_white_tileable.tga", 16, 16)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
AppLoader.disposableSingletonsPool.add(this)
|
AppLoader.disposableSingletonsPool.add(this)
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ class UITooltip : UICanvas() {
|
|||||||
|
|
||||||
override var openCloseTime: Second = 0f
|
override var openCloseTime: Second = 0f
|
||||||
|
|
||||||
|
private val tooltipBackCol = Color(0xd5d4d3ff.toInt())
|
||||||
|
private val tooltipForeCol = Color(0x404040ff)
|
||||||
|
|
||||||
var message: String = ""
|
var message: String = ""
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
@@ -37,16 +40,17 @@ class UITooltip : UICanvas() {
|
|||||||
val mouseX = 4f
|
val mouseX = 4f
|
||||||
val mouseY = 6f
|
val mouseY = 6f
|
||||||
|
|
||||||
val tooltipY = mouseY - height
|
val tooltipYoff = 12
|
||||||
|
val tooltipY = mouseY - height + tooltipYoff
|
||||||
|
|
||||||
val txtW = msgWidth + 2f * textMarginX
|
val txtW = msgWidth + 2f * textMarginX
|
||||||
|
|
||||||
batch.color = Color.WHITE
|
batch.color = tooltipBackCol
|
||||||
|
|
||||||
FloatDrawer(batch, mouseX - textMarginX, tooltipY, txtW, font.lineHeight)
|
FloatDrawer(batch, mouseX - textMarginX, tooltipY, txtW, font.lineHeight)
|
||||||
|
batch.color = tooltipForeCol
|
||||||
font.draw(batch, message,
|
font.draw(batch, message,
|
||||||
mouseX,
|
mouseX,
|
||||||
mouseY - height
|
mouseY - height + tooltipYoff
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
work_files/graphics/gui/message.psd
LFS
Normal file → Executable file
BIN
work_files/graphics/gui/message.psd
LFS
Normal file → Executable file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user