inventory gamemenu visual only

This commit is contained in:
minjaesong
2019-01-29 23:37:38 +09:00
parent aef07149b4
commit 1475fa08dc
19 changed files with 307 additions and 52 deletions

View File

@@ -44,6 +44,25 @@ abstract class UIItem(var parentUI: UICanvas) { // do not replace parentUI to UI
abstract val width: Int
abstract val height: Int
/** This variable is NOT updated on its own.
* ```
* val posXDelta = posX - oldPosX
* itemGrid.forEach { it.posX += posXDelta }
* ...
* oldPosX = posX
* ```
*/
protected abstract var oldPosX: Int
/** This variable is NOT updated on its own.
* ```
* val posYDelta = posY - oldPosY
* itemGrid.forEach { it.posY += posYDelta }
* ...
* oldPosY = posY
* ```
*/
protected abstract var oldPosY: Int
/** Position of mouse relative to this item */
protected val relativeMouseX: Int
get() = (Terrarum.mouseScreenX - (parentUI.posX) - this.posX)