Author Topic: NGUI Best Practices  (Read 6332 times)

Moradom

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 15
    • View Profile
NGUI Best Practices
« on: December 28, 2013, 08:46:47 PM »
Hello all,

I was wondering if there was a collection of best practices (optimization tricks) when using NGUI. I couldn't find one centralized place. For example is it recommended to deactivate a panel if it goes off the screen? Looking to take the arcane knowledge of NGUI best practices that cannot be derived from the documentation (or easily from new users) into one collection.

I think it would be a great thing to have something like this from experienced users and the developer! Maybe we can start with this thread, if you know a great resource (other than the docs ;o) were people share their thoughts or if you have thoughts. Post it here!

Thanks
« Last Edit: December 28, 2013, 09:45:34 PM by Moradom »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Best Practices
« Reply #1 on: December 29, 2013, 01:19:25 AM »
There is no sense to keep an active panel off-screen, so yes it's a good idea to disable it. There are these "best practices" posts being started every other week it seems, but they don't go very far. Feel free to ask about specific things and I will clarify / suggest if I can.

DevFromSpace

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: NGUI Best Practices
« Reply #2 on: December 30, 2013, 07:23:19 AM »
What are the best practises to reduce draw calls using dynamic fonts with ngui 3.0.8?


and one more question if i have different groups of windows in my hierarchy: [stats][skills][inventory]
what is the best way to hide/display them, still on 3.0.8?
-enable/disable?
-use a UIPanel on each group and set alpha to 0?
« Last Edit: December 30, 2013, 07:35:44 AM by DevFromSpace »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Best Practices
« Reply #3 on: December 30, 2013, 01:13:35 PM »
1. You can place all dynamic labels on the same depth. This will make them share the same draw call.

2. TweenAlpha them out, with the "what to do after tween finishes" set to disable the object.