0

i have a problem with entity priorities. I created two 2D 'quad' entities with different colors, but when they appear on the screen sometimes the color of one prevails and other times that of the other.

from ursina import *
app = Ursina()

o = Entity(model='quad', scale_x=0.3, scale_y=0.3, collider="box", color=color.red,position=(-0.45,-1.4))
Re_bianco = Entity(model='quad', scale_x=0.3, scale_y=0.3, collider="box", position=(-0.5,-1.4))
app.run() 

white quad red quad

I tried to use the z axis, but the result is not optimal because by offsetting the z axis the quarter distorts. and even overlapping them you can see both.

from ursina import *
app = Ursina()

o = Entity(model='quad', scale_x=0.3, scale_y=0.3, collider="box", color=color.red,position=(-0.5,-1.4,0))
Re_bianco = Entity(model='quad', scale_x=0.3, scale_y=0.3, collider="box", position=(-0.5,-1.4,1))
app.run()

red_white_quad

Thanks for your help

1 Answers1

1

Currently both entities are at the same depth, 0. How can the program know which one should be rendered above the other? You can specify this by giving a third position value, for example, position=(-0.45, -1.4, -1), which would be in front of an entity at position (-0.5, -1.4, 0)

pokepetter
  • 1,383
  • 5
  • 8