Quantcast Question about an old Mod - WoWInterface
Thread Tools Display Modes
02-13-07, 07:47 PM   #1
Maldelic
A Murloc Raider
Join Date: Feb 2007
Posts: 5
Question about StatRings

Iriel, I wish to ask you a question about StatRings.

I am trying to create a non-HUD unitframes mod just for vanity's purpose. It is not meant to be to customizable at first. The textures are all preloaded/sized. The predicament I am in is that there doesn't seem to be a single person who can tell me how to make a frame fill/texture draw along a curve. I have looked at the statrings code and found mention of math.angle, but I am unsure of the basic procedure.

Could you explain how to make a curved fill-bar? It needs to be able to do a 3/4 circle.

Last edited by Maldelic : 02-14-07 at 03:17 PM.
  Reply With Quote
02-15-07, 01:37 AM   #2
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 578
This is a bit tricky, and how useful it is to you depends heavily on the textures you're using. We've basically got three tricks we can do using SetTexCoord to render any kind of curve section:

1) We can crop a sub-rectangle out of a texture image -- this is fairly obvious, you can draw any sub-rectangle of your texture image and map it to any sized rectangle on screen (A Texure object), so for the bulk of a large curve you can generally just find a rectangular area (or possibly a few rectangular areas) that needs to be shown, and display subsets as necessary that merge together into the curve.

For StatRings this does most of the work, except for the angled cut-off point.. You end up with a rectangular cut-out.

2) We can stretch a texture image to different heights/widths, specifically a 45 degree right-angled-triangular texture can be stretched to be any angle of right angled triangle, great for filling in angled edges of larger objects.

3) We can do some interesting things with images that have transparent borders, such that we can perform almost any linear transformation including shearing and rotating. This can be used to create little wedge shaped pieces for very small curve sections.

Finally you can combine several of the above, for example you could approximate a smooth edge of a very detailed texture with a bunch of rectangular sections, combined with perhaps some triangular pieces to smooth off the edge.

Finally, a couple of diagrams I drew on how to do pie charts using textures may help also:

http://www.vigilance-committee.org/w...m/PieParts.gif
http://www.vigilance-committee.org/w...m/PieShear.gif
  Reply With Quote
02-15-07, 12:59 PM   #3
Maldelic
A Murloc Raider
Join Date: Feb 2007
Posts: 5
Thanks for the help. This with some research on my own should be able to do it. I'll post again with progress and such once that happens - I'm still in the very first stages (non scripted XML frame definitions)
  Reply With Quote

WoWInterface » Featured Projects » Iriel's Castle » Question about an old Mod

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