Skip to content

Commit 0bdf1cc

Browse files
committed
Allow geometry masks to work within bitmap masks
1 parent f69cec7 commit 0bdf1cc

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Notes:
148148
* Declared `Audio.dataset`, which fixes Internet Explorer 10 crashing when trying to access the dataset property of the object (thanks @SirLink)
149149
* Previously, setting a mask on a Particle Emitter wouldn't work (it had to be set on the Emitter Manager instance), even though the mask methods and properties existed. You can now set a geometry or bitmap mask directly on an emitter.
150150
* The Particle Emitter Manager was missing the Mask component, even though it fully supported masking. The Mask component has now been added. You can now mask the manager, which impacts all emitters you create through it, or a specific emitter. Different emitters can have different masks, although they override the parent mask, if set.
151+
* You can now apply a Bitmap Mask to a Camera or Container and a Geometry Mask to a child and have it work correctly.
151152

152153
### Examples, Documentation and TypeScript
153154

src/display/mask/BitmapMask.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ var BitmapMask = new Class({
137137

138138
this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);
139139
this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);
140-
this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, false);
141-
this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, false);
140+
this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true);
141+
this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true);
142142

143143
renderer.onContextRestored(function (renderer)
144144
{
@@ -151,8 +151,8 @@ var BitmapMask = new Class({
151151

152152
this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);
153153
this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);
154-
this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, false);
155-
this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, false);
154+
this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true);
155+
this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true);
156156

157157
}, this);
158158
}

0 commit comments

Comments
 (0)