Now Loading Page

Hi all,
I’m trying to make page now loading…

in manual use DirectWaitBar

but i don’t know how to use it
i want to start my game and finish loading bar at the same time… :confused:

help me plz :cry:
and show me some code
thank you

:cry: T_T

def checklogin(self):
if (self.entry1.get()==self.username) & (self.entry2.get()==self.password) :
self.hidelogin()
load = Loading() #show animation loading page
t = Town() #go in to the game

this is my code
i want to show animation loading page when class Town is loading
but it show empty black screen when load class Town not my animation

why?
some one help me plz :cry:

Hi!

Sorry, I’m not a programmer, hopefully, someone from ETC could show us how this is done

[edited: wrong answer]

Regards,
Broken

I’m just guessing, but probably your problem is that you’re not rendering any frames between the time you set up your animation onscreen and the time you start to load. So nothing gets updated onscreen.

Panda is by default single-threaded, so when your load task goes off and starts loading, it locks up the rest of the system until it is done. One way around this is to write your load task so that it does only one step at a time, and returns from the task function every once in a while, to resume again next time.

Another approach is to compile Panda with threading support enabled, and put your load task in a separate thread. This is dangerous if you’re not familiar with threading issues (you can get in trouble when you start writing code that runs in parallel with itself if you’re not very careful).

A third approach is to compile Panda with threading support enabled, then use the asynchronous loading options, which makes Panda take care of all of the threading issues, and your Python code can still run safely in a single thread.

If you don’t want to recompile Panda or redesign your load task, a final option is to call base.graphicsEngine.renderFrame() after you have put your loading screen up, and before you start to load stuff. This will cause Panda to render a single frame, which will at least enable the user to see your loading screen.

David

:astonished:
thank you very much for your answer, drwr