#Sometimes Text gets rendered behind sprite

9 messages · Page 1 of 1 (latest)

white dove
#

I have a system that resizes the background sprite of a text dynamically as the text changes. When this system is active, during runtime the text gets rendered behind its background despite explicitly setting the texts Z value to 1.0 and the sprites 0.0.

outer coyote
#

and the text is not UI text? very wierd

white dove
#

It is just a Text2dBundle

#

Could be but I doubt it because, in the bevy examples they literally have this code (I tried switching the hierarchy but it produced the same result)

#

What do you mean? It is a Text2dBundle parented to a SpriteBundle

#

yes, and I tried the other way. Having the sprite be the parent with 0.0 and the text being the child with 1.0. My code is the other way around because I tried the example first

#

Without the sprite? Do you mean without parenting them?

#

setting the color could really produce something like this -.^?

mortal mauve
#

The sprite is a child of the text, so the sprite’s relative z value is zero.