This plugin supports the SpriteFusion data structure as of version 1.6.0!
Sprite Fusion is a new lightweight Tilemap editor, check it out here https://www.spritefusion.com/editor
Export your map as JSON
, IMPORTANT Do not use the "save" option in the current version of the plugin.
npm install @excaliburjs/plugin-spritefusion
Create your resource, load it, then add it to your scene!
const game = new ex.Engine({...});
const spriteFusionMap = new SpriteFusionResource({
mapPath: './map/map.json',
spritesheetPath: './map/spritesheet.png'
});
const loader = new ex.Loader([spriteFusionMap]);
game.start(loader).then(() => {
spriteFusionMap.addToScene(game.currentScene);
});
Example using custom factories with tile id's.
const spriteFusionMap = new SpriteFusionResource({
mapPath: './map/map.json',
spritesheetPath: './map/spritesheet.png',
entityTileIdFactories: {
0 : (props) => {
return new ex.Actor({
pos: props.worldPos,
width: 16,
height: 16,
color: ex.Color.Red,
z: props.layer.order + 1
});
}
}
});
Specify the tile id according to this scheme, you can use this to select special tiles to run the factory.
For more information visit https://excaliburjs.com