ui itemlist scrolls with wheel

This commit is contained in:
minjaesong
2019-01-16 01:37:44 +09:00
parent e844d12aa5
commit 170a73bbd8
2 changed files with 24 additions and 4 deletions

View File

@@ -44,8 +44,10 @@ abstract class UIItem(var parentUI: UICanvas) { // do not replace parentUI to UI
abstract val width: Int
abstract val height: Int
/** Position of mouse relative to this item */
protected val relativeMouseX: Int
get() = (Terrarum.mouseScreenX - (parentUI.posX) - this.posX)
/** Position of mouse relative to this item */
protected val relativeMouseY: Int
get() = (Terrarum.mouseScreenY - (parentUI.posY) - this.posY)