Welcome! Log In Create A New Profile

Advanced

controlling which object is on top, if multiple at same position

Posted by lyt4 
controlling which object is on top, if multiple at same position
March 16, 2020 10:07AM
Hi,
If I have multiple objects in the same location, how do I control which will be overlaid on the others? (i.e., which is visible?)

i.e,, let's say I do:
object1 = mgladdcircle(...)
mglsetorigin(object1, position)
mglactivategraphic(object1, true);

object2 = mgladdcircle(...)
mglsetorigin(object2, position)
mglactivategraphic(object2, true);

and I want object 1 to be "on top?"
Thanks!
Re: controlling which object is on top, if multiple at same position
March 16, 2020 11:17AM
Your code will display object1 on top of object2. The first created are displayed in the foreground.

See also https://monkeylogic.nimh.nih.gov/board/read.php?2,12,12#msg-12.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.