Jump to content

Crop Texture with PIXI.js (Polygonal Crop)


TheTrope
 Share

Recommended Posts

Hi,

 

I need to crop a texture with pixi.js.

 

With canvas, we can draw a polygon and clip it, to take the pixels inside the polygon.

But we don't find the way to do it with pixi.js

 

We tried :

- var texture2 = new PIXI.Texture(texture, new PIXI.Polygon(...........)); But it only accept PIXI.Rectangle();

- Masking : We don't find the way to use the masked texture on another sprite.

 

We try to crop a texture, and transform the texture (skew), the problem is that with a mask, the mask still de same and don't transform too.

 

 

Is there an easy way to crop and texture, and then get the croped texture to use it on another sprite?

 

 

Thank you

 

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