- Joined
- Jun 30, 2021
- Messages
- 29
Lua:
---@param frame framehandle
---@param primaryProp integer
---@param flags integer
---@return nothing
function BlzFrameSetSpriteAnimate(frame, primaryProp, flags) end -- (native)
Controls a sprite’s animation queue, but not in the most intuitive way.
frame
Only works on two frame types:SPRITE
and STATUSBAR
.primaryProp
You pass in a number, but it’s not an animationID
from the model.Instead, it maps to a token from this list (total 26 tokens). Not sure how widely known this is, @Tasyen's The Big UI-Frame Tutorial only mentions the first 5 tokens.
primaryProp | Animation name substring |
0 | Birth |
1 | Death |
2 | Stand |
3 | Morph |
4 | Alternate |
5 | Found |
6 | MainMenu |
7 | SinglePlayer |
8 | SinglePlayerSkirmish |
9 | Campaign |
10 | MultiPlayer |
11 | MultiPlayerPreGameChat |
12 | ViewReplay |
13 | BattleNetChatRoom |
14 | BattleNetCustom |
15 | BattleNetCustomCreate |
16 | BattleNetWelcome |
17 | BattleNetAMM |
18 | BattleNetAdvancedOptions |
19 | BattleNetChannel |
20 | BattleNetProfile |
21 | BattleNetTeamChat |
22 | BattleNetUserList |
23 | Options |
24 | RealmSelection |
25 | MainCancelPanel |
Lua:
local primaryPropsDict = {
[0] = "birth",
[1] = "death",
[2] = "stand",
[3] = "morph",
[4] = "alternate",
[5] = "found",
[6] = "mainmenu",
[7] = "singleplayer",
[8] = "singleplayerskirmish",
[9] = "campaign",
[10] = "multiplayer",
[11] = "multiplayerpregamechat",
[12] = "viewreplay",
[13] = "battlenetchatroom",
[14] = "battlenetcustom",
[15] = "battlenetcustomcreate",
[16] = "battlenetwelcome",
[17] = "battlenetamm",
[18] = "battlenetadvancedoptions",
[19] = "battlenetchannel",
[20] = "battlenetprofile",
[21] = "battlenetteamchat",
[22] = "battlenetuserlist",
[23] = "options",
[24] = "realmselection",
[25] = "maincancelpanel",
}
Lua:
ANIM_SPRITE_PROP_BIRTH = 0
ANIM_SPRITE_PROP_DEATH = 1
ANIM_SPRITE_PROP_STAND = 2
ANIM_SPRITE_PROP_MORPH = 3
ANIM_SPRITE_PROP_ALTERNATE = 4
ANIM_SPRITE_PROP_FOUND = 5
ANIM_SPRITE_PROP_MAINMENU = 6
ANIM_SPRITE_PROP_SINGLEPLAYER = 7
ANIM_SPRITE_PROP_SINGLEPLAYERSKIRMISH = 8
ANIM_SPRITE_PROP_CAMPAIGN = 9
ANIM_SPRITE_PROP_MULTIPLAYER = 10
ANIM_SPRITE_PROP_MULTIPLAYERPREGAMECHAT = 11
ANIM_SPRITE_PROP_VIEWREPLAY = 12
ANIM_SPRITE_PROP_BATTLENETCHATROOM = 13
ANIM_SPRITE_PROP_BATTLENETCUSTOM = 14
ANIM_SPRITE_PROP_BATTLENETCUSTOMCREATE = 15
ANIM_SPRITE_PROP_BATTLENETWELCOME = 16
ANIM_SPRITE_PROP_BATTLENETAMM = 17
ANIM_SPRITE_PROP_BATTLENETADVANCEDOPTIONS = 18
ANIM_SPRITE_PROP_BATTLENETCHANNEL = 19
ANIM_SPRITE_PROP_BATTLENETPROFILE = 20
ANIM_SPRITE_PROP_BATTLENETTEAMCHAT = 21
ANIM_SPRITE_PROP_BATTLENETUSERLIST = 22
ANIM_SPRITE_PROP_OPTIONS = 23
ANIM_SPRITE_PROP_REALMSELECTION = 24
ANIM_SPRITE_PROP_MAINCANCELPANEL = 25
flags
This is a bitmask. You can combine flags using addition(e.g. use queue + pick first matching =
2 + 8 = 10
).Not fully explored — let me know if you’ve got more info.
Flag Value | Description |
0 | Clears the queue and immediately sets the new animation |
1 | Adds to queue only if following a NonLooping animation |
2 | Adds animation to the end of the queue |
3 | Seems like same as 2; if none of 1–3 is set, queue gets wiped |
4 | Unknown (seems to do nothing) |
8 | Selects the first matching animation from the model (the one with the lowest internal ID ).By default, if multiple animations share the same token (e.g. Stand - 1, Stand - 2, etc.), one of them is picked at random. |
16 | Selects the least rare animation (lowest Rarity ) |
32 | Selects the rarest animation (highest Rarity ) |
48 | Same as 16 |
4096 | Unknown |
12224 | Unknown |
16384 | Unknown |
Usage examples
Lua:
local spr
-- Set a Stand animation
BlzFrameSetSpriteAnimate(spr, 2, 0)
-- Set the rarest version of Stand
BlzFrameSetSpriteAnimate(spr, 2, 32)
-- Queue up all 26 animations
-- Note: The queue runs even while the game is paused
for i = 0, 25 do
BlzFrameSetSpriteAnimate(spr, i, 2)
end
-- Queue only the rarest versions
for i = 0, 25 do
BlzFrameSetSpriteAnimate(spr, i, 34) -- 2 + 32
end
Last edited: