I am able to reproduce it consistently. I’m using MacOS.
Yes, those are remnants from a different project. They don’t affect the issue, which is still there, though.
To remove any question marks about the code, here is a clean version with no reference to the old project (I hope!):
function on_input(self, action_id, action)
pprint("on_input", self, action_id, action)
if action_id == hash("touch") and action.pressed then
-- Print touches
local str = table_print( action )
local pos = vmath.vector3(action.screen_x,action.screen_y,0)
msg.post("@render:", "draw_debug_text", { text = str, position = pos, color = vmath.vector4() } )
--
-- Create sprite
local game_object = factory.create("go#factory")
local distance = 200
local degrees = math.random(360)
local radians = math.rad(degrees)
local x = action.x + math.cos(radians) * distance
local y = action.y + math.sin(radians) * distance
go.set_position(vmath.vector3(x,y,0),game_object)
-- Tint sprite
local sprite = msg.url(nil,game_object,"sprite")
local r = math.random(255)/255
local g = math.random(255)/255
local b = math.random(255)/255
go.set(sprite, "tint", vmath.vector4(r,g,b,1))
-- Animate sprite
go.animate(game_object, "position", go.PLAYBACK_ONCE_FORWARD, vmath.vector3(action.x,action.y,0), go.EASING_INOUTSINE, 0.25, 0, function()
go.delete(game_object)
end)
end
end
MouseInputIssue.zip (670.3 KB)
Here is a new video, the issue happening around two seconds in:
All that out of the way, can anyone think of a solution to this quite clear cut issue?