Takes a crop data object and, based on the rectangular region given, calculates the required UV coordinates in order to crop this Frame for WebGL and Canvas rendering.
This is called directly by the Game Object Texture Components setCrop
method.
Please use that method to crop a Game Object.
name | type | description |
---|---|---|
crop | object |
The crop data object. This is the |
x | number |
The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. |
y | number |
The y coordinate to start the crop from. Cannot be negative or exceed the Frame height. |
width | number |
The width of the crop rectangle. Cannot exceed the Frame width. |
height | number |
The height of the crop rectangle. Cannot exceed the Frame height. |
flipX | boolean |
Does the parent Game Object have flipX set? |
flipY | boolean |
Does the parent Game Object have flipY set? |
The updated crop data object.