Thread Tools Display Modes
08-23-08, 12:27 PM   #1
karmamuscle
A Cobalt Mageweaver
 
karmamuscle's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 205
Adjusting default castbar. Texture help.

Hey.
I am trying to modify the default castbar and have gotten this far.

This is the lua code I have
Code:
local c = CastingBarFrame
c:ClearAllPoints()
c:SetWidth(250)
c:SetPoint("BOTTOM", UIParent, 0, 200)
c.SetPoint = function() end
I have tried various approaches to this, from things I found on wowwiki, but with no luck at all.

What do I need to do, to get the casting bar border texture to follow the width of the casting bar?
  Reply With Quote
08-23-08, 01:17 PM   #2
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
The width and height of the castbar border texture is hard coded and not relative:
Code:
<Texture name="$parentBorder" file="Interface\CastingBar\UI-CastingBar-Border">
<Size>
	<AbsDimension x="256" y="64"/>
</Size>
<Anchors>
	<Anchor point="TOP">
		<Offset>
			<AbsDimension x="0" y="28"/>
		</Offset>
	</Anchor>
You'll have to set the texture relative to the castbar frame.
Unfortunately the texture has to be a little bit larger than the castbar frame (the border has to be outside the statusbar ... not inside).
Code:
getglobal(c:GetName().."Border"):ClearAllPoints()
getglobal(c:GetName().."Border"):SetPoint("TOPLEFT", "CastingBarFrame", "TOPLEFT", -(c:GetWidth()*0.18), c:GetHeight()*1.1)
getglobal(c:GetName().."Border"):SetPoint("BOTTOMRIGHT", "CastingBarFrame", "BOTTOMRIGHT", c:GetWidth()*0.18, -(c:GetHeight()*1.1))
Guess you'll have to set new points for all other elements of the castbar frame too.
  Reply With Quote
08-24-08, 08:10 AM   #3
karmamuscle
A Cobalt Mageweaver
 
karmamuscle's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 205
Thanks Duugu, worked like a charm
  Reply With Quote
08-24-08, 09:40 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
You may want to take a look at oCB by haste.

http://ixo.no/git/
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Adjusting default castbar. Texture help.


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