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

Ending event response

In order to tell an object which inherits from DirectObject to stop listening to events, we can use two methods. The first method, and the simplest, is ignoreAll(). A call to this method would look like the following:

self.ignoreAll()

This call turns off all event responses for the object. For instance, if we called this method within the World class, the World class would no longer respond to any of the events we have told it to listen to with self.accept.

The second method we can use is the ignore() method. We can provide ignore() with an event string name just like the accept() method to stop listening to that particular event. For example:

self.ignore("a")

That call would stop event response to the A key being pressed. ...

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