Code: Select all
Switch msg.action
Case "OnMouseDown":
oldmousex = MouseX()
oldmousey = MouseY()
Case "MouseDown":
newmousex = MouseX()
newmousey = MouseY()
yellowsquare.x = yellowsquare.x + (newmousex - oldmousex)
yellowsquare.y = yellowsquare.y + (newmousey - oldmousey)
oldmousex = newmousex
oldmousey = newmousey
T_Squares["yellow"][msg.id] = yellowsquare
ShowLayer("yellow"..msg.id, yellowsquare.x, yellowsquare.y)
Idea is that I am trying to have a button, that would be movable around by pressing left mousebutton down and holding it down until desired location is found.
However, im bit confused about "MouseDown" option, since i thought that would keep checking if mousebutton is still being pressed down, but i guess the idea is that it will only check it as long as you are inside the button event, that if you jump out of the CheckEvent(), and make the next CheckEvent() Hollywood doesnt understand to check if Leftmousebutton is still pressed down or not and to then jump to right place.
So is there a way to keep checking if MouseButton is still being pressed down inside a button without having to stay inside the button whole time?
Especially is there possibilty to trigger CheckEvent through checking if MouseDown is still happening?