module UI now has margin; game update will drop consecutive updates if its try count is exhausted (reduced lag after window move/resize)

This commit is contained in:
minjaesong
2017-09-15 01:40:12 +09:00
parent d00c58ba80
commit c086722f35
6 changed files with 31 additions and 5 deletions

View File

@@ -31,13 +31,14 @@ class UIItemList<Item: UIItem>(
val inactiveCol: Color = Color(0xc0c0c0_ff.toInt()),
val backgroundCol: Color = Color(0x242424_80),
val backgroundBlendMode: String = BlendMode.NORMAL,
val kinematic: Boolean = false
val kinematic: Boolean = false,
val border: Int = 0
) : UIItem(parentUI) {
init {
itemList.forEachIndexed { index, item ->
item.posX = this.posX
item.posY = if (index == 0) this.posY else itemList[index - 1].posY + itemList[index - 1].height
item.posX = this.posX + border
item.posY = if (index == 0) this.posY + border else itemList[index - 1].posY + itemList[index - 1].height
}
}

View File

@@ -40,6 +40,9 @@ class UITitleRemoConModules(val superMenu: UICanvas) : UICanvas() {
private val moduleAreaHMargin = 48
private val moduleAreaBorder = 8
private val moduleAreaWidth = (Terrarum.WIDTH * 0.75).toInt() - moduleAreaHMargin
private val moduleAreaHeight = Terrarum.HEIGHT - moduleAreaHMargin * 2
@@ -50,7 +53,7 @@ class UITitleRemoConModules(val superMenu: UICanvas) : UICanvas() {
moduleInfoCells.add(UIItemModuleInfoCell(
this,
it.first,
moduleAreaWidth,
moduleAreaWidth - 2 * moduleAreaBorder,
0, 0 // placeholder
))
}
@@ -62,7 +65,8 @@ class UITitleRemoConModules(val superMenu: UICanvas) : UICanvas() {
(Terrarum.WIDTH * 0.25f).toInt(), moduleAreaHMargin,
moduleAreaWidth,
moduleAreaHeight,
inactiveCol = Color.WHITE
inactiveCol = Color.WHITE,
border = moduleAreaBorder
)