Thread Tools Display Modes
02-08-11, 09:20 PM   #1
imperialskull
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 3
Animated textures in WoW

I have always been a lover of addons, they bring a great deal of flexability and power to my gaming experience, but that said they don't always look as appealing as I would like. For instance nUI, my bread and butter addon (seriously I love it) has only one downside; I'm, not really a fan of a spartan black interface. So far this has not hindered me at all from simply making my own textures and UI panels which when I finish polishing them up I will certainly upload. I know that textures have to be a power of 2 and that WoW only picks up .Tga's and .Blp files (and .png -> .Blp), or it will A: throw an error flag and/or cause a client crash, or B: upload the bane of UI artists everwhere, the dreaded rainbow mishmash texture. I will just assume that WoW will not load a .gif or other animated file, but I do know that other addons have used Lua to make textures rotate. The question of course is can you create an animated frame in WoW using lua or by other means? I'm currently working on a skin that would have animated torches or the like and this is the only thing holding me back. Any advice that anyone has would be greatly appreciated, and who knows maybe with your help we can create something unique and amazing.
  Reply With Quote
02-08-11, 10:20 PM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
I think it was something involving API SetTexCoord, but not sure

that's 1 dang long sentence u got there ..

Edit:
this maybe?

Last edited by Ketho : 02-08-11 at 10:35 PM.
  Reply With Quote
02-09-11, 12:30 AM   #3
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
You can do stuff like fading, rotation, scaling and moving quite easily, but to do a burning torch? Not possible afaik.
__________________
Oh, the simulated horror!
  Reply With Quote
02-09-11, 12:32 AM   #4
voodoodad
Large, Friendly Letters!
 
voodoodad's Avatar
Join Date: Oct 2008
Posts: 1,632
In addition to the links provided by Ketho, you may want to study the lua files of Super Villain UI 2. He uses a literal ton of frame animations in his ui. It also happens to be one of the most original ui designs going in my opinion.
__________________

~ no need to make the message completely obnoxious - Cairenn
  Reply With Quote
02-09-11, 01:15 AM   #5
imperialskull
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Nov 2010
Posts: 3
Thanks to all of you for your fast responses. Thanks to you I can now delve further into my project. Using the Lua from the sources you all recomended I should be able to piece together something stylish and functional for the community if anyone knows any further information I would still be happy to hear it. WoWinterface community, you rock.
  Reply With Quote
02-09-11, 01:36 AM   #6
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
zork/Roth has done a lot of investigating regarding animations, check out his two blog posts over at EJ, especially the first one which mentions existing in-game animations you could perhaps utilize. My comment earlier was in relation to adding custom animations, but if there's a suitable Blizzard one you could probably use that.

http://elitistjerks.com/blogs/zork/4...our_interface/
http://elitistjerks.com/blogs/zork/4...need_onupdate/
__________________
Oh, the simulated horror!
  Reply With Quote
02-09-11, 03:00 AM   #7
Saiket
A Chromatic Dragonspawn
 
Saiket's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 154
The animation system probably isn't the right tool for animating flames or frame-by-frame animation. There is a way to animate textures like GIFs though: AnimateTexCoords from the default UI. Since loading individual static textures one after another to animate is slow, AnimateTexCoords takes a single image containing a grid of all animation frames and cycles through them. The minimap's LFG eye icon uses this grid texture to animate:


You can see where the eye icon uses AnimateTexCoords in Minimap.lua.
  Reply With Quote
02-09-11, 03:01 AM   #8
hankthetank
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 64
You can use the animation widgets to move, rotate, scale or fade out / in UI elements. Simply create an animation group and define one or more of the aforementioned derived animation objects inside it.

Back in the days this was done by registering the OnUpdate event for a frame and calculate these transitions by yourself. Technically the animation system does exactly that.

As for animated textures like in an animated gif you need to change the texture inside such a OnUpdate event handler. Best practice here is to save all the frames in one big texture and make use of SetTexCoord accordingly.

A good example is LFG-Eye.blp used by the LFG minimap button:



Even more straightforward you can utilize the public function AnimateTexCoords() defined in UIParent.lua which takes over all the work for you.

I suggest you take a look at the MiniMapLFGFrame. I also suggest that you use these kinds of animations sparingly.
  Reply With Quote
02-09-11, 03:02 AM   #9
hankthetank
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 64
Lightbulb

god dammit you gotta be kidding me

Last edited by hankthetank : 02-09-11 at 03:13 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Graphics Help » Animated textures in WoW

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off