- I found that the best thing was to ask myself what this or that line was meant to accomplish, and then to search labs.phaser.io for a Phaser 3 example of that task.
- Usually the issue is just that a function has moved, or some property now requires a setter.
- There's a real migration guide here: part 1, part 2
- the default camera is now
scene.cameras.main
, notgame.camera
- factories are part of the scene:
game.add(x)
→scene.add(x)
game.world.bringToTop(x)
→scene.children.bringToTop(x)
- they must be created (using
.create
) before they're added - changing the frame for a sprite requires
sprite.setFrame(x)
- in fact,
sprite.frame = x
will break rendering for that sprite
- in fact,
sprite.exists = x
→sprite.setActive(x)
- or
sprite.setVisible(x)
, depending on what you're trying to accomplish
- or
- retrofonts are gone as a first-class thing
- instead use
RetroFont.Parse
on a config object to create a bitmapfont and add that.
game.load.tilemap(key, url, null, Phaser.Tilemap.TILED_JSON)
→scene.load.tilemapTiledJSON(key, url)
- AFAICT, the ability to pass an already-loaded json tilemap (i.e. the third argument to
load.tilemap
) is gone. I had to let Phaser fetch my tilemaps, which in turn meant having Webpack treat them as "data" files and not JS. The procedure for that is annoyingly nonobvious.
- e.g.
Phaser.Rectangle
→Phaser.Geom.Rectangle