[SOLVED] Making sure clicked image element is always in front of others

Hey guys,

I’m curious about how one could ensure that an image element always shows on top of another if clicked and dragged on top of another(assuming the dragging works)?

Hi @DevilZ,

I’ve done something similar recently, dragging an element on top of other. The rendering order for elements is always bottom to top as defined in the hierarchy, first to last (last renders on top).

So to have your element render on top you can reparent it to be last in the hierarcy:

pieceDragged.reparent(parentEntity, parentEntity.children.length - 1);
3 Likes

Let me try this. I’m sure it’ll work. Thanks again @Leonidas!

1 Like

Hey @Leonidas, just wanted to confirm it works. Your help was invaluable!

1 Like