So I’m trying to enable a sprite using a mouse input however this does not work. I’m using
msg.post("#sprite", "disable", {id = hash("sprite")})
in the init function to disable the sprite when the program starts and
msg.post("#sprite", "enable", {id = hash("sprite")})
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