testing borders on inventory cells

This commit is contained in:
minjaesong
2019-12-29 00:27:20 +09:00
parent 24c6e8b385
commit f36209e3bf
7 changed files with 94 additions and 32 deletions

View File

@@ -10,6 +10,8 @@ import net.torvald.terrarum.itemproperties.ItemCodex
import net.torvald.terrarum.modulebasegame.gameactors.ActorInventory
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_BLACK
import net.torvald.terrarum.modulebasegame.ui.ItemSlotImageFactory.CELLCOLOUR_BLACK_ACTIVE
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.ui.Toolkit.DEFAULT_BOX_BORDER_COL
import net.torvald.terrarum.ui.UIItem
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
@@ -82,10 +84,10 @@ class UIItemInventoryEquippedView(
// sprite background
blendNormal(batch)
batch.color = spriteViewBackCol
batch.fillRect(
posX.toFloat(), posY.toFloat(),
width.toFloat(), width.toFloat()
)
Toolkit.fillArea(batch, posX, posY, width, width)
batch.color = DEFAULT_BOX_BORDER_COL
Toolkit.drawBoxBorder(batch, posX, posY, width, width)
// sprite
val sprite = theActor.sprite
@@ -101,8 +103,7 @@ class UIItemInventoryEquippedView(
}
// TODO inscribe slot image on each cells HERE
// slot image on each cells
itemGrid.forEachIndexed { index, cell ->
cell.render(batch, camera)
if (cell.item == null) {