Comments (12)
good idea! on the todo list..
from pixijs.
Just had a tinker on the dev-filters, the mask work great but it doesn't accept any multiple masks though, any plan to do this?
from pixijs.
good to hear! Do you mean masks within masks?
from pixijs.
oh! thanks for the quick reply! :)
right now i'm just trying to have a few masks on my stage (not within mask) so i basically i have 2 containers that hold 2 different objects
// some codes are omitted
var container1 = new PIXI.DisplayObjectContainer();
var img1 = PIXI.Sprite.fromImage("img1.jpg");
img1.anchor.x = 0.5;
img1.anchor.y = 0.5;
container.addChild(img1);
var container2 = new PIXI.DisplayObjectContainer();
var img2 = PIXI.Sprite.fromImage("img2.jpg");
img2.anchor.x = 0.5;
img2.anchor.y = 0.5;
container.addChild(img1);
container1.mask = mask1;
container2.mask = mask2;
(click the gif below, if you can't see the loop)
or perhaps i've missed something?
and yes masks within masks would be superb!
from pixijs.
hehe, super trippy! 👍
I will look in to that for you :)
from pixijs.
thank you sir! ;)
from pixijs.
No worries! Just having a little play around and multiple masking seems to be working ok for me?
Would ya mind sharing your code so I can see what the prob might be?
Thanks!
from pixijs.
yes, of course! :)
here it is https://dl.dropboxusercontent.com/u/604317/example14.zip
i used most of the codes from example14, didnt change that much afterwards
thank you again!
from pixijs.
Hello! Sorry about the delay on this one! Do ya still have the src code of it behaving weirdly? Gonna take a look and see whats going on. Thanks!
from pixijs.
i've just pulled the dev branch, there are a few new files inside example 14.
and when i tried my code it worked now! thank you! 👍
here's my code (just in case somebody wants to use it)
i didnt do any thing fancy, just reassigned a new mask to bg
// Create new mask thingy
var anotherthingy = new PIXI.Graphics();
stage.addChild(anotherthingy);
anotherthingy.position.x = 40;
anotherthingy.position.y = 40;
bg.mask = anotherthingy;
// inside the animate function
function animate() {
// copied and paste this, from your code
anotherthingy.clear();
anotherthingy.lineStyle(5, 0x16f1ff, 1);
anotherthingy.beginFill(0x8bc5ff, 0.4);
anotherthingy.moveTo(-120 + Math.sin(count) * 20, -100 + Math.cos(count)* 20);
anotherthingy.lineTo(120 + Math.cos(count) * 20, -100 + Math.sin(count)* 20);
anotherthingy.lineTo(120 + Math.sin(count) * 20, 100 + Math.cos(count)* 20);
anotherthingy.lineTo(-120 + Math.cos(count)* 20, 100 + Math.sin(count)* 20);
anotherthingy.lineTo(-120 + Math.sin(count) * 20, -100 + Math.cos(count)* 20);
anotherthingy.rotation = count * 0.1;
}
from pixijs.
Wonderful news :) Thanks for sharing your code too 👍
from pixijs.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from pixijs.
Related Issues (20)
- Bug: Graphics scaling and adding filters, display abnormal
- Bug:
- Bug: Unexpected behaviour of alpha on Graphics HOT 1
- Bug: [v8 regression] cannot do many `moveTo`/`lineTo` HOT 13
- Bug: API Documentation URLs Leading to 403 Errors HOT 3
- Bug: BitmapText color
- Bug: app.renderer.extract.base64 doesn't apply tint HOT 1
- Feature Request: Allow GraphicsContext.poly to accept PointData[] HOT 1
- Bug: Assigning filters after initial assignment is busted without invalidating
- Bug [v8 migration]: utils.clearTextureCache() no longer exist HOT 2
- Bug: [v8 regression] Graphics Mask doesn't always update when clearing and redrawing HOT 2
- Feature Request: Support for bundle tree on AssetsManifest
- Virus detected when I try to download PixiJS HOT 2
- Bug: [v8] Missing information on Migration guide for v8 or in the Blog post of v8 HOT 3
- Bug: [v8] Rollup export build error after upgrade to v8 - working on v7 HOT 4
- Bug: WEBGL: INVALID_VALUE: shaderSource: string not ASCII (Older chrome version) HOT 6
- Bug: BaseRenderTexture no longer exists in v8 HOT 1
- Bug: Graphics with only strokes that don't have a closePath, but an event is fired where a closePath would have been
- Bug: BindGroup setResource called with null HOT 2
- Bug: Reloading an Animated Sprite breaks rendering HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pixijs.