Jump to content

retrieve dimensions after applying masking


andreas_d
 Share

Recommended Posts

Hi guys,

 

Can someone recommend a good method for getting the dimensions of assets AFTER a mask has been applied?  Imagine a scenario in which a mask  and a Sprite intersect.

var sprite = new PIXI.Sprite( texture );  // width == 200  height == 50sprite.mask = new PIXI.Graphics().beginFill().drawRect(0, 0, 50, 200).endFill() );

Is there a way to retrieve the dimensions after the mask has been applied?

 

(ex.  width==50 ; height == 50 ) instead of: width == 200 ;  height == 200

 

Thanks

Andreas

Link to comment
Share on other sites

Shamelessly bumping this to the top again.  Am i  getting this very wrong due to a lack of experience ? If you want to mask elements and then treat those elements as if their dimensions are the masked area, is there a built in way of doing this?  So far I've had to do a whole lot of strange workarounds to get past this.  

 

Thanks

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...