O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a preloader

A preloader is a custom class that loads game assets ahead of time, while providing the player with some indication that the game is loading something. They serve to get the loading out of the way so it interferes with game play as little as possible. For our game, we'll make a preloader with a progress bar.

In order to make a preloader with a progress bar in Panda3D, we'll have to force the game to render frames to our window during the loading process. When the game is stuck in a function or method, it won't update the window automatically. To force an update, we can call base.graphicsEngine.renderFrame(). This will do two things for us:

  1. It will display the last processed frame in the window.
  2. It will process the next frame. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required