View Single Post
07/04/14, 07:56 PM   #7
InfiniteShift
Join Date: Jun 2014
Posts: 4
Originally Posted by Seerah View Post
  1. It's GuiRoot, not Guiroot.
  2. I don't recall 100%, but you may need to use the OnUpdate on a frame, not just on a label.
  3. There was a bug back in beta that I don't think ever got fixed - your frame will not recognize an OnUpdate handler unless the frame was created via XML. (Try Sasky's method instead, or switch to XML - you're giving your frame a global name anyway.)

@Sasky: OnUpdate fires for every update of the UI (every frame draw).

@InfiniteShift: Because of the above, if you have 60 fps, your OnUpdate script will be run 60 times per second. You don't need your clock to be that precise. Use the second return from OnUpdate (or set a delay using the second arg of EVENT_MANAGER:RegisterForUpdate) to create a buffer.
I was more or less trying to get the OnUpdate script to just work rather than being optimized.
So all frames not created by XML will not work with the OnUpdate handler? I guess that won't really matter with RegisterForUpdate in the event manager. Anyway, thanks.
  Reply With Quote