LittleJS 1.28.0

Box2D

Box2dTileLayer

Box2d Tile Layer

  • adds Box2d support to tile layers
  • creates static box2d fixtures for solid tiles, call buildCollision to rebuild them after the tiles change

Extends Box2dStaticObject

Constructor

new Box2dTileLayer(tileLayer)box2d.js:1241

Create a Box2d tile layer object

tileLayer TileCollisionLayer

Tile layer for this object

Members

Methods

Inherited from Box2dObject

Inherited from EngineObject

Members

The tile layer

Methods

buildCollision(friction, restitution)box2d.js:1266

Create box2d collision fixtures for solid tiles

friction number optional, default 0.2
restitution number optional, default 0