OnUpdate not working. D=
At the moment I'm just fiddling around, trying to set up a basic clock. I'm unsure of what I'm doing wrong here.
lua Code:
|
I think that OnUpdate would fire whenever your text field itself is updated. To have something update the clock periodically, try:
Lua Code:
This will cause it to update text once per second (which is honestly all you really need to do for a clock) |
Hmm I was under the impression that OnUpdate is something that got fired every frame.
|
Hey,
Your code should work, but make sure that the tkClock is visible (tkClock:SetHidden(false)). OnUpdate will not fire when the control is hidden. |
It's not hidden. I added a few things to make sure.
lua Code:
|
@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. |
Quote:
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. |
Quote:
|
All times are GMT -6. The time now is 11:48 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI