WoW:API Texture SetTexCoord: Difference between revisions
Jump to navigation
Jump to search
(boilerplate) |
|||
| Line 17: | Line 17: | ||
== Example == | == Example == | ||
Displays the bottom- | Displays the bottom-left quarter of the image. | ||
texture:SetTexCoord(0, 0.5, 0.5, 1); | texture:SetTexCoord(0, 0.5, 0.5, 1); | ||
==Details== | ==Details== | ||
Use this function to select a sub-region of a texture for display in a Texture widget. Note that the coordinates are normalised, and that the origin is the ''top'' left corner. (Note: Tested in patch 2.0.6, and the origin is in fact in the top left, and not the bottom left as was previously stated) | Use this function to select a sub-region of a texture for display in a Texture widget. Note that the coordinates are normalised, and that the origin is the ''top'' left corner. (Note: Tested in patch 2.0.6, and the origin is in fact in the top left, and not the bottom left as was previously stated) | ||
Revision as of 10:05, 19 April 2011
← Widget API ← Texture < SetTexCoord
Limits the region of a texture drawn by the Texture widget.
obj:SetTexCoord(left,right,top,bottom); obj:SetTexCoord(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy);
Arguments
- (left,right,top,bottom)
- Number - side coordinates; top left corner of the image is (0, 0); bottom right corner is (1, 1).
- (ULx,ULy,LLx,LLy,URx,URy,LRx,LRy);
- Number - point coordinates; top left corner of the image is (0, 0); bottom right corner is (1, 1).
Notes
The function cuts a sub-region out of the texture to display ingame.
- Unless you want to do rotations, use the (left,right,top,bottom) notation.
- The more complex 8-argument form allows for arbitrary affine transformations, see SetTexCoord Transformations for details.
Example
Displays the bottom-left quarter of the image.
texture:SetTexCoord(0, 0.5, 0.5, 1);
Details
Use this function to select a sub-region of a texture for display in a Texture widget. Note that the coordinates are normalised, and that the origin is the top left corner. (Note: Tested in patch 2.0.6, and the origin is in fact in the top left, and not the bottom left as was previously stated)