Author Topic: About 2.0.4c's UIPanel.widgetsAreStatic property  (Read 5438 times)


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
About 2.0.4c's UIPanel.widgetsAreStatic property
« on: May 03, 2012, 08:03:29 PM »
Figured I'm gonna have to explain this one... If you want to boost performance on mobile devices, you can now mark your panels as static using a new checkbox I've added. This means that you expect that the panel's widgets' transform is not going to change (ie: you will not move / rotate / scale them). If the panel is marked as static, it will not check to see if its contents have moved every frame, resulting in better framerate, but breaking some functionality such as scroll bars and highlighting.

I've updated the scroll view example to show how it's used. There most panels have this set to 'true', since they don't move. Note that moving the panel itself doesn't count as moving widgets, so it will work fine regardless of the state of "widgetsAreStatic".

This option is especially useful for scroll view contents on mobile platforms. If you have a long list of widgets under a UIDraggablePanel that you want to scroll through, marking its panel as static will grant you a noticeable performance boost.

You can also toggle this on/off at will. For example, you can leave your panels as static most of the time, and turn this option off when you press any button.