Jump to content

Sprite as a mask problem


LucaDB
 Share

Recommended Posts

Hi, this is my first post :)

I'm trying to use an image (png) as a container mask,

it seems to work well on macOS but on Windows 8.1/10 ( ie11, edge, firefox 53) mask has no effect.

Here is the simple code


var app = new PIXI.Application(window.innerWidth,window.innerHeight);
document.body.appendChild(app.view);

var baseContainer = new PIXI.Container();

app.stage.addChild(baseContainer);

var theMask = PIXI.Sprite.fromImage('mask.png');

var baseImg = new PIXI.Sprite.fromImage('base.jpg');

baseContainer.addChild(baseImg);
baseContainer.addChild(theMask);
baseContainer.mask = theMask;


I'm using PIXI 4.4.1

Any idea why this is not working?

Thank you

base.jpg

mask.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...