Hello. me and a friend are trying out the Defold editor and seem to have come onto a roadblock. In the end we want to create a Drag and drop object which we choose from an UI but we are having trouble to spawn the object requested.
For example we want to spawn a rectangle shape which is in an atlas and on click/touch to create that shape on that position.
Thanks in beforehand!
[EDIT] I “solved” it.
function init(self)
msg.post(".", “acquire_input_focus”)
end
function on_input(self, action_id, action)
if action_id == hash(“mouse_left”) and action.released then
local p = factory.create("#block_factory", vmath.vector3(action.x, action.y, 0), nil, {}, 1.5)
end
end