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

Prioritizing tasks

When a task is added to the task manager, it may be given an optional priority. We've actually seen these priorities already; remember the sort column of the print(taskMgr) output? That column shows the priorities assigned to the tasks in the task manager. Tasks with a lower priority are executed before tasks with a higher priority. That may seem a little backwards, but that's the way it is.

The default priority of a new task is 0. To assign a different priority, just add a priority number to the end of the add or doMethodLater call.

taskMgr.add(self.myTask, "My Task Name", 5)
taskMgr.doMethodLater(10, self.myTask, "My Task Name", 129)

Tasks with the same priority number are executed in no particular order, and that order may ...

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