Repository navigation
Highlights: LDtk levels and Sprite Fusion maps now load with level.load, as Tiled maps do. Sprites take about 45% less CPU time to update and draw on WebGL and WebGPU. TextureAtlas is more generic: it reads more formats and tools, such as spritesheet.dev.
Added
- LDtk: built-in support for the LDtk level format: load a
.ldtkfile as an"ldtk"asset, thenlevel.load("<asset>:<level>"), orlevel.load("<asset>")for the whole world - Sprite Fusion: built-in support for Sprite Fusion maps: load
map.jsonormap.tmxas a"spritefusion"asset, its spritesheet comes with it - Tile maps: parallax is now supported on tile layers, through
ratio, as on anImageLayer; a Tiled tile layer's parallax factor sets it - Tile maps: tile layers can be built in code with
TileLayer,Tileset,TilesetGroupandPlacedTileLayer, plusmergeGridRectsfor collision bodies - Tiled: a tile layer with a
colliderproperty set to true is solid - Tile maps:
"tilemap"asset type, a neutral name for"tmx", for maps written by other tools - Tile maps:
layer.getTileProperties(col, row)gives the properties of the tile at a position, andsetTilePropertiesgives that one tile its own ColorLayer: given a size, it fills that rectangle where it is instead of the whole canvas; a map object of classColorLayerfills its rectangle- Levels:
registerObjectClassandregisterObjectFactoryregister the classes a level builds, whatever editor it comes from - Levels:
level.loadtakesobjects, to choose which objects of a level are built - Levels: an object built from a level carries the level's
id, sogetChildByProp("id", id)finds it TextureAtlas: an atlas from a tool it does not know by name (such as spritesheet.dev) loads when it has the TexturePacker or Aseprite JSON layout, instead of throwingUnknown texture atlas formatTextureAtlas: TexturePacker's "JSON (Hash)" export is supported, as "JSON (Array)" is
Deprecated
- Levels:
registerTiledObjectClassandregisterTiledObjectFactory, forregisterObjectClassandregisterObjectFactory(the same functions; the old names keep working) - Tile maps:
TMXRenderer,TMXOrthogonalRenderer,TMXIsometricRenderer,TMXHexagonalRendererandTMXStaggeredRenderer, forTileMapRenderer,OrthogonalRenderer,IsometricRenderer,HexagonalRendererandStaggeredRenderer(the same classes; the old names keep working) - Tile maps:
TMXTileMapandTMXTilesetGroup, forTileMapandTilesetGroup(the same classes) - Loader:
loader.getTMX, forloader.getTileMap(the same function)
Performance
- Rendering: sprites take about 45% less CPU time to update and draw on WebGL and WebGPU (10,000 sprites on WebGL: 8.6 to 4.9 ms a frame), and about 60% less when they rotate
Fixed
TextureAtlas: a ShoeBox atlas made with the melonJS exporter was refused withUnknown texture atlas format: ShoeBox- TypeScript: an asset's
dataaccepts a parsed map object - Tile maps: a floating tile layer disappeared once the camera moved
- Tile maps: two tilesets cut from one image at different tile sizes drew the same tiles
- Tile maps: a tile layer removed at run time kept its GPU texture until the next level
- Tiled: a frame drawn right after a level loaded could show its layers back to front
- Tiled: a
renderModeproperty on a tile layer was ignored - Tiled: each level load leaked a viewport-resize handler
- Tiled: a map with an object layer, an image layer or another group inside a group layer failed to load
- Tiled: the layers of a group of three or more were drawn over the map layers that follow the group; a layer after a group now takes the depth that follows the group's last layer
- Tiled: a group layer's tint is applied to the tile layers inside it
ImageLayer: a layer that does not repeat on an axis smeared its edge pixels across the view on WebGL, and a picture larger than the view was cut off as the camera moved over it
Full Changelog: 20.17.0...20.18.0