fixed uiItem stupidity with uiCanvas; it activated even if its parent is invisible

This commit is contained in:
minjaesong
2017-10-24 07:25:05 +09:00
parent f1c4eb4015
commit a3f9373253
7 changed files with 110 additions and 36 deletions

View File

@@ -75,9 +75,9 @@ class UIItemInventoryCatBar(
// procedurally generate texture
val pixmap = Pixmap(catIcons.tileW + buttonGapSize.floorInt(), 1, Pixmap.Format.RGBA8888)
for (x in 0 until pixmap.width.plus(1).ushr(1)) { // eqv. of ceiling the half-int
val col = if (x == 0) 0xffffff_80.toInt()
else if (x == 1) 0xffffff_c0.toInt()
else 0xffffff_ff.toInt()
val col = /*if (x == 0)*/ /*0xffffff_80.toInt()*/
/*else if (x == 1)*/ /*0xffffff_c0.toInt()*/
/*else */ 0xffffff_ff.toInt()
pixmap.drawPixel(x, 0, col)
pixmap.drawPixel(pixmap.width - (x + 1), 0, col)
@@ -143,6 +143,10 @@ class UIItemInventoryCatBar(
// colour determined by UI items themselves
buttons.forEach { it.render(batch, camera) }
blendNormal(batch)
// underline
batch.color = underlineColour
batch.drawStraightLine(posX.toFloat(), posY + height - 1f, posX + width.toFloat(), 1f, false)