Repository navigation
v20.14.0
Added
- Loader: asset bundles, to load and free a level's assets together:
loader.preload({ common: […], level1: […] }), thenloader.load("level1")/loader.unload("level1"); an asset shared by several bundles is fetched once and freed with the last (#1656) - Physics:
world.setAdapter()switches the physics adapter of a running game, rebuilding every body from itsbodyDef - Physics: every adapter class has
load()andcreate()(PhysicsAdapterClass), soawait X.create(options)makes any adapter the same way - nx.js (the Nintendo Switch homebrew framework) and Web Workers (experimental): melonJS runs with no DOM, drawing to a canvas passed as
settings.canvas; JSON Tiled maps, touch and audio work - Loader: the error a failed asset rejects
preload()with keeps the parser's own error as itscause
Changed
- Physics:
world.adapteris read-only; switch adapters withworld.setAdapter()
Fixed
- Application: one very slow update no longer freezes the game for good (since 20.12, a heavy first frame could)
- 3D:
GLTFModel#scale()works instead of throwing - 3D: a
GLTFModelfollowspos,depth,rotateandscalewhen no animation is playing - 3D: a container's children are drawn at its depth under
Camera3d - 3D: lit meshes in a moved or rotated container are lit where they are
- 3D:
Camera3dno longer culls a frame late after the camera moves - 3D: a normalized
Meshno longer rewrites the vertex array it was given, which shrank later meshes and scenes of the same model - 3D: on the Canvas renderer, a textured mesh with an MTL material draws its texture instead of a white silhouette
- 3D: on the Canvas renderer, a mesh's near side is drawn over its far side, not the other way round
- 3D: on the Canvas renderer, low-poly palette models are shaded along their texture as on the GPU renderers, with no seams between triangles
- Sprite:
addAnimation()skips frames the texture lacks, with a warning, instead of crashing later - UI: a widget removed while hovered gets its
onOut() - Input: keys held when the window loses the focus are released
- Input: a region with only a
"pointerup"callback receives it - Input: each finger on a multi-touch region gets its own
pointerup - Input: the mouse wheel no longer releases a key bound with
bindPointer() - Input: the pointer position stays right after browser zoom or a move to another screen
- Input:
Draggablefollows the pointer under a scrolled or zoomed camera - Audio:
setVolume()is applied once, not twice - Audio:
playTrack()on a paused track restarts it - Audio:
pauseTrack()/resumeTrack()act on the track only - Audio:
stop(name)keeps the clip'son.endcallback - Audio: a sound following a pooled object stops when the object is recycled
- Tiled: tile layers use the map's render order
- Tiled: the camera reaches every painted tile of an infinite map
- Tiled: the isometric
drawTile()places tiles where the layer does - Tiled: an XML map (
.tmx,.tsx) loaded where there is noDOMParserfails with an error saying to export it as JSON (.tmj,.tsj), instead of "DOMParser is not defined" - Loader: unloading an image also frees its GPU texture
- Physics: a renderable with a
bodyDefreceives pointer events under the matter and planck adapters, as on the built-in - Physics: the built-in
isGrounded()needs a surface under the body; one never stepped, or held in mid-air, read as grounded - Physics: the built-in
raycast()skips a body the ray starts inside, as the other adapters do - Physics: a body removed by its partner's collision handler is no longer told about that contact
Contributors
@snowyukitty
Full Changelog: 20.13.0...20.14.0