Per Layer Collider Configuration
Given a Tiled tile layer name or id you can configure
- Whether to use tile colliders regardless of solid=true|false
- Whether to use the tile colliders when the layer is not visible
- Force a layer to be solid or not overriding anything specified in tiled
- Add a collision group to use for the tile layer
const tiledMap = new TiledResource('./orthogonal.tmx', {
useMapBackgroundColor: true,
layerConfig: {
"Above": {
isSolid: true
useTileColliders: true,
//useTileCollidersWhenInvisible: true, // use this instead of above usually
collisionGroup: new ex.CollisionGroup("above", 0x01, 0x00111)
}
}
});
Rotating Tile Colliders
- Tiles with custom collider rotations were not respected previously, this is fixed by actually applying the rotation to the point transformation. Tested on all polygon types Boxes and Polygons
<tile id="117"> <objectgroup draworder="index" id="2"> <object id="1" x="0.181818" y="4.18182" rotation="88"> <polygon points="0,0 2.09091,-2.36364 7.63636,-2.45455 9.81818,0.454545 14.3636,0.545455 15.5455,1.63636 15.9091,8.81818 14.7273,9.72727 1.90909,9.63636 -0.0909091,7.54545"/> </object> <object id="6" x="-0.272727" y="0.363636" width="3.81818" height="2.72727" rotation="31"/> </objectgroup> </tile>
- Objects using templates also did not work properly with custom colliders when flipped horizontally/vertically. Note the presence of gid on the template object, this was previously unhandled by the plugin and confused the parser.
<object id="2" template="coin.tx" gid="3221225698" x="47.75" y="80" rotation="179" visible="1"/>
What's Changed
- chore: Update dependency fast-xml-parser to v4.5.1 by @renovate in #578
- chore: Update dependency excalibur to v0.30.2 by @renovate in #580
- chore: Update dependency excalibur to v0.30.3 by @renovate in #581
- chore: Update dependency typescript to v5.7.3 by @renovate in #582
- chore: Update dependency ts-loader to v9.5.2 by @renovate in #584
- fix template & objects with custom collider rotations defined do not work appropriately by @eonarheim in #585
- chore: Update dependency @types/node to v22.10.7 by @renovate in #554
- feat: add layer collider configuration by @eonarheim in #586
Full Changelog: v0.30.0...v0.30.2