Position arg type in NAT
This commit is contained in:
@@ -80,7 +80,12 @@
|
||||
(when (and textInput !textInput.alive)
|
||||
(set textInput null))
|
||||
|
||||
|
||||
(when resolvePosition
|
||||
(when FlxG.mouse.justPressed
|
||||
(whenLet [rp resolvePosition
|
||||
(Some pos) (cursorPosition)]
|
||||
(set resolvePosition null)
|
||||
(rp pos))))
|
||||
|
||||
// Control the UI camera with WASD, and the playground camera with arrow keys:
|
||||
(var KEYBOARD_SCROLL_SPEED 800)
|
||||
@@ -214,6 +219,11 @@
|
||||
(whenLet [sprite (dictGet spriteSystem.sprites e.id)]
|
||||
(sprite.updateColor))))
|
||||
|
||||
(prop &mut :Position->Void resolvePosition)
|
||||
(method :Void choosePosition [prompt resolve]
|
||||
(displayMessage prompt)
|
||||
(set resolvePosition resolve))
|
||||
|
||||
(method :Option<Position> cursorPosition []
|
||||
(let [pos (FlxG.mouse.getWorldPosition FlxG.camera)]
|
||||
(Some (object x pos.x y pos.y z 0.0))))
|
Reference in New Issue
Block a user