Applies a counter-clockwise rotation to the texture.
tex:SetRotation(radians[, cx, cy])
- Number - Rotation angle in radians. Positive values rotate the texture counter-clockwise.
- Number - Horizontal coordinate of the rotation "center" point, defaults to 0.5.
- Number - Vertical coordinate of the rotation "center" point, defaults to 0.5.
- The coordinates are in the image coordinate space: (0,0) is the top left corner of the image, (1,1) is the bottom right corner.
- This function doesn't quite rotate around the (cx, cy) point: for instance, asking for a zero-radian rotation around (-1, 0) makes the image vanish. The behavior is equivalent to performing the following sequence of affine transformations:
- Translate the image by (-cx, -cy)
- Scale the image by
- Rotate the image by
radiansaround the origin.
- Translate the image by (0.5, 0.5)
- The scaling applied by this function ensures that a square image rotated by 45 degrees around its center fits within the Texture widget's bounding box. If you're rotating circular textures, you may wish to increase the texture widget's dimensions by a factor of
2^0.5to keep the original image size.