Thread Tools Display Modes
09-12-09, 06:00 AM   #1
Empower
A Defias Bandit
AddOn Compiler - Click to view compilations
Join Date: Jan 2009
Posts: 2
Creating border for combo points

I've been wanting to change the looks of the current oUF layout's combo points that I'm using (Tukz's if it matters).
So I've created the texture I want, and got it into the game fine however Tukz's old combo points never had a border attached to them so I'm struggling to find a way to add one. He has a presaved border texture which I'd like to use but can't find a way to apply it to the combo point bar texture.

Script related to Cpoints that I can find is:

self.CPoints = {}
self.CPoints.unit = PlayerFrame.unit
for i = 1, 5 do
self.CPoints[i] = self.Health:CreateTexture(nil, "OVERLAY")
self.CPoints[i]:SetHeight(18)
self.CPoints[i]:SetWidth(48)
self.CPoints[i]:SetTexture(bubbleTex)
if i == 1 then
self.CPoints[i]:SetPoint("TOPLEFT", -80, 100)
self.CPoints[i]:SetVertexColor(0.65, 0.63, 0.35)
else
self.CPoints[i]:SetPoint("TOP", self.CPoints[i-1], "BOTTOM", 1)
end
end
self.CPoints[2]:SetVertexColor(0.65, 0.63, 0.35)
self.CPoints[3]:SetVertexColor(0.65, 0.63, 0.35)
self.CPoints[4]:SetVertexColor(0.74, 0.25, 0.25)
self.CPoints[5]:SetVertexColor(0.45, 0.72, 0.45)
self:RegisterEvent("UNIT_COMBO_POINTS", UpdateCPoints)
end

Am I in the right area?
Any help would be greatly appreciated. If this thread is in the wrong place if someone could point me in the right direction and I'll delete this.
Note - I saved my texture as bubbleTex so it didn't cause any adverse effects anywhere else.

Last edited by Empower : 09-12-09 at 07:12 AM.
  Reply With Quote
09-12-09, 07:42 AM   #2
nailertn
An Aku'mai Servant
Join Date: Oct 2008
Posts: 33
If the texture file you use has the border sections aligned and clustered correctly, it is actually pretty easy, something like the below code should do it.

Code:
local backdrop = {
	bgFile = "Interface\\Buttons\\WHITE8X8",
	-- use the correct path below, mind the double \\
	edgeFile = "Interface\\AddOns\\MyMediaFolder\\MyBorderFile",
	edgeSize = 8,
	insets = { left = 2, right = 2, top = 2, bottom = 2 }
}

self.CPoints = {}
self.CPoints.unit = PlayerFrame.unit
for i = 1, 5 do
	self.CPoints[i] = CreateFrame("Frame", nil, self.Health)
	self.CPoints[i]:SetHeight(18)
	self.CPoints[i]:SetWidth(48)
	-- the below line may be skipped, use only if cpoints are not visible
	self.CPoints[i]:SetFrameLevel(self.Health:GetFrameLevel() + 1)
	self.CPoints[i]:SetBackdrop(backdrop)
	if i == 1 then
		self.CPoints[i]:SetPoint("TOPLEFT", -80, 100)
		self.CPoints[i]:SetBackdropColor(0.65, 0.63, 0.35)
	else
		self.CPoints[i]:SetPoint("TOP", self.CPoints[i-1], "BOTTOM", 1)
	end
end

self.CPoints[2]:SetBackdropColor(0.65, 0.63, 0.35)
self.CPoints[3]:SetBackdropColor(0.65, 0.63, 0.35)
self.CPoints[4]:SetBackdropColor(0.74, 0.25, 0.25)
self.CPoints[5]:SetBackdropColor(0.45, 0.72, 0.45)
self:RegisterEvent("UNIT_COMBO_POINTS", UpdateCPoints)
end
Play around with the edgeSize and inset sizes to find a nice fit. However if your border file is neither segmented nor a uniform texture you can apply without rotation and clipping it is a pain in the ass you don't want to experience.

(That last 'end' closes a function preceding the code snippet you pasted.)
  Reply With Quote
09-13-09, 03:03 AM   #3
Empower
A Defias Bandit
AddOn Compiler - Click to view compilations
Join Date: Jan 2009
Posts: 2
Worked a treat, thanks
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Creating border for combo points


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