3.1 KiB
3.1 KiB
Phaser 3.60.0 Change Log
Return to the Change Log index.
Bitmap and Geometry Mask Breaking Changes
There are breaking changes from previous versions of Phaser.
- Previously, every unique Bitmap Mask would create two full renderer sized framebuffers and two corresponding WebGL textures for them. The Bitmap Mask would listen for resize events from the renderer and then re-create these framebuffers accordingly. However, as the Bitmap Mask pipeline would clear and re-render these framebuffers every single frame it made no sense to have them use such large amounts of GPU memory. As of 3.60, the WebGL Renderer creates and manages two RenderTargets which all Bitmap Masks now use. If you previously used multiple Bitmap Masks in your game this change will dramatically reduce memory consumption at no performance cost.
- Due to the change in ownership of the framebuffers, the following properties have been removed from the BitmapMask class:
renderer,maskTexture,mainTexture,dirty,mainFramebufferandmaskFramebuffer. The following methods have also been removed:createMaskandclearMask.
Bitmap and Geometry Mask New Features
- The Bitmap Mask constructor is now capable of creating an Image Game Object from the new optional arguments:
x, y, texture, frameif no masked object is provided. - The Bitmap Mask now registers itself with the Game Object Factory. This means you can do
this.add.bitmapMask()from within a Scene, for easier creation.
Bitmap and Geometry Mask Updates
- The
WebGLRendererhas 2 new properties:maskSourceandmaskTarget. These are the new global mask framebuffers. WebGLRenderer.beginBitmapMaskis a new method that starts the process of using the mask target framebuffer for drawing. This is called by theBitmapMaskPipeline.WebGLRenderer.drawBitmapMaskis a new method that completes the process of rendering using the mask target framebuffer. This is called by theBitmapMaskPipeline.- The
BitmapMaskPipelinenow hands over most control of the framebuffers to the WebGLRenderer. - The
GameObjects.Components.Mask.createBitmapMaskmethod can now accept thex,y,textureandframeparameters new to the BitmapMask constructor. - You can now use any
ShapeGame Object as a Geometry Mask. Fix #5900 (thanks @rexrainbow)
Bitmap and Geometry Mask Bug Fixes
- Previously, calling
createBitmapMaskon a Shape Game Object would fail unless you passed the shape to the method. Now, it will correctly create a mask from the Shape without needing to pass it. Fix #5976 (thanks @samme) - The
BitmapMaskshader has been recoded so it now works correctly if you mask a Game Object that has alpha set on it, or in its texture. Previously it would alpha the Game Object against black (thanks stever1388)
Return to the Change Log index.
📖 Read the Phaser 3 API Docs 💻 Browse 2000+ Code Examples 🤝 Join the awesome Phaser Discord
