function onUpdate(elapsed)
setProperty('mouseF.x', getMouseX('other'))
setProperty('mouseF.y', getMouseY('other'))
if objectsOverlap('mouseF','sprite') then
setProperty('sprite.alpha', 1)
if mousePressed('left') then
setProperty('sprite.x', ?)
setProperty('sprite.y', ?)
end
else
setProperty('sprite.alpha', 0.6)
end
end
I want to somehow grab an object(sprite) with the mouse
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
Describe your problem here.
Script:
function onCreatePost() makeLuaSprite('mouseF', '', 0, 0) setProperty('mouseF.alpha', 1) makeGraphic('mouseF', 5, 5, 'ffffff') setScrollFactor('mouseF', 0, 0) setObjectCamera('mouseF', 'other') addLuaSprite('mouseF', true)
end
function onUpdate(elapsed) setProperty('mouseF.x', getMouseX('other')) setProperty('mouseF.y', getMouseY('other')) if objectsOverlap('mouseF','sprite') then setProperty('sprite.alpha', 1) if mousePressed('left') then setProperty('sprite.x', ?) setProperty('sprite.y', ?) end else setProperty('sprite.alpha', 0.6) end end
I want to somehow grab an object(sprite) with the mouse
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
No response