Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API TextureBase SetTexCoord

Last wiki revision 2023-08-16

Sets the coordinates for cropping or transforming the texture. TextureBase:SetTexCoord(left, right, top, bottom) TextureBase:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)

Coordinates of the four (transformed) image edges.

  • : - Left (or minX) edge of the scaled/cropped image, as a fraction of the image's width from the left.
  • : - Right (or maxX) edge of the scaled/cropped image, as a fraction of the image's width from the left.
  • : - Top (or minY) edge of the scaled/cropped image, as a fraction of the image's height from the top.
  • : - Bottom (or maxY) edge of the scaled/cropped image, as a fraction of the image's height from the top.

Coordinates of the four (transformed) image corners.

  • : - Upper left corner X position, as a fraction of the image's width from the left.
  • : - Upper left corner Y position, as a fraction of the image's height from the top.
  • : - Lower left corner X position, as a fraction of the image's width from the left.
  • : - Lower left corner Y position, as a fraction of the image's height from the top.
  • : - Upper right corner X position, as a fraction of the image's width from the left.
  • : - Upper right corner Y position, as a fraction of the image's height from the top.
  • : - Lower right corner X position, as a fraction of the image's width from the left.
  • : - Lower right corner Y position, as a fraction of the image's height from the top.
  • The four-coordinate version of this function is well-suited to cropping textures. The eight-coordinate version can perform affine transformations, i.e. scaling, translating, shearing and rotating the source image.
  • The coordinates used by this function are normalized and vertically reversed compared to traditional WoW frame rectangles: (0,0) is the top-left corner of the image; (1,1) is the bottom right corner.
  • You may supply coordinates outside the [0, 1] range; the behavior varies depending on the texture displayed by the texture widget, as well as whether tiling is enabled.
  • Interface\ICONS textures are loaded into composite textures by the client; you cannot tile them, and other icons may appear outside the [0,1] coordinate region.
  • When tiling is enabled, the image is repeated outside the [0,1] texture coordinates.
  • When tiling is disabled, the outermost pixels of the source image are repeated indefinitely outside the [0,1] texture coordinates.
  • does not clear the transformation. Call to display the original image if necessary.
  • Reference: SetTexCoord Transformations, Affine transformation

See also

Source

https://warcraft.wiki.gg/wiki/API_TextureBase_SetTexCoord · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.