release notes
release notes
Published 10/6/2021
Pre-ReleasePre-releasePhaser 3.60 contains support for Compressed Textures. It can parse both KTX and PVR containers and within those has support for the following formats: ETC, ETC1, ATC, ASTC, BPTC, RGTC, PVRTC, S3TC and S3TCSRB. Compressed Textures differ from normal textures in that their structure is optimized for fast GPU data reads and lower memory consumption. Popular tools that can create compressed textures include PVRTexTool, ASTC Encoder and Texture Packer.
Compressed Textures are loaded using the new this.load.texture method, which takes a texture configuration object that maps the formats to the files. The browser will then download the first file in the object that it knows it can support. You can also provide Texture Atlas JSON data, too, so you can use compressed texture atlases. Currently, Texture Packer is the best tool for creating these.
TextureSoure.compressionAlgorithm is now populated with the compression format used by the texture.Types.Textures.CompressedTextureData is the new compressed texture configuration object type.TextureManager.addCompressedTexture is a new method that will add a compressed texture, and optionally atlas data into the Texture Manager and return a Texture object than any Sprite can use.Textures.Parsers.KTXParser is a new parser for the KTX compression container format.Textures.Parsers.PVRParser is a new parser for the PVR compression container format.WebGLRenderer.compression property now holds a more in-depth object containing supported compression formats.WebGLRenderer.createTextureFromSource method now accepts the CompressedTextureData data objects and creates WebGL textures from them.WebGLRenderer.getCompressedTextures is a new method that will populate the WebGLRenderer.compression object and return its value. This is called automatically when the renderer boots.WebGLRenderer.getCompressedTextureName is a new method that will return a compressed texture format GLenum based on the given format.ScaleManager.getViewPort is a new method that will return a Rectangle geometry object that matches the visible area of the screen (thanks @rexrainbow)GameObjects.Layer.addToDisplayList and removeFromDisplayList are new methods that allows for you to now add a Layer as a child of another Layer. Fix #5799 (thanks @samme)GameObjects.Video.loadURL has a new optional 4th parameter crossOrigin. This allows you to specify a cross origin request type when loading the video cross-domain (thanks @rmartell)loader.imageLoadType: "HTMLImageElement" in your Game Configuration and the Phaser Loader will use an Image Tag to load all images, rather than XHR and a Blob object which is the default. This is a global setting, so all file types that use images, such as Atlas or Spritesheet, will be changed via this flag (thanks @hanzooo)Tileset.tileOffset (which is a Vector2). This property is set automatically when Tiled data is parsed and found to contain it. Fix #5633 (thanks @moJiXiang)Tilemap.createFromObjects method has been overhauled to support typed tiles from the Tiled Map Editor (https://doc.mapeditor.org/en/stable/manual/custom-properties/#typed-tiles). It will now also examine the Tileset to inherit properties based on the tile gid. It will also now attempt to use the same texture and frame as Tiled when creating the object (thanks @lackhand)Display.Masks.BitmapMask destroy method will now remove the context-lost event handler.hitArea parameter of the GameObjects.Zone.setDropZone method is now optional and if not given it will try to create a hit area based on the size of the Zone Game Object (thanks @rexrainbow)BitmapMask.scene is a new property that allows the Bitmap Mask to reference the Scene it was created in.DOMElement.preUpdate method has been removed. If you overrode this method, please now see preRender instead.DOMElement.preRender is a new method that will check parent visibility and improve its behavior, responding to the parent even if the Scene is paused or the element is inactive. Dom Elements are also no longer added to the Scene Update List. Fix #5816 (thanks @prakol16 @samme)Particle.fire will now throw an error if the particle has no texture frame. This prevents an uncaught error later when the particle fails to render. Fix #5838 (thanks @samme @monteiz)ParticleEmitterManager.setEmitterFrames will now print out console warnings if an invalid texture frame is given, or if no texture frames were set. Fix #5838 (thanks @samme @monteiz)SceneManager.stop will now ignore the call if the Scene has already been shut down, avoiding potential problems with duplicate event handles. Fix #5826 (thanks @samme)Animation.createFromAseprite would calculate an incorrect frame duration if the frames didn't all have the same speed.capacitor:// has been added to the protocol check to prevent malformed double-urls in some environments (thanks @consolenaut)Config.domBehindCanvas property as it's never used internally. Fix #5749 (thanks @iamallenchang)dispatchTweenEvent would overwrite one of the callback's parameters. This fix ensures that Tween.setCallback now works consistently. Fix #5753 (thanks @andrei-pmbcn @samme)Phaser.WEBGL will now fail with an error. Previously, it would fall back to Canvas. Now it will not fall back to Canvas. If you require that feature, use the AUTO render type. Fix #5583 (thanks @samme)Tilemap.createFromObjects method will now correctly place both tiles and other objects. Previously, it made the assumption that the origin was 0x1 for all objects, but Tiled only uses this for tiles and uses 0x0 for its other objects. It now handles both. Fix #5789 (thanks @samme)CanvasRenderer.snapshotCanvas method used an incorrect reference to the canvas, causing the operation to fail. It will now snapshot a canvas correctly. Fix #5792 #5448 (thanks @rollinsafary-inomma @samme @akeboshi1)Tilemap.tileToWorldY method incorrectly had the parameter tileX. It will worked, but didn't make sense. It is now tileY (thanks @mayacoda)Tilemap.convertTilemapLayer method would fail for isometric tilemaps by not setting the physic body alignment properly. It will now call getBounds correctly, allowing for use on non-orthagonal maps. Fix #5764 (thanks @mayacoda)PluginManager.installScenePlugin method will now check if the plugin is missing from the local keys array and add it back in, if it is (thanks @xiamidaxia)GameObject.Shapes.Rectangle.setSize it will now correctly update the Rectangle object's display origin and default hitArea (thanks @rexrainbow)ParseTileLayers function has been updated so that it no longer breaks when using a Tiled infinite map with empty chunks (thanks @jonnytest1)PutTileAt function will now set the Tile dimensions from the source Tileset, fixing size related issues when placing tiles manually. Fix #5644 (thanks @moJiXiang @stuffisthings)Tileset.tileOffset property fixes an issue with drawing isometric tiles when an offset had been defined in the map data (thanks @moJiXiang)Geom.Intersects.GetLineToLine function that would fail with colinear lines (thanks @Skel0t)CameraManager.destroy function will now remove the Scale Manager RESIZE event listener created as part of boot, where-as before it didn't clean it up, leading to gc issues. Fix #5791 (thanks @liuhongxuan23)roundPixels set to true in the game or camera config, Sprites will no longer render at sub-pixel positions under CANVAS. Fix #5774 (thanks @samme)PRE_RENDER and POST_RENDER events under the Canvas Renderer. Fix #5729 (thanks @ddanushkin)highp float precision by default, instead of mediump. This fixes issues with strange blue 'spots' appearing under WebGL on some Android devices. Fix #5751 #5659 #5655 (thanks @actionmoon @DuncanPriebe @ddanushkin)Tilemaps.Tile.getBounds method would take a camera parameter but then not pass it to the methods called internally, thus ignoring it. It now factors the camera into the returned Rectangle.Tilemap.createFromObjects has had the rendering of Tiled object layers on isometric maps fixed. Objects contained in object layers generated by Tiled use orthogonal positioning even when the map is isometric and this update accounts for that (thanks @lfarroco)My thanks to the following for helping with the Phaser 3 Examples, Docs, and TypeScript definitions, either by reporting errors, fixing them, or helping author the docs:
@necrokot Golen @Pythux @samme @danfoster @eltociear @sylvainpolletvillard @hanzooo @etherealmachine @DeweyHur
release notes
Published 10/6/2021
Pre-ReleasePre-releasePhaser 3.60 contains support for Compressed Textures. It can parse both KTX and PVR containers and within those has support for the following formats: ETC, ETC1, ATC, ASTC, BPTC, RGTC, PVRTC, S3TC and S3TCSRB. Compressed Textures differ from normal textures in that their structure is optimized for fast GPU data reads and lower memory consumption. Popular tools that can create compressed textures include PVRTexTool, ASTC Encoder and Texture Packer.
Compressed Textures are loaded using the new this.load.texture method, which takes a texture configuration object that maps the formats to the files. The browser will then download the first file in the object that it knows it can support. You can also provide Texture Atlas JSON data, too, so you can use compressed texture atlases. Currently, Texture Packer is the best tool for creating these.
TextureSoure.compressionAlgorithm is now populated with the compression format used by the texture.Types.Textures.CompressedTextureData is the new compressed texture configuration object type.TextureManager.addCompressedTexture is a new method that will add a compressed texture, and optionally atlas data into the Texture Manager and return a Texture object than any Sprite can use.Textures.Parsers.KTXParser is a new parser for the KTX compression container format.Textures.Parsers.PVRParser is a new parser for the PVR compression container format.WebGLRenderer.compression property now holds a more in-depth object containing supported compression formats.WebGLRenderer.createTextureFromSource method now accepts the CompressedTextureData data objects and creates WebGL textures from them.WebGLRenderer.getCompressedTextures is a new method that will populate the WebGLRenderer.compression object and return its value. This is called automatically when the renderer boots.WebGLRenderer.getCompressedTextureName is a new method that will return a compressed texture format GLenum based on the given format.ScaleManager.getViewPort is a new method that will return a Rectangle geometry object that matches the visible area of the screen (thanks @rexrainbow)GameObjects.Layer.addToDisplayList and removeFromDisplayList are new methods that allows for you to now add a Layer as a child of another Layer. Fix #5799 (thanks @samme)GameObjects.Video.loadURL has a new optional 4th parameter crossOrigin. This allows you to specify a cross origin request type when loading the video cross-domain (thanks @rmartell)loader.imageLoadType: "HTMLImageElement" in your Game Configuration and the Phaser Loader will use an Image Tag to load all images, rather than XHR and a Blob object which is the default. This is a global setting, so all file types that use images, such as Atlas or Spritesheet, will be changed via this flag (thanks @hanzooo)Tileset.tileOffset (which is a Vector2). This property is set automatically when Tiled data is parsed and found to contain it. Fix #5633 (thanks @moJiXiang)Tilemap.createFromObjects method has been overhauled to support typed tiles from the Tiled Map Editor (https://doc.mapeditor.org/en/stable/manual/custom-properties/#typed-tiles). It will now also examine the Tileset to inherit properties based on the tile gid. It will also now attempt to use the same texture and frame as Tiled when creating the object (thanks @lackhand)Display.Masks.BitmapMask destroy method will now remove the context-lost event handler.hitArea parameter of the GameObjects.Zone.setDropZone method is now optional and if not given it will try to create a hit area based on the size of the Zone Game Object (thanks @rexrainbow)BitmapMask.scene is a new property that allows the Bitmap Mask to reference the Scene it was created in.DOMElement.preUpdate method has been removed. If you overrode this method, please now see preRender instead.DOMElement.preRender is a new method that will check parent visibility and improve its behavior, responding to the parent even if the Scene is paused or the element is inactive. Dom Elements are also no longer added to the Scene Update List. Fix #5816 (thanks @prakol16 @samme)Particle.fire will now throw an error if the particle has no texture frame. This prevents an uncaught error later when the particle fails to render. Fix #5838 (thanks @samme @monteiz)ParticleEmitterManager.setEmitterFrames will now print out console warnings if an invalid texture frame is given, or if no texture frames were set. Fix #5838 (thanks @samme @monteiz)SceneManager.stop will now ignore the call if the Scene has already been shut down, avoiding potential problems with duplicate event handles. Fix #5826 (thanks @samme)Animation.createFromAseprite would calculate an incorrect frame duration if the frames didn't all have the same speed.capacitor:// has been added to the protocol check to prevent malformed double-urls in some environments (thanks @consolenaut)Config.domBehindCanvas property as it's never used internally. Fix #5749 (thanks @iamallenchang)dispatchTweenEvent would overwrite one of the callback's parameters. This fix ensures that Tween.setCallback now works consistently. Fix #5753 (thanks @andrei-pmbcn @samme)Phaser.WEBGL will now fail with an error. Previously, it would fall back to Canvas. Now it will not fall back to Canvas. If you require that feature, use the AUTO render type. Fix #5583 (thanks @samme)Tilemap.createFromObjects method will now correctly place both tiles and other objects. Previously, it made the assumption that the origin was 0x1 for all objects, but Tiled only uses this for tiles and uses 0x0 for its other objects. It now handles both. Fix #5789 (thanks @samme)CanvasRenderer.snapshotCanvas method used an incorrect reference to the canvas, causing the operation to fail. It will now snapshot a canvas correctly. Fix #5792 #5448 (thanks @rollinsafary-inomma @samme @akeboshi1)Tilemap.tileToWorldY method incorrectly had the parameter tileX. It will worked, but didn't make sense. It is now tileY (thanks @mayacoda)Tilemap.convertTilemapLayer method would fail for isometric tilemaps by not setting the physic body alignment properly. It will now call getBounds correctly, allowing for use on non-orthagonal maps. Fix #5764 (thanks @mayacoda)PluginManager.installScenePlugin method will now check if the plugin is missing from the local keys array and add it back in, if it is (thanks @xiamidaxia)GameObject.Shapes.Rectangle.setSize it will now correctly update the Rectangle object's display origin and default hitArea (thanks @rexrainbow)ParseTileLayers function has been updated so that it no longer breaks when using a Tiled infinite map with empty chunks (thanks @jonnytest1)PutTileAt function will now set the Tile dimensions from the source Tileset, fixing size related issues when placing tiles manually. Fix #5644 (thanks @moJiXiang @stuffisthings)Tileset.tileOffset property fixes an issue with drawing isometric tiles when an offset had been defined in the map data (thanks @moJiXiang)Geom.Intersects.GetLineToLine function that would fail with colinear lines (thanks @Skel0t)CameraManager.destroy function will now remove the Scale Manager RESIZE event listener created as part of boot, where-as before it didn't clean it up, leading to gc issues. Fix #5791 (thanks @liuhongxuan23)roundPixels set to true in the game or camera config, Sprites will no longer render at sub-pixel positions under CANVAS. Fix #5774 (thanks @samme)PRE_RENDER and POST_RENDER events under the Canvas Renderer. Fix #5729 (thanks @ddanushkin)highp float precision by default, instead of mediump. This fixes issues with strange blue 'spots' appearing under WebGL on some Android devices. Fix #5751 #5659 #5655 (thanks @actionmoon @DuncanPriebe @ddanushkin)Tilemaps.Tile.getBounds method would take a camera parameter but then not pass it to the methods called internally, thus ignoring it. It now factors the camera into the returned Rectangle.Tilemap.createFromObjects has had the rendering of Tiled object layers on isometric maps fixed. Objects contained in object layers generated by Tiled use orthogonal positioning even when the map is isometric and this update accounts for that (thanks @lfarroco)My thanks to the following for helping with the Phaser 3 Examples, Docs, and TypeScript definitions, either by reporting errors, fixing them, or helping author the docs:
@necrokot Golen @Pythux @samme @danfoster @eltociear @sylvainpolletvillard @hanzooo @etherealmachine @DeweyHur
Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.