WoW:API Texture SetTexCoord: Difference between revisions
Jump to navigation
Jump to search
SetTexCoord -Documentation by tcxxs-
m (→Arguments: Fixed ranges) |
(→Parameters: Clarify 0-1) |
||
Line 12: | Line 12: | ||
=== Arguments === | === Arguments === | ||
:(left,right,top,bottom) | :(left,right,top,bottom) | ||
: Number - | : Number - '''0 -- 1''' - actually, not bounded, but 0-1 is the texture's actual area | ||
:(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy); | :(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy); | ||
: Number - | : Number - '''0 -- 1''' - actually, not bounded, but 0-1 is the texture's actual area | ||
== Note == | == Note == |
Revision as of 13:35, 12 August 2006
← Widget API ← Texture < SetTexCoord
Limit 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);
Parameters
Arguments
- (left,right,top,bottom)
- Number - 0 -- 1 - actually, not bounded, but 0-1 is the texture's actual area
- (ULx,ULy,LLx,LLy,URx,URy,LRx,LRy);
- Number - 0 -- 1 - actually, not bounded, but 0-1 is the texture's actual area
Note
- The function cut a sub-region,use the new TopLeftPoint is (left,top),new BottomRight is (right,bottom),so you can use the function to rotate the texture or sub-region. The more complex 8-argument form allows for arbitrary affine transformations, see SetTexCoord Transformations for details.
Example
getglobal("MyAddOnTexture" .. id):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 bottom left corner.