working spinner

This commit is contained in:
minjaesong
2021-10-23 22:03:27 +09:00
parent 233895d857
commit 3be5ac96f2
5 changed files with 138 additions and 32 deletions

View File

@@ -37,7 +37,7 @@ class UIItemTextSelector(
override val height = 24
private val buttonW = 30
private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width - 54 - 4, height - 4, true)
private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width - 2*buttonW - 6, height - 4, true)
var selection = intialSelection
private var fboUpdateLatch = true
@@ -120,7 +120,7 @@ class UIItemTextSelector(
// draw text
batch.color = UIItemTextLineInput.TEXTINPUT_COL_TEXT
batch.draw(fbo.colorBufferTexture, posX + buttonW + 5f, posY + 2f, fbo.width.toFloat(), fbo.height.toFloat())
batch.draw(fbo.colorBufferTexture, posX + buttonW + 3f, posY + 2f, fbo.width.toFloat(), fbo.height.toFloat())
super.render(batch, camera)
@@ -130,29 +130,3 @@ class UIItemTextSelector(
fbo.dispose()
}
}
class UIItemSpinner(
parentUI: UICanvas,
initialX: Int, initialY: Int,
intialValue: Int,
val min: Int,
val max: Int,
val step: Int,
override val width: Int
) : UIItem(parentUI, initialX, initialY) {
init {
CommonResourcePool.addToLoadingList("inventory_category") {
TextureRegionPack("assets/graphics/gui/inventory/category.tga", 20, 20)
}
CommonResourcePool.loadAll()
}
private val labels = CommonResourcePool.getAsTextureRegionPack("inventory_category")
override val height = 24
override fun dispose() {
}
}