mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 12:34:05 +09:00
adjusting position of the noticelet
This commit is contained in:
@@ -59,17 +59,21 @@ class Noticelet : UICanvas() {
|
|||||||
}
|
}
|
||||||
toDelete.clear()
|
toDelete.clear()
|
||||||
|
|
||||||
|
// make way for the mouse cursor
|
||||||
|
/*
|
||||||
if (Terrarum.mouseScreenX.toFloat() in Toolkit.drawWidthf * 0.25f..Toolkit.drawWidthf * 0.75f) {
|
if (Terrarum.mouseScreenX.toFloat() in Toolkit.drawWidthf * 0.25f..Toolkit.drawWidthf * 0.75f) {
|
||||||
if (ypos == -1f && Terrarum.mouseScreenY < App.scr.halfhf - awayFromCentre)
|
if (ypos == -1f && Terrarum.mouseScreenY < App.scr.halfhf - awayFromCentre)
|
||||||
ypos = 1f
|
ypos = 1f
|
||||||
else if (ypos == 1f && Terrarum.mouseScreenY > App.scr.halfhf + awayFromCentre)
|
else if (ypos == 1f && Terrarum.mouseScreenY > App.scr.halfhf + awayFromCentre)
|
||||||
ypos = -1f
|
ypos = -1f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private val h = 24f
|
private val h = 24f
|
||||||
private val gap = 8f
|
private val gap = 8f
|
||||||
private val awayFromCentre = 120f
|
private val awayFromCentre = 56f//120f
|
||||||
|
|
||||||
private val toDelete = ArrayList<Notice>()
|
private val toDelete = ArrayList<Notice>()
|
||||||
|
|
||||||
@@ -80,7 +84,7 @@ class Noticelet : UICanvas() {
|
|||||||
val py = App.scr.halfhf + awayFromCentre * ypos - (if (ypos < 0) h else 0f)
|
val py = App.scr.halfhf + awayFromCentre * ypos - (if (ypos < 0) h else 0f)
|
||||||
|
|
||||||
messageQueue.forEachIndexed { index, notice ->
|
messageQueue.forEachIndexed { index, notice ->
|
||||||
drawNoticelet(batch, px, py + (h + gap) * index * ypos, notice)
|
drawNoticelet(batch, App.scr.tvSafeGraphicsWidth.toFloat(), py + (h + gap) * index * ypos, notice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +103,7 @@ class Noticelet : UICanvas() {
|
|||||||
val strLen = App.fontGame.getWidth(str)
|
val strLen = App.fontGame.getWidth(str)
|
||||||
val icon = ItemCodex.getItemImage(notice.item) ?: CommonResourcePool.getAsTextureRegion("itemplaceholder_16")
|
val icon = ItemCodex.getItemImage(notice.item) ?: CommonResourcePool.getAsTextureRegion("itemplaceholder_16")
|
||||||
val width = 4f + icon.regionWidth + 4 + strLen + 4
|
val width = 4f + icon.regionWidth + 4 + strLen + 4
|
||||||
val dx = ((x - width) / 2).floorToFloat()
|
val dx = x//((x - width) / 2).floorToFloat()
|
||||||
val dy = y
|
val dy = y
|
||||||
|
|
||||||
val opacity = if (notice.akku < openCloseTime)
|
val opacity = if (notice.akku < openCloseTime)
|
||||||
|
|||||||
Reference in New Issue
Block a user