Force OnRender() method

Javi400

New member
Joined
Jan 21, 2023
Messages
14
Hi!,
I have a loop in the OnUpdate() method and inside the loop, before it finishes, I need to refresh the screen. My question is, there a way to call the OnRender() method manually to force a screen refresh?
Thanks.
 

dawlane

Well-known member
CX Code Contributor
Tutorial Author
Joined
Jun 21, 2017
Messages
1,049
There's no way you can call or force the OnRender method from OnUpdate method. The only possible way is to use a list to store your own custom draw instructions that you can deal with in the OnRender method. You also have to remember that SetUpdateRate affects how many times OnRender will be called,
 
Last edited:

Gerry Quinn

Active member
Tutorial Author
Joined
Jun 24, 2017
Messages
170
You can probably do what you want with a flag - e.g. your OnUpdate method sets halfDone = True and exits, then next time it checks the status and does the other half.

If you want something as finicky as this, though, consider skipping OnUpdate() entirely and doing everything in sequential OnRenders.
 
Top Bottom