WoW:API Texture SetTexture: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(→‎Arguments: Max Dimensions increased to 1024)
Line 2: Line 2:


==Arguments==
==Arguments==
:;filename
:;filename [,tile]
::'''filename''' (String) Name of the texture image.
::'''filename''' (String) - Name of the texture image.
:::Format: .blp or .tga, only power-of-two dimensions (16, 32, 64, 128, 256, 512, and 1024) with 256 colors (8 BPP (bits per pixel)) max.
:::Format: .blp or .tga, only power-of-two dimensions (16, 32, 64, 128, 256, 512, and 1024). May be 8-bit or 24-bit (no alpha channel) or 32-bit (with alpha channel), may be compressed.
::'''tile''' (Boolean) - Tile the image if the coordinates set using [[API Texture SetTexCoord|Texture:SetTexCoord]] exceed the 0.0-1.0 range.
:::Note: The texture has to be cleared or set to solid colour, or anyway changed away from the current file, before tiling can be changed. Hence,
texture:SetTexture("image.tga",true)
texture:SetTexture("image.tga",false)
:::will fail.
 
::Sets the texture for the Texture object.
::Sets the texture for the Texture object.
:;red, green, blue, alpha
:;red, green, blue, alpha
Line 11: Line 17:
::'''blue''' (Number, 0.0 to 1.0) Blue component
::'''blue''' (Number, 0.0 to 1.0) Blue component
::'''alpha''' (Number, 0.0 to 1.0) Opacity (transparency)
::'''alpha''' (Number, 0.0 to 1.0) Opacity (transparency)


==Description==
==Description==

Revision as of 14:19, 27 August 2009

Widget API ← Texture < SetTexture

Arguments

filename [,tile]
filename (String) - Name of the texture image.
Format: .blp or .tga, only power-of-two dimensions (16, 32, 64, 128, 256, 512, and 1024). May be 8-bit or 24-bit (no alpha channel) or 32-bit (with alpha channel), may be compressed.
tile (Boolean) - Tile the image if the coordinates set using Texture:SetTexCoord exceed the 0.0-1.0 range.
Note: The texture has to be cleared or set to solid colour, or anyway changed away from the current file, before tiling can be changed. Hence,
texture:SetTexture("image.tga",true)
texture:SetTexture("image.tga",false)
will fail.
Sets the texture for the Texture object.
red, green, blue, alpha
red (Number, 0.0 to 1.0) Red component
green (Number, 0.0 to 1.0) Green component
blue (Number, 0.0 to 1.0) Blue component
alpha (Number, 0.0 to 1.0) Opacity (transparency)

Description

Can be used to either set the texture file, or to change the RGB fill of a texture. Pass it one string to change the texture file, or pass it three numbers to set the RGB. The only place I've seen this used to change the color is within the inline script of a ColorSelect object.

If no Alpha value is specified for the color, it is defaulted to be "1.0".