MouseStillDown not caught by Group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
MouseStillDown not caught by Group
I am creating a card game using RunRev. I have seen (and created) many games where each card is a button and a pair of handlers for mouseDown and mouseStillDown reset the location of the button, allowing the user to drag objects around within the window. This works fine, but I need to have several text and image fields as part of my card, so I want to use a group instead. When I put the same script I have already tested in a button into a group, the mouseDown message is caught, but not mouseStillDown. So the card moves a bit to a new location within the boundaries of the old location, but doesn't continue to move with the mouse the way a button would. I'm on OSX 10.5 using Revolution Media 4.0.0 build 950. (I wanted to see if I could get the basics working before upgrading my old license from 2.5.)
(I have also noticed that the boundary of the group is apparently set by the front-most object in the group, rather than being constructed from all the boundary boxes of the components, which was an unwelcome surprise, but I can work around that by putting an invisible button on top of the rest of the group components.)
Any suggestions?
Thanks,
Elizabeth Dalton
(I have also noticed that the boundary of the group is apparently set by the front-most object in the group, rather than being constructed from all the boundary boxes of the components, which was an unwelcome surprise, but I can work around that by putting an invisible button on top of the rest of the group components.)
Any suggestions?
Thanks,
Elizabeth Dalton
Re: MouseStillDown not caught by Group
Bonjour Elisabeth,
I don't understand why "mouseStillDown" doesn't work inside of the groups, but you can use "while the mouse is down" rather than this command. So, you can put this kind of formula in the script of the group itself :
on mousedown
repeat while the mouse is down
put the target into lacible
set the loc of lacible to the mouseloc
end repeat
end mousedown
It will works even if the position of the object is locked
With the hope that it will help you.
Regards
Renaud
I don't understand why "mouseStillDown" doesn't work inside of the groups, but you can use "while the mouse is down" rather than this command. So, you can put this kind of formula in the script of the group itself :
on mousedown
repeat while the mouse is down
put the target into lacible
set the loc of lacible to the mouseloc
end repeat
end mousedown
It will works even if the position of the object is locked
With the hope that it will help you.
Regards
Renaud
Re: MouseStillDown not caught by Group
Thank you-- this moves the target button in the group, but not the rest of the group. I will experiment some more.
Edited to add:
"put me into lacible" instead of "put the target into lacible" works. Apparently "the target" gets the button at the front of the group, but "me" gets the group itself.
Edited to add:
"put me into lacible" instead of "put the target into lacible" works. Apparently "the target" gets the button at the front of the group, but "me" gets the group itself.
Re: MouseStillDown not caught by Group
Sorry I didn't understood that you want to move all the group and not only one object (the target)in the group...
I'm happy to see you've founded the solution with : "me"
I'm happy to see you've founded the solution with : "me"
Re: MouseStillDown not caught by Group
Hi Elizabeth,
My name is Josep, today I read your article about the RPG creation and I like collaborate with you.
Salut,
Josep M
My name is Josep, today I read your article about the RPG creation and I like collaborate with you.
Salut,
Josep M
Re: MouseStillDown not caught by Group
Hi,
I think the "owner" is better than "me"
You can use also the mousemove message instead a loop with repeat.
Have a look at the stack in attachment
Best regards
Jean-Marc
I think the "owner" is better than "me"
You can use also the mousemove message instead a loop with repeat.
Have a look at the stack in attachment
Best regards
Jean-Marc
- Attachments
-
- DragGroupByMouseMove.livecode.zip
- (1.21 KiB) Downloaded 298 times
https://alternatic.ch
Re: MouseStillDown not caught by Group
Not sure whats up with your group size not respecting the bounds of all objects within the group. Unless you have the lockloc on and have since adjusted the contents of the group? Adding 4 buttons, selecting them and clicking 'group' should set the size of the group to contain all selected objects. If it IS a lockloc issue, you have to manage the size of the group yourself in code.