@excaliburjs/plugin-spritefusion
v0.29.0
Published
Excalibur Sprite Fusion Plugin
Downloads
7
Readme
Excalibur SpriteFusion Tile Map Plugin
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
Installation
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.
Documentation
For more information visit https://excaliburjs.com