Widget API: Texture:GetTexCoord

From AddOn Studio
Revision as of 20:57, 17 January 2015 by Bear (talk | contribs) (Created page with "{{widgetmethod}} Gets the texture coordinates of a texture. Texture coordinates change the region of, or distort, the drawn texture. local ULx,ULy,LLx,LLy,URx,URy,LRx,LRy =...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Widget API ← Texture < GetTexCoord

Gets the texture coordinates of a Texture.

local ULx,ULy,LLx,LLy,URx,URy,LRx,LRy = obj:SetTexCoord()

Parameters

Arguments

none

Returns

ULx,ULy,LLx,LLy,URx,URy,LRx,LRy - number
point coordinates; top left corner of the image is (0, 0); bottom right corner

Details

Texture coordinates change the region of, or distort, the drawn texture. Texture coordinates can be used to display a sub-region of a texture.

Examples

Displays the bottom-left quarter of the image.

texture:SetTexCoord(0, 0.5, 0.5, 1);

Notes

  • coordinates are normalized and the origin is the top-left corner
  • 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.

See also