Reputation: 615
I have an image already preloaded in Phaser.State:
game.load.image(name, url);
I would like to use it in two different scenarios:
First scenario is simple, but I can't find solution for second one. Phaser.Sprite.crop
applies only Phaser.Rectangle
and I can't put Phaser.Polygon
into this method. How can I solve this problem?
PS: Of course, I don't want to download second (cropped) version of the image.
Upvotes: 1
Views: 1290
Reputation: 38
Try to use alpha mask like here
But in this case you need upload an image of mask (your polygon).
Upvotes: 2