Hello, sorry to bother again
I have using mr. Britzl extension librarieshttps://defold.com/assets/defoldinput/ for user input drag and drop but it’s have unstable behaviour when i drag and drop
this is my code in cursor controller
function on_message(self, message_id, message, sender)
local card_scale = go.get_scale(message.id)
-- cursor is click and start drag
if message_id == cursor.CLICKED or message_id == cursor.DRAG_START then
print("Clicked and drag start", message.id, message.group, message.x, message.y)
local new_scale = vmath.vector3(card_scale.x + (card_scale.x*.14), card_scale.y+(card_scale.y*.14), card_scale.z)
go.set_scale(new_scale, message.id)
end
end
this is my object code
function on_message(self, message_id, message, sender)
if message_id == cursor.RELEASED or message_id == cursor.DRAG_END then
print("release and drag end",message_id, message, sender)
go.set_scale(self.initial_scale)
end
end
this is my debug result
DEBUG:SCRIPT: Clicked and drag start hash: [/cards] hash: [card] 250.5 159.16064453125
DEBUG:SCRIPT: release and drag end hash: [drag_end] table: 0x0259b520 url: [main:/cursor#cursor]
DEBUG:SCRIPT: release and drag end hash: [released] table: 0x02dc1020 url: [main:/cursor#cursor]
DEBUG:SCRIPT: Clicked and drag start hash: [/cards] hash: [card] 293.5 625.32800292969
DEBUG:SCRIPT: release and drag end hash: [released] table: 0x02a35830 url: [main:/cursor#cursor]
DEBUG:SCRIPT: Clicked and drag start hash: [/cards] hash: [card] 274.5 586.10357666016
DEBUG:SCRIPT: release and drag end hash: [drag_end] table: 0x02db3210 url: [main:/cursor#cursor]
DEBUG:SCRIPT: release and drag end hash: [released] table: 0x02db3f80 url: [main:/cursor#cursor]
DEBUG:SCRIPT: Clicked and drag start nil nil 207.5 405.06768798828
DEBUG:SCRIPT: Clicked and drag start nil nil 242.5 616.27618408203
DEBUG:SCRIPT: Clicked and drag start nil nil 228.5 329.63610839844
DEBUG:SCRIPT: Clicked and drag start nil nil 205.5 373.38641357422
DEBUG:SCRIPT: Clicked and drag start nil nil 195.5 249.67858886719
DEBUG:SCRIPT: Clicked and drag start nil nil 204.5 415.62811279297
DEBUG:SCRIPT: Clicked and drag start hash: [/cards] hash: [card] 187.5 311.53253173828
DEBUG:SCRIPT: release and drag end hash: [drag_end] table: 0x02da9040 url: [main:/cursor#cursor]
DEBUG:SCRIPT: release and drag end hash: [released] table: 0x02da9790 url: [main:/cursor#cursor]
why the result unstable and how to fix it?
thank you