Physics.P2.Body#addPhaserPolygon()

addPhaserPolygon(key, object) → {Array}

Reads the shape data from a physics data file stored in the Game.Cache and adds it as a polygon to this Body.
The shape data format is based on the output of the
custom phaser exporter for
PhysicsEditor

Parameters
Name Type Description
key string

The key of the Physics Data file as stored in Game.Cache.

object string

The key of the object within the Physics data file that you wish to load the shape data from.

Returns
Array -

A list of created fixtures to be used with Phaser.Physics.P2.FixtureList

Source code: physics/p2/Body.js (Line 1310)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.