Skip to content

v20.18.0

Latest

Choose a tag to compare

@github-actions github-actions released this 26 Nov 14:25
d5d64fc

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 .ldtk file as an "ldtk" asset, then level.load("<asset>:<level>"), or level.load("<asset>") for the whole world
  • Sprite Fusion: built-in support for Sprite Fusion maps: load map.json or map.tmx as a "spritefusion" asset, its spritesheet comes with it
  • Tile maps: parallax is now supported on tile layers, through ratio, as on an ImageLayer; a Tiled tile layer's parallax factor sets it
  • Tile maps: tile layers can be built in code with TileLayer, Tileset, TilesetGroup and PlacedTileLayer, plus mergeGridRects for collision bodies
  • Tiled: a tile layer with a collider property 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, and setTileProperties gives 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 class ColorLayer fills its rectangle
  • Levels: registerObjectClass and registerObjectFactory register the classes a level builds, whatever editor it comes from
  • Levels: level.load takes objects, to choose which objects of a level are built
  • Levels: an object built from a level carries the level's id, so getChildByProp("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 throwing Unknown texture atlas format
  • TextureAtlas: TexturePacker's "JSON (Hash)" export is supported, as "JSON (Array)" is

Deprecated

  • Levels: registerTiledObjectClass and registerTiledObjectFactory, for registerObjectClass and registerObjectFactory (the same functions; the old names keep working)
  • Tile maps: TMXRenderer, TMXOrthogonalRenderer, TMXIsometricRenderer, TMXHexagonalRenderer and TMXStaggeredRenderer, for TileMapRenderer, OrthogonalRenderer, IsometricRenderer, HexagonalRenderer and StaggeredRenderer (the same classes; the old names keep working)
  • Tile maps: TMXTileMap and TMXTilesetGroup, for TileMap and TilesetGroup (the same classes)
  • Loader: loader.getTMX, for loader.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 with Unknown texture atlas format: ShoeBox
  • TypeScript: an asset's data accepts 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 renderMode property 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