to enable the spirte when a mouse input is detected
This is the full code I’m using to do this. The sprite is successfully disabled when the program loads up but does not enable through the mouse input.
function init(self)
msg.post('.', 'aquire_input_focus')
msg.post("#sprite", "disable", {id = hash("sprite")})
end
function on_input(self, action_id, action)
if action_id == hash("rightclick") and action.pressed then
msg.post("#sprite", "enable", {id = hash("sprite")})
end
end
function init(self)
msg.post(".", "acquire_input_focus")
msg.post("#sprite", "disable")
end
function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then
msg.post("#sprite", "enable")
end
end
Thank you for your response but this does not help. I’m still getting the same issue. No error messages, besides I know that has to be a valid action_id because I’ve used it elsewhere in my program