Pixi.js has a document that lists a number of performance tips. They are all great bits of advice, but I have trouble understanding and using one of them.
Axis-aligned Rectangle Masks are the fastest (as they use scissor rect)
I know what "axis-aligned rectangles" are, I just do not understand how to use them in Pixi.js.
I was thinking that I should use a PIXI.Rectangle
, but a mask of DisplayObject
is defined to be a PIXI.Graphics | PIXI.Sprite
.
Is there a hidden trick to this, or is this a regular PIXI.Graphics
mask with a non-rotated rectangle drawn onto it?