Page 1 of 1

Moving an object to the foreground when it is dragged

Posted: Tue Jan 09, 2018 1:49 pm
by félix
Hello,

When in run mode, it's very easy to drag an object using "grab me".

However when to object is dragged over another object, sometimes it goes on top, and sometimes it goes under.

Is there a way to move an object on top of everything (topmost) when dragged ?

Thanks in advance
Félix

Re: Moving an object to the foreground when it is dragged

Posted: Tue Jan 09, 2018 1:57 pm
by jmburnod
Hi Felix
Is there a way to move an object on top of everything (topmost) when dragged ?
Yes, you can set the layer of a object.
If the owner of your object is a group you have to know what is the layer of last object of the group and that should be the max top layer you can use
Best regards
Jean-Marc

Re: Moving an object to the foreground when it is dragged

Posted: Tue Jan 09, 2018 2:18 pm
by richmond62

Re: Moving an object to the foreground when it is dragged

Posted: Wed Jan 10, 2018 1:41 pm
by félix
Splendid ! Many thanks.

I thought HyperCard was simple.
Image
LC is even more simpler.

on mouseDown
set the layer of me to top
grab me
end mouseDown

Re: Moving an object to the foreground when it is dragged

Posted: Wed Jan 10, 2018 7:35 pm
by richmond62
Part of the reason for that is that HyperCard only has 2 layers: foreground and background, while
LiveCode has as many as the number of objects on a card (each object is in its own layer).
HCH.png
Not very helpful at all.