WoW:API Texture SetTexCoord: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
<center>'''SetTexCoord''' ''-Documentation by [[user:fitz|fitz]]-''</center>
<center>'''SetTexCoord''' ''-Documentation by [[user:tcxxs|tcxxs]]-''</center>


Limit the region of a texture drawn by the Texture widget.
Limit the region of a texture drawn by the Texture widget.


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
  obj:SetTexCoord(minX, maxX, minY, maxY);
  obj:SetTexCoord(left,right,top,bottom);


== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
:(minX, maxX, minY, maxY)
:(left,right,top,bottom)
 
: Number - (range: 0-1)
:;minX : Number - Left-most coordinate of bounding box (range: 0-1)
:;maxX : Number - Right-most coordinate of bounding box (range: 0-1)
:;minY : Number - Bottom-most coordinate of bounding box (range: 0-1)
:;maxY : Number - Top-most coordinate of bounding box (range: 0-1)


== 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
== Example ==
== Example ==
  getglobal("MyAddOnTexture" .. id):SetTexCoord(0, 0.5, 0.5, 1);
  getglobal("MyAddOnTexture" .. id):SetTexCoord(0, 0.5, 0.5, 1);

Revision as of 04:10, 3 November 2005

SetTexCoord -Documentation by tcxxs-

Limit the region of a texture drawn by the Texture widget.

obj:SetTexCoord(left,right,top,bottom);

Parameters

Arguments

(left,right,top,bottom)
Number - (range: 0-1)

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

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.

Template:WoW API