ImageDrawable
Globals
DAT_LINEAR_ALPHA
integer
DAT_LINEAR_SCALE
integer
DAT_MOVE
integer
Aliases
DRAWABLE_ANIMATION_TYPE
DAT_LINEAR_ALPHA|DAT_LINEAR_SCALE|DAT_MOVE
-- objects/ImageDrawable
DRAWABLE_ANIMATION_TYPE:
| `DAT_LINEAR_ALPHA`
| `DAT_LINEAR_SCALE`
| `DAT_MOVE`
Classes
Class: ImageDrawable
Extends DrawableDDS
A
ImageDrawableis a drawable that displays a texture with optional animation. Supports frame-based animation, TGA or UCC textures, tiling, pixel snapping, and color checks.
Method: Animation
(method) ImageDrawable:Animation(anim: boolean, loop: boolean)
Enables or disables animation and looping for the texture of the
ImageDrawable. Must be used afterImageDrawable:SetAnimFrameInfoto render theImageDrawable.@param
anim—trueto enable animation,falseto disable. (default:false)@param
loop—trueto enable looping,falseto disable. (default:false)
Method: SetTgaTexture
(method) ImageDrawable:SetTgaTexture(filename: string)
-> success: boolean
Sets a TGA texture for the ImageDrawable.
@param
filename— The path to the TGA texture file.@return
success—trueif the texture was successfully loaded and set,falseotherwise.
Method: SetTiling
(method) ImageDrawable:SetTiling(tiling: boolean)
Enables or disables tiling for the ImageDrawable.
@param
tiling—trueto enable tiling,falseto disable. (default:false)
Method: SetUccTextureByUccId
(method) ImageDrawable:SetUccTextureByUccId(complexId: string, isBack: boolean)
Sets a UCC texture for the
ImageDrawableby UCC ID.@param
complexId— The UCC ID for the texture stored on the server.@param
isBack—truefor background,falsefor foreground.
Method: SetSnap
(method) ImageDrawable:SetSnap(snap: boolean)
Enables or disables pixel snapping for the ImageDrawable.
@param
snap—trueto enable snapping,falseto disable. (default:true)
Method: IsWhiteTexture
(method) ImageDrawable:IsWhiteTexture()
-> whiteTexture: boolean
Checks if the texture of the
ImageDrawableis white.@return
whiteTexture—trueif the texture is white,falseotherwise.
Method: SetAnimFrameInfo
(method) ImageDrawable:SetAnimFrameInfo(frameInfo: FrameInfo)
Sets the animation frame information for the texture of the
ImageDrawable. Once animation frame information has been setImageDrawable:Animationis required to render theImageDrawable.@param
frameInfo— The frame information for the animation.local imageDrawable = widget:CreateImageDrawable("ui/hud/timer.dds", "background") imageDrawable:SetAnimFrameInfo({ { x = 0, y = 0, w = 61, h = 61, time = 100 }, { x = 61, y = 0, w = 61, h = 61, time = 100 }, { x = 122, y = 0, w = 61, h = 61, time = 100 }, { x = 183, y = 0, w = 61, h = 61, time = 100 }, { x = 0, y = 61, w = 61, h = 61, time = 100 }, { x = 61, y = 61, w = 61, h = 61, time = 100 }, { x = 122, y = 61, w = 61, h = 61, time = 100 }, { x = 0, y = 0, w = 61, h = 61, time = 500 }, }) imageDrawable:Animation(true, true)See: FrameInfo
Method: IsGrayTexture
(method) ImageDrawable:IsGrayTexture()
-> grayTexture: boolean
Checks if the texture of the
ImageDrawableis gray.@return
grayTexture—trueif the texture is gray,falseotherwise.
Method: SetUccTextureInDoodad
(method) ImageDrawable:SetUccTextureInDoodad(doodadId: string, isBack: boolean)
Sets a UCC texture for the
ImageDrawablewithin a doodad.@param
doodadId— The doodad ID for the texture to be applied to.@param
isBack—truefor background,falsefor foreground.