Reply
Thread Tools Display Modes
Unread 03-27-13, 08:24 AM   #21
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
Btw...when you are building your ring segments with non-transparent areas inside your ring the following texture will be enough to display all the rings you will ever need.



You do not have to care about ring-width at all. Clever overlaying and frame-stacking is all you need to create the illusion.

Layer 1: (needs two scrollFrames of same color)


Layer 2:


Layer 3:


Handling ring-width is an annoying topic. If you don't have to fiddle with it just don't.

The last step is another layer ontop containing highlight/border textures. But I remommend to delay that step until the layout is finished. It is tedious to create it if you are still working on your layout and change sizes around all the time.

One thing I still need to check out is the effect of the different BlendModes.
__________________
| 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 : 03-27-13 at 08:40 AM.
zork is offline   Reply With Quote
Unread 03-27-13, 11:57 AM   #22
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,058
Here's a link to a good explanation to how BlendModes work.
http://www.wowpedia.org/AlphaMode
__________________
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
SDPhantom is offline   Reply With Quote
Unread 04-15-13, 02:07 AM   #23
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
Just some more links on that topic:

http://en.wikipedia.org/wiki/Circular_motion
http://cnx.org/content/m42177/latest...ol11406/latest
http://www.wowinterface.com/forums/s...ad.php?t=45091
__________________
| 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 : 04-15-13 at 02:10 AM.
zork is offline   Reply With Quote
Unread 04-17-13, 03:26 PM   #24
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
Working on it if I have time to spare. Currently doing the basic setup.

http://imgur.com/a/s1uAA#0

Currently setting everything up.



The main problem atm is getting the frame stacking right. This included frames for border and highlight effects later on.

Basic setup is done. Including a spark texture.



Each ring can sit on 1-4 ring segments.
A segement can handle rings for castbar, health and power.
Each ring can have its own radius.
Each ring consists of a background, ring and a spark texture.

Code will be released under oUF_Donut.
__________________
| 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 : 04-17-13 at 04:18 PM.
zork is offline   Reply With Quote
Unread 04-19-13, 10:02 PM   #25
pelf
Sentient Plasmoid
 
pelf's Avatar
Premium Member
Join Date: May 2008
Posts: 128
What did you decide for where to indicate the spell for a castbar ring?
pelf is offline   Reply With Quote
Unread 04-21-13, 06:14 PM   #26
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 639
Originally Posted by zork View Post
Lol...SetRotation has a bug. It does sth to my ring texture.


This bug occours, when you call the SetRotation function on a texure which doesn't have enough transparent "spaceborder" to do the full rotate, based on your pivot point. I also run into the problem:



I made a fix like that:

Code:
local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = texture:GetTexCoord();
local x = (sqrt(2) - 1) / 2
texture:SetTexCoord(ULx + x, ULy + x, LLx + x, LLy - x, URx - x, URy + x, LRx - x, LRy - x);
And its gone:

Resike is offline   Reply With Quote
Unread 04-23-13, 01:35 AM   #27
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
SDPanthom wrote an explanation on that here aswell: http://www.wowinterface.com/forums/s...7&postcount=10

Regarding your fix. Does the function only has to be called once per texture prior to any SetRotation calls?

If you have to call it after every SetRotation you will be screwed. What if you rotate the texture in a way that your math. prefixed (+-) are wrong because points have switched places.
__________________
| 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 : 04-23-13 at 01:50 AM.
zork is offline   Reply With Quote
Unread 04-23-13, 03:24 AM   #28
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 639
Originally Posted by zork View Post
SDPanthom wrote an explanation on that here aswell: http://www.wowinterface.com/forums/s...7&postcount=10

Regarding your fix. Does the function only has to be called once per texture prior to any SetRotation calls?

If you have to call it after every SetRotation you will be screwed. What if you rotate the texture in a way that your math. prefixed (+-) are wrong because points have switched places.
I don't want to rotate textures after the fix, only to mirror them. Whats the point rotate texture which is incapable of it. Well, you can rotate it, but it's going to be glitchy. I only made the fix so the texture going to be look okay on 0 degree, and you can properly mirror it too.

But the version you said, seems intresting too, to cut the edges after every rotation, and you can change the -+ values based on the rotation degree, i might try to code it later.

Last edited by Resike : 04-23-13 at 03:29 AM.
Resike is offline   Reply With Quote
Unread 04-23-13, 09:11 AM   #29
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 639
Okay i came up with something like that:

Code:
	if (aura.textaura ~= true) then
		texture:SetRotation(math.rad(aura.rotate));
	end
	if (aura.customtex == true) or (aura.owntex == true) then
		local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = texture:GetTexCoord();
		local x = (sqrt(2) - 1) / 2
		if string.find(aura.customname, "//") then
			if (aura.rotate == 0) or (aura.rotate == 360) then
				texture:SetTexCoord(ULx + x, ULy + x, LLx + x, LLy - x, URx - x, URy + x, LRx - x, LRy - x);
			elseif (aura.rotate == 90) then
				texture:SetTexCoord(ULx + x, ULy + x, LLx - x, LLy + x, URx + x, URy - x, LRx - x, LRy - x);
			elseif (aura.rotate == 180) then
				texture:SetTexCoord(ULx + x, ULy - x, LLx + x, LLy + x, URx - x, URy - x, LRx - x, LRy + x);
			elseif (aura.rotate == 270) then
				texture:SetTexCoord(ULx - x, ULy - x, LLx + x, LLy - x, URx - x, URy + x, LRx + x, LRy + x);
			end
		else
			if (aura.rotate == 0) or (aura.rotate == 360) then
				texture:SetTexCoord(ULx + x, ULy + x, LLx + x, LLy - x, URx - x, URy + x, LRx - x, LRy - x);
			elseif (aura.rotate == 90) then
				texture:SetTexCoord(ULx - x, ULy + x, LLx + x, LLy + x, URx - x, URy - x, LRx + x, LRy - x);
			elseif (aura.rotate == 180) then
				texture:SetTexCoord(ULx - x, ULy - x, LLx - x, LLy + x, URx + x, URy - x, LRx + x, LRy + x);
			elseif (aura.rotate == 270) then
				texture:SetTexCoord(ULx + x, ULy - x, LLx - x, LLy - x, URx + x, URy + x, LRx - x, LRy + x);
			end
		end
	end
	if (aura.textaura ~= true) then
		local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = texture:GetTexCoord();
		if (aura.symetrie == 1) then
			texture:SetTexCoord(URx, URy, LRx, LRy, ULx, ULy, LLx, LLy); -- Inverse X
		elseif (aura.symetrie == 2) then
			texture:SetTexCoord(LLx, LLy, ULx, ULy, LRx, LRy, URx, URy); -- Inverse Y
		elseif (aura.symetrie == 3) then
			texture:SetTexCoord(LRx, LRy, URx, URy, LLx, LLy, ULx, ULy); -- Inverse XY
		else
			texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy); -- Normal
		end
	end
	if (aura.textaura == true) then
		frame.baseH = 256 * aura.size * (2 - aura.torsion);
	elseif (aura.customtex == true) then
		local x = (sqrt(2) * 2) - 1
		if string.find(aura.customname, "//") then
			if (aura.rotate == 0) or (aura.rotate == 180) or (aura.rotate == 360) then
				frame.baseH = 256 * aura.size * (2 - aura.torsion);
			elseif (aura.rotate == 90) or (aura.rotate == 270) then
				frame.baseH = x * 256 * aura.size * (2 - aura.torsion);
			else
				frame.baseH = sqrt(2) * 256 * aura.size * (2 - aura.torsion);
			end
		else
			if (aura.rotate == 0) or (aura.rotate == 180) or (aura.rotate == 360) then
				frame.baseH = 256 * aura.size * (2 - aura.torsion);
			elseif (aura.rotate == 90) or (aura.rotate == 270) then
				frame.baseH = 256 * aura.size * (2 - aura.torsion);
			else
				frame.baseH = sqrt(2) * 256 * aura.size * (2 - aura.torsion);
			end
		end
	elseif (aura.owntex == true) then
		if (aura.rotate == 0) or (aura.rotate == 180) or (aura.rotate == 360) then
			frame.baseH = 256 * aura.size * (2 - aura.torsion);
		elseif (aura.rotate == 90) or (aura.rotate == 270) then
			frame.baseH = 256 * aura.size * (2 - aura.torsion);
		else
			frame.baseH = sqrt(2) * 256 * aura.size * (2 - aura.torsion);
		end
	else
		frame.baseH = sqrt(2) * 256 * aura.size * (2 - aura.torsion);
		frame.baseL = sqrt(2) * 256 * aura.size * aura.torsion;
	end
	if (aura.textaura == true) then
		local fontsize = math.min(33, math.max(10, math.floor(frame.baseH / 12.8)));
		local checkfont = texture:SetFont(self.Fonts[aura.aurastextfont], fontsize, "OUTLINE, MONOCHROME");
		if not checkfont then
			texture:SetFont(STANDARD_TEXT_FONT, fontsize, "OUTLINE, MONOCHROME");
		end
		frame.baseL = texture:GetStringWidth() + 5;
	elseif (aura.customtex == true) then
		local x = (sqrt(2) * 2) - 1
		if string.find(aura.customname, "//") then
			if (aura.rotate == 0) or (aura.rotate == 360) then
				frame.baseL = 256 * aura.size * aura.torsion;
			elseif (aura.rotate == 90) or (aura.rotate == 270) then
				frame.baseL = 256 * aura.size * aura.torsion;
			elseif (aura.rotate == 180) then
				frame.baseL = x * 256 * aura.size * aura.torsion;
			else
				frame.baseL = sqrt(2) * 256 * aura.size * aura.torsion;
			end
		else
			if (aura.rotate == 0) or (aura.rotate == 180) or (aura.rotate == 360) then
				frame.baseL = 256 * aura.size * aura.torsion;
			elseif (aura.rotate == 90) or (aura.rotate == 270) then
				frame.baseL = 256 * aura.size * aura.torsion;
			else
				frame.baseL = sqrt(2) * 256 * aura.size * aura.torsion;
			end
		end
	elseif (aura.owntex == true) then
		if (aura.rotate == 0) or (aura.rotate == 180) or (aura.rotate == 360) then
			frame.baseL = 256 * aura.size * aura.torsion;
		elseif (aura.rotate == 90) or (aura.rotate == 270) then
			frame.baseL = 256 * aura.size * aura.torsion;
		else
			frame.baseL = sqrt(2) * 256 * aura.size * aura.torsion;
		end
	end
	PowaAuras:InitialiseFrame(aura, frame);
It lets you rotate any textures, but it shows properly "bugged" textures too at 0, 90, 180, 270 degree. Also the mirroring works on them too.
Resike is offline   Reply With Quote
Unread 04-24-13, 04:06 AM   #30
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
I don't really understand the hassle. Just cut out a 1px border of your texture's alpha layer. If that pixel is black the texture will be transparent thus the bug will not appear.
Blizzard uses the outmost 1 pixel for background color multiplication calculations which can be quite useful in some scenarios.
__________________
| 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 offline   Reply With Quote
Unread 04-24-13, 07:16 AM   #31
Resike
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 639
Originally Posted by zork View Post
I don't really understand the hassle. Just cut out a 1px border of your texture's alpha layer. If that pixel is black the texture will be transparent thus the bug will not appear.
Blizzard uses the outmost 1 pixel for background color multiplication calculations which can be quite useful in some scenarios.
Okay, and how do i do that? :P

The fix meant to work when the user loads a cusom texture, or a texture from wow.
I mostly have problems with ingame icons, i got a thread about it here: http://www.wowinterface.com/forums/s...81&postcount=5

Last edited by Resike : 04-24-13 at 07:29 AM.
Resike is offline   Reply With Quote
Unread 04-24-13, 10:57 AM   #32
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
I'm getting near alpha state.



Including pet and targettarget (showing a second ring layout template)


I decided to add a templating engine for ring setups. Thus it is possible to setup different ring types and use them for specific units.

The update and value change functions are done.

A ring can use 1,2,3 or all 4 segments.
A ring can rotate clockwise or counter-clockwise.

Lua Code:
  1. --    ring segment layout
  2. --     ____ ____
  3. --    /    |    \
  4. --    |  4 | 1  |
  5. --     ----+----
  6. --    |  3 | 2  |
  7. --    \____|____/
  8. --

More shots:
http://imgur.com/a/786JI#0

*edit*

I released oUF_Donut: http://www.wowinterface.com/download...oUF_Donut.html
__________________
| 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 : 04-24-13 at 12:06 PM.
zork is offline   Reply With Quote
Unread 04-25-13, 06:45 AM   #33
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
This could be a possible ring template:


It combines all possible bars in one layout.

This is just one suggestion.

Health and power could have been done in two half-rings aswell.

Thus it could look like:
__________________
| 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 : 04-25-13 at 06:58 AM.
zork is offline   Reply With Quote
Unread 04-25-13, 03:11 PM   #34
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,683
The bottom image is much easier to process than the first.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline   Reply With Quote
Unread 04-30-13, 04:22 AM   #35
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
Maybe...but it has to be tested by actually using it.

The castbar will be hidden most of the time for melee players and against melee targets.

Additionally I added an optional attribute to the powerring configuration that allows hiding of the powerring if the unit does not even have power.

The good:
Testing out ring settings is really easy. It only requires an adjustment on the following variables to change the whole appearance:
Lua Code:
  1. --    ring segment layout
  2.   --     ____ ____
  3.   --    /    |    \
  4.   --    |  4 | 1  |
  5.   --     ----+----
  6.   --    |  3 | 2  |
  7.   --    \____|____/
  8.   --
  9.  
  10. --ring config
  11. radius = 0.9,     -- range 0-1
  12. sublevel = {      --display level of the texture
  13.   bg        = -8,
  14.   fill      = -7,
  15.   spark     = -6,
  16. },
  17. numSegmentsUsed = 4,  -- how many sements are affected? (see ring layout)
  18. startSegment  = 4,    -- in which segment should the ring begin it's journey? (see ring layout)
  19. fillDirection = 0,    -- how should the ring fill up? 1 = clock-wise, 0 = counter-clock-wise

http://code.google.com/p/rothui/sour...default.lua#34

Basically you can adjust the radius of a ring. Second you can adjust the texture layers. Last you set how many ring segments should be used, where the ring should start and how it should fill up.

That way you can shuffle your rings around in no time and try out new setups.

I really like adding class/combo and altpowerbar to the ring template idea. It just fits the the concept.

The problem on that is that my 16texture layers will be no more enough to hold all the layers per scrollFrame. Easy enough though. A texture drawlayer is capable of handling a sublevel and a strata. This gives us space for up to 80 textures per scrollFrame.

That should be enough >_<.

So I need to add the texture strata to the ring template. New ring elements will be "classring" and "altring".

As posted above changing the whole appearance can be done easily by changing some variables.

Why not use the comboring as an outer ring? Etc.
__________________
| 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 : 04-30-13 at 04:45 AM.
zork is offline   Reply With Quote
Unread 08-07-14, 06:45 AM   #36
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,391
Released rCompassCastbar that is using the technique.

http://www.wowinterface.com/download...ssCastbar.html
__________________
| 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 offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » General Authoring Discussion » The ring theory part two

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