Created
January 24, 2018 21:18
-
-
Save lilrooness/a2e4a7e37d19737ab9c821918de89303 to your computer and use it in GitHub Desktop.
Defold mouse script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function init(self) | |
| msg.post(".", "acquire_input_focus") | |
| end | |
| function on_input(self, action_id, action) | |
| if action_id == nil then | |
| local pos = go.get_position() | |
| pos.x = action.x | |
| pos.y = action.y | |
| go.set_position(pos) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment