Notifications
Clear all
[Closed] Start-Stop move object
Dec 15, 2020 11:30 pm
I need to make a script :
when the button is pressed – starts the movement of the object,
when the button released – stops the movement
I did it with a checkbutton,
but this is a bad idea, the checkbutton must be pressed twice
with a button no way to use release button
Is there a way to do this:
pressed the button – move
released the button – stop
for movement used this:
Timer.start()
Timer.stop()
3 Replies
Dec 15, 2020 11:30 pm
Use a .Net button instead:
(
rollout RO_TEST ""
(
dotnetcontrol bt_test "Button" height:24
fn GetButton args =
(
case args.Button of
(
(args.Button.Left) : "LEFT"
(args.Button.Right) : "RIGHT"
(args.Button.Middle): "MIDDLE"
)
)
on bt_test MouseDown sender args do print ("Mouse Down -> " + GetButton args)
on bt_test MouseUp sender args do print ("Mouse Up -> " + GetButton args)
)
createDialog RO_TEST
)
Dec 15, 2020 11:30 pm
for tasks like this I usually used the imgTag rollout control which has UP and DOWN button events