Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
(Created page with "{{widgetmethod}} Sets whether the widget should adjust horizontal texture coordinates based on texture and widget dimensions. Texture:SetHorizTile(horizTile) == Arguments ==...")
 
No edit summary
(One intermediate revision by the same user not shown)
Line 4: Line 4:
   
 
== Arguments ==
 
== Arguments ==
; horizTile : Boolean - If true, texture coordinates will be adjusted such that each source pixel takes up one unit square within the texture. This crops (if the widget's width is smaller than the pixel width of its texture) or extends the texture as specified by its horizontal wrapping mode (if the widget's width is larger than the pixel width of its texture).
+
; horizTile : Boolean - If true, texture coordinates will be adjusted such that each texture pixel takes up one horizontal unit within the widget.
   
 
== Example ==
 
== Example ==
Line 14: Line 14:
   
 
== Details ==
 
== Details ==
  +
* If the widget's width is smaller than the pixel width of the texture it displays, the texture will be cropped. The top left corner of the texture remains anchored to the top left corner of the widget.
  +
* If the widget's width is greater than the pixel width of the texture it displays, the widget's horizontal wrapping mode will determine the content of the pixels to the right of the original texture. To ''repeat'' (i.e., tile) the texture, the "REPEAT" horizontal wrapping mode should be specified when assigning the texture.
 
* The tiling mechanism adjusts texture coordinates at an arbitrary point during rendering, not necessarily as part of the {{api|t=w|Texture:SetTexture}} or Texture:SetHorizTile call. This overwrites the existing texture coordinates, and may occur more than once.
 
* The tiling mechanism adjusts texture coordinates at an arbitrary point during rendering, not necessarily as part of the {{api|t=w|Texture:SetTexture}} or Texture:SetHorizTile call. This overwrites the existing texture coordinates, and may occur more than once.
  +
* This function does not behave correctly for most default icons (textures in Interface/ICONS).
* To ''repeat'' (i.e., tile) the texture, the "REPEAT" horizontal wrapping mode should be specified when assigning the texture.
 
  +
* Some textures, such as most default icons in INTERFACE/ICONS, cannot be tiled in this manner.
 
  +
== See also ==
  +
* {{api|t=w|Texture:GetHorizTile}}
  +
* {{api|t=w|Texture:SetVertTile}}

Revision as of 23:10, 9 July 2018

Sets whether the widget should adjust horizontal texture coordinates based on texture and widget dimensions.

Texture:SetHorizTile(horizTile)

Arguments

horizTile
Boolean - If true, texture coordinates will be adjusted such that each texture pixel takes up one horizontal unit within the widget.

Example

local t = UIParent:CreateTexture()
t:SetSize(128, 128)
t:SetPoint("CENTER")
t:SetHorizTile(true)
t:SetTexture("Interface/ContainerFrame/UI-Icon-QuestBang", "MIRROR", "MIRROR")

Details

  • If the widget's width is smaller than the pixel width of the texture it displays, the texture will be cropped. The top left corner of the texture remains anchored to the top left corner of the widget.
  • If the widget's width is greater than the pixel width of the texture it displays, the widget's horizontal wrapping mode will determine the content of the pixels to the right of the original texture. To repeat (i.e., tile) the texture, the "REPEAT" horizontal wrapping mode should be specified when assigning the texture.
  • The tiling mechanism adjusts texture coordinates at an arbitrary point during rendering, not necessarily as part of the Texture:SetTexture or Texture:SetHorizTile call. This overwrites the existing texture coordinates, and may occur more than once.
  • This function does not behave correctly for most default icons (textures in Interface/ICONS).

See also