legendaryious Posted January 6, 2020 Share Posted January 6, 2020 (edited) Hey I drew some rects with Pixi graphics and I like to put sprites and text on top. Eventhough the pictures and text get added after the graphics have been added to the scene, the rects seem to have highest layer. I might wanna use pixi layers but I am not sure how I can assign a layer to a graphics rect. Can someone help me? Edited January 6, 2020 by legendaryious Quote Link to comment Share on other sites More sharing options...
jonforum Posted January 6, 2020 Share Posted January 6, 2020 (edited) the order is important `addChild(rec,sprite,txt)` should work of if not possible `addChild(sprite,txt)` then `addChildAt(rec,0);` for pixi layer it will be something like `addChild(txt,sprite,rec)` `txt.parentGroup = goup2` `sprite.parentGroup = goup1` `rec.parentGroup = goup0` Edited January 6, 2020 by jonforum Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 6, 2020 Share Posted January 6, 2020 Elements are rendered in natural tree order. parent,child1, child2, child3. If you add agraphics inside text - of course it will appear on top. Make a container, add a graphics and text there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.