Creating custom Box2D shape components in PushButton Engine
Sep 24, 2009
1 minute read
If you ever need to use other ways of creating Box2D shapes that are not currently available
in PushButton Engine, you can simply make one yourself. You’ll just need to create a subclass of CollisionShape
and use it just like the PBE shape classes.
Here’s a sample class we use to create an oriented box shape:
As you can see, the class inherits from CollisionShape and overrides the doCreateShape method in order to create the actual
Box2D oriented box shape from there. Use it in the level files like this: