Moving an object to the foreground when it is dragged

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

Moving an object to the foreground when it is dragged

Post by félix » Tue Jan 09, 2018 1:49 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

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

Post by jmburnod » Tue Jan 09, 2018 1:57 pm

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
https://alternatic.ch


félix
Posts: 16
Joined: Mon Jan 08, 2018 10:38 am

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

Post by félix » Wed Jan 10, 2018 1:41 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9356
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

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

Post by richmond62 » Wed Jan 10, 2018 7:35 pm

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.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”