Author Topic: Dynamic Font draw on Model  (Read 2660 times)

wangzy_88

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Dynamic Font draw on Model
« on: December 11, 2013, 10:00:15 PM »
Dynamic Font Label and Sprite after Model,but Label draw on Model,no matter how I change z.
It's a bug?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic Font draw on Model
« Reply #1 on: December 12, 2013, 12:23:56 AM »
Everything in NGUI is drawn on render queue 3000 or higher, depending on the draw call index.

You can force a specific render queue by specifying it on the Panel.

wangzy_88

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Dynamic Font draw on Model
« Reply #2 on: December 12, 2013, 01:00:02 AM »
Thanks for reply,but when I change the RenderQueue,all UI elements will behind model.
At first,only dynamic font render not match it's z.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Dynamic Font draw on Model
« Reply #3 on: December 12, 2013, 01:14:09 AM »
I don't understand your last reply.

Render queue lets you control the draw order. Behind or in front, it all depends on the render queue.

Dynamic fonts are on a separate draw call (+1), which is why they are in front by default -- it's how the draw order is ensured.

If you want to mix UI elements with 3D objects in your game view, then I don't recommend you using non-atlased fonts. If you force the render queue to say, 3000, so that it mixes with your geometry, then you are going to have issues because your atlas geometry will be drawn with the same render queue as your text, and since the two are inherently in different draw calls, which one is going to be in front is completely arbitrary.

wangzy_88

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Dynamic Font draw on Model
« Reply #4 on: December 12, 2013, 03:17:29 AM »
I understand,thank you.