GameTooltip:AddTexture()

From Wowpedia
Jump to: navigation, search

Adds a texture (icon) to the beginning of the last line added by AddLine(), AddDoubleLine(), etc.

GameTooltip:AddTexture(fileDataID/"filename" [, TooltipTextureInfo])

Arguments

fileDataID 
number- FileDataID
or filename 
string - Path to the file
TooltipTextureInfo 
structure (optional)
TooltipTextureInfo
Key Type Description
width number can be 0 to use actual texture width
height number can be 0 to use actual texture width
anchor number Enum.TooltipTextureAnchor
region number Enum.TooltipTextureRelativeRegion
verticalOffset number
margin table left, right, top, bottom; empty space around the texture, can be negative
texCoords table left, right, top, bottom
vertexColor table r, g, b, a

Defaults

These are the internal defaults. The table may be partially filled out and any unspecified settings will be used at their default values.

{
	width = 12,
	height = 12,
	anchor = Enum.TooltipTextureAnchor.LeftTop,
	region = Enum.TooltipTextureRelativeRegion.LeftLine,
	verticalOffset = 0,
	margin = { left = 8, right = 8, top = 0, bottom = 0 },
	texCoords = { left = 0, right = 1, top = 0, bottom = 1 },
	vertexColor = { r = 1, g = 1, b = 1, a = 1 },
}

Example

GameTooltip:AddTexture(134532, {width = 32, height = 32})

API GameTooltip AddTexture.png

Enums

Enum.TooltipTextureAnchor
Value Type Description
0
LeftTop
1
LeftCenter
2
LeftBottom
3
RightTop
4
RightCenter
5
RightBottom
6
All
Enum.TooltipTextureRelativeRegion
Value Type Description
0
LeftLine
1
RightLine GameTooltip:AddDoubleLine

Details

  • There is a limit of 10 textures per tooltip line (as seen in GameTooltipTemplate.xml). You can get around this limitation by using GameTooltip:AddLine("|T"..itemTexture..":0|t ")

Patch changes

Kaivax 2019-06-19. UI Changes in Rise of Azshara.