Skip to content

Instantly share code, notes, and snippets.

@lilrooness
Created January 24, 2018 21:18
Show Gist options
  • Select an option

  • Save lilrooness/a2e4a7e37d19737ab9c821918de89303 to your computer and use it in GitHub Desktop.

Select an option

Save lilrooness/a2e4a7e37d19737ab9c821918de89303 to your computer and use it in GitHub Desktop.
Defold mouse script
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