Reply
Thread Tools Display Modes
Unread 01-23-14, 06:12 AM   #1
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
I need a cooldown texture

I'm looking for a cooldown texture that is 'comprised' of single images to manually animate a cooldown via SetTexCoodinates.

What I'm looking for is like this:

What I need is a square/cooldown style version.

I could build one by myself. But I don't know how, exept building it manually image for image. Which would be a lot of work. :/

Has someone a texture like this available and would provide me with it, or does someone know how to build these textures without doing every Frame by hand?

Thank you.
Duugu is offline   Reply With Quote
Unread 01-23-14, 07:09 AM   #2
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,286
OPie does a "fake" cooldown like that (eg. using textures, not an actual cooldown object). You could take a look to see how that works, though I should warn you the code is rather... let's just go with "interesting".
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
Phanx is offline   Reply With Quote
Unread 01-23-14, 07:59 AM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,191
I think rather than creating a bunch of different graphics cropping will serve you better.

Zork has posted rather extensively on how to achieve ring effects here.
http://www.wowinterface.com/forums/s...highlight=ring
Dridzt is offline   Reply With Quote
Unread 01-23-14, 09:02 AM   #4
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
Thank you both of you.

Having a quick peek into the OPie code I would say it's basically the same way as with Zork's implementation (cooldown is build out of 9 triangular textures).
I know this way, but I would like to realize it with pre-build textures.

I'm rotating the cooldowns parent object via animation groups, which is working fine with a single texture object that is anchored to the center of it's parent.
Building a cooldown out of several anchored/rotated/croped textures would most likely not work with this, or would at least raise new problems. Supposably it would cost me more time to fix them, than to completely create the needed texture by hand.

Example:
This is what happens with the flyout background texture (which is not anchored to the center) if the button is rotated. So I would like to do it as simple as possible.

Last edited by Duugu : 01-23-14 at 09:20 AM.
Duugu is offline   Reply With Quote
Unread 01-23-14, 09:31 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,191
I have a feeling it might be better if you just hide select textures.
The flyout background seems like a prime candidate for that.
Dridzt is offline   Reply With Quote
Unread 01-26-14, 03:02 AM   #6
elcius
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Sep 2011
Posts: 24
I made one of these ages go to use on nameplates, It's made of 345 64x64 frames.
Lua Code:
  1. local n = floor(345*p);
  2. Texture:SetTexCoord(
  3.     0.001953125*n,0,
  4.     0.001953125*n,1,
  5.     0.001953125*(n+1),0,
  6.     0.001953125*(n+1),1
  7. )
Attached Files
File Type: zip Cooldown.zip (186.0 KB, 47 views)
elcius is offline   Reply With Quote
Unread 01-26-14, 05:27 AM   #7
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 594
Originally Posted by elcius View Post
I made one of these ages go to use on nameplates, It's made of 345 64x64 frames.
Lua Code:
  1. local n = floor(345*p);
  2. Texture:SetTexCoord(
  3.     0.001953125*n,0,
  4.     0.001953125*n,1,
  5.     0.001953125*(n+1),0,
  6.     0.001953125*(n+1),1
  7. )
What kinda virus is that, it can't even run properly. But seriously something is wrong with the files.
Resike is offline   Reply With Quote
Unread 01-26-14, 07:56 AM   #8
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
Thank you so much Elcius. This saves me so much time.

Interesting side note: I was sure wow expects textures to be in a square format. oO
Learned something.

Thanks again.
Duugu is offline   Reply With Quote
Unread 01-26-14, 09:21 AM   #9
Choonstertwo
A Cliff Giant
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 71
Originally Posted by Duugu View Post
Thank you so much Elcius. This saves me so much time.

Interesting side note: I was sure wow expects textures to be in a square format. oO
Learned something.

Thanks again.
The only limitations on the dimensions of textures is that they have to be powers of 2 and can't be larger than 1024.

There's a lot more information about WoW-compatible textures in this guide.
Choonstertwo is online now   Reply With Quote
Unread 01-26-14, 10:37 AM   #10
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
Originally Posted by Choonstertwo View Post
The only limitations on the dimensions of textures is that they have to be powers of 2 and can't be larger than 1024.
Well, even if this sounds familar it can't be true. Elcius' texture file has a size of 32,768 x 64 pixels and does work. Strange but true.

[e] I can remember that I used a texture like ... 2048 x 2048 or something years ago with CursorCastBar which reproduceable crashed the Mac client. Don't know if or when this was fixed. Would be nice to know what happens with Elcius' texture file when used on a Mac. Anyone with a Mac client here who could try it?

Last edited by Duugu : 01-26-14 at 10:42 AM.
Duugu is offline   Reply With Quote
Unread 01-26-14, 10:40 AM   #11
Choonstertwo
A Cliff Giant
 
Choonstertwo's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2011
Posts: 71
Originally Posted by Duugu View Post
Well, even if this sounds familar it can't be true. Elcius' texture file has a size of 32,768 x 64 pixels and does work. Strange but true.
That's odd. I've never tested the limits myself, I just assumed the guide was accurate.
Choonstertwo is online now   Reply With Quote
Unread 01-26-14, 10:44 AM   #12
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
Originally Posted by Choonstertwo View Post
That's odd. I've never tested the limits myself, I just assumed the guide was accurate.
Me too. Guess my expression when it does load was somewhat priceless.
Duugu is offline   Reply With Quote
Unread 01-26-14, 12:50 PM   #13
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 594
Originally Posted by Duugu View Post
Well, even if this sounds familar it can't be true. Elcius' texture file has a size of 32,768 x 64 pixels and does work. Strange but true.

[e] I can remember that I used a texture like ... 2048 x 2048 or something years ago with CursorCastBar which reproduceable crashed the Mac client. Don't know if or when this was fixed. Would be nice to know what happens with Elcius' texture file when used on a Mac. Anyone with a Mac client here who could try it?
I can't even open the textures, drops some unknow size issue.
Resike is offline   Reply With Quote
Unread 01-26-14, 01:26 PM   #14
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
Originally Posted by Resike View Post
I can't even open the textures, drops some unknow size issue.
http://www.getpaint.net/ will open it.
Duugu is offline   Reply With Quote
Unread 01-26-14, 02:17 PM   #15
Nimhfree
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 146
Originally Posted by Duugu View Post
Well, even if this sounds familar it can't be true. Elcius' texture file has a size of 32,768 x 64 pixels and does work. Strange but true.

[e] I can remember that I used a texture like ... 2048 x 2048 or something years ago with CursorCastBar which reproduceable crashed the Mac client. Don't know if or when this was fixed. Would be nice to know what happens with Elcius' texture file when used on a Mac. Anyone with a Mac client here who could try it?
If you have an addon to run I will test it out for you. Just let me know where to get the addon.
Nimhfree is offline   Reply With Quote
Unread 01-27-14, 08:46 AM   #16
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
Originally Posted by Nimhfree View Post
If you have an addon to run I will test it out for you. Just let me know where to get the addon.
Here we go. It just creates two frames anchored to UIParent center. Tank you.

The left one has a size of 4096 x 4096 and the right one is 32,768 x 64.
The first one crashed the Mac client (or some client setups at least ... not sure about that :/) back in 2010. I removed it from my addon and replaced it with a 1024x1024 version which seemed to solve the problem.
Attached Files
File Type: zip test.zip (2.79 MB, 29 views)
Duugu is offline   Reply With Quote
Unread 01-28-14, 02:37 AM   #17
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,354
What you are trying to do is sth I did in this mod ages ago:
http://www.wowinterface.com/download...07-Disco2.html

Basically a huge sprite frame that changes the SetTexCoord based on a value. But for me it did not work that well (not smooth enough and problems with smooth animation on bad FPS). Imo WoW can handle 1024x1024 just fine. >= 2048x2048 depends on your PC I guess.

But why would you create 300+ images nowadays and manipulate them manually in first place?

To create a full ring you need two 180° rings and 2 scrollframes. The only thing that is left is an Update function that changes the texture rotation. Plus if you are using animationgroups on your texture you do not have to do that either. You can just run a linear animation loop with an OnFinished function to fix your textures.

Lightspark and I have discussed that here: http://www.wowinterface.com/download...age=2#comments

I can set up an example for you if you like. Should be that hard to get a cooldown ring running.

p.s. I'm talking about animating a simple ring texture...if you are talking about rotating a full set of actionbuttons I'm out.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 01-28-14 at 02:46 AM.
zork is online now   Reply With Quote
Unread 01-28-14, 06:00 AM   #18
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
Originally Posted by zork View Post
What you are trying to do is sth I did in this mod ages ago:
http://www.wowinterface.com/download...07-Disco2.html

Basically a huge sprite frame that changes the SetTexCoord based on a value. But for me it did not work that well (not smooth enough and problems with smooth animation on bad FPS). Imo WoW can handle 1024x1024 just fine. >= 2048x2048 depends on your PC I guess.

But why would you create 300+ images nowadays and manipulate them manually in first place?

To create a full ring you need two 180° rings and 2 scrollframes. The only thing that is left is an Update function that changes the texture rotation. Plus if you are using animationgroups on your texture you do not have to do that either. You can just run a linear animation loop with an OnFinished function to fix your textures.

Lightspark and I have discussed that here: http://www.wowinterface.com/download...age=2#comments

I can set up an example for you if you like. Should be that hard to get a cooldown ring running.

p.s. I'm talking about animating a simple ring texture...if you are talking about rotating a full set of actionbuttons I'm out.
Thanks for replying. Actually I do rotate all Blizzard action buttons and all their contents to create a kind of 'bezier style action bar'.

Actually I didn't was aware of your scrollframe approach. Thanks for pointing this out. I'm not sure if this will work. I'll have to rotate the two scrollframes via an animation. Semlar stated here http://www.wowinterface.com/forums/s...ad.php?t=48798 that rotating a scrollframe would not work as expected. Didn't tried it though.

At the Moment I'm fine with the 'sprite' approach. It's working. And there are several other Problems to solve with my action bar approach. I'll get in touch with the cooldown problem to optimize it if everything else is working too.
Duugu is offline   Reply With Quote
Unread 01-28-14, 06:33 AM   #19
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,354
Yeah...rotating a ScrollFrame itself is a really bad idea. You can do that if you are into arts and stuff ... because art is what you get.

Currently I use animationgroups on textures that are anchored to the scrollchild of a scrollframe. That works pretty well.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is online now   Reply With Quote
Unread 03-15-14, 12:27 PM   #20
Duugu
Premium Member
 
Duugu's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 675
I ended up with building the cooldown image set myself. (I need single files, transparent border, etc.)

It took me a while to search for a usefull approach to build the files. So I just thought I should add a few lines over here showing my solution for everyone else who needs to do this in the future.

An easy way to build image files is a very simple and small vb.net app. Like this one:

Code:
Dim blackPen As New Pen(Color.Black, 1)
Dim filePath As String = "E:\CD\"
Dim count As Integer = 0
Dim bmp As Bitmap = New Bitmap(64, 64)
Dim g As Graphics = Graphics.FromImage(bmp)

g.Clear(Color.Transparent)
bmp.Save(filePath & count & ".png", System.Drawing.Imaging.ImageFormat.Png)
count = count + 1

For x = 32 To 62
   g.DrawLine(blackPen, 32, 32, x, 1)
   bmp.Save(filePath & count & ".png", System.Drawing.Imaging.ImageFormat.Png)
   count = count + 1
Next
For x = 1 To 62
   g.DrawLine(blackPen, 32, 32, 62, x)
   bmp.Save(filePath & count & ".png", System.Drawing.Imaging.ImageFormat.Png)
   count = count + 1
Next
For x = 62 To 1 Step -1
   g.DrawLine(blackPen, 32, 32, x, 62)
   bmp.Save(filePath & count & ".png", System.Drawing.Imaging.ImageFormat.Png)
   count = count + 1
Next
For x = 62 To 1 Step -1
   g.DrawLine(blackPen, 32, 32, 1, x)
   bmp.Save(filePath & count & ".png", System.Drawing.Imaging.ImageFormat.Png)
   count = count + 1
Next
For x = 1 To 32
   g.DrawLine(blackPen, 32, 32, x, 1)
   bmp.Save(filePath & count & ".png", System.Drawing.Imaging.ImageFormat.Png)
   count = count + 1
Next
It builds image files for a 64x64 cooldown fake-animation.

The Graphics class provides a lot of drawing functions. You can use them to build fake-animations for lot of different custom shapes.

Last edited by Duugu : 03-15-14 at 12:31 PM.
Duugu is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Graphics Help » I need a cooldown texture

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