Thread Tools Display Modes
03-23-09, 07:56 AM   #941
sacrife
An Onyxian Warder
 
sacrife's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 384
I'm having some problems with 2d portraits. Mainly because I bad at lua.



I tried using 3d portraits but it annoyed me because of the player animation turning the head away all the time.
If someone knows a code to stop the animation but still keep it 3d, let me know

Otherwise my portraits are 50 in height and 30 in width, and because of that its completely dragged when I used this code to make it square (from pitbull)

portrait:SetTexCoord(0.14644660941, 0.85355339059, 0.14644660941, 0.85355339059)
As you see in my image, the first portrait is it being drawn as 50x50 with those numbers.
The 2nd portrait is 50x30 with the same numbers.
And the third image is 50x30 with the numbers altered to: 0.04644660941, 0.95355339059, 0.04644660941, 0.95355339059.
Problem here is its not squared, although it looks a lot better than the first 2.

So how do I get it square, but still drawn correctly?
And if possible, how do I make the black in the background transparent (like it is if the portrait is 3d)

Update: I tried portrait:SetTexCoord(.2,.8,.2,.8) as numbers from Adapt. Seemed somewhat better. But somewhat zoomed.

Last edited by sacrife : 03-23-09 at 08:16 AM. Reason: Updated info
 
03-25-09, 09:15 AM   #942
coree
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 28
Originally Posted by Luzzifus View Post
Not if you create the SafeZone after the Background. Also you can always set a frame-level to have it on top of the BG.

This is my whole castbar-code and it works perfectly:
Code:
self.Castbar = CreateFrame("StatusBar")
self.Castbar:SetBackdrop({bgFile="Interface\\Tooltips\\UI-Tooltip-Background", insets ={left = -1, right = -1, top = -1, bottom = -1}})
self.Castbar:SetBackdropColor(nivDB.colorBD.r, nivDB.colorBD.g, nivDB.colorBD.b, nivDB.colorBD.a)
self.Castbar:SetWidth(nivcfgDB.castbarWidth)
if (unit=="player") then
	self.Castbar:SetHeight(20)
	self.Castbar:SetPoint("CENTER", UIParent, "CENTER", nivcfgDB.castbarX, nivcfgDB.castbarY)
else
	self.Castbar:SetHeight(10)
	self.Castbar:SetPoint("CENTER", UIParent, "CENTER", nivcfgDB.castbarX, nivcfgDB.castbarY - 17)
end
self.Castbar:SetStatusBarTexture(nivDB.texStrHealth)
self.Castbar:SetStatusBarColor(nivcfgDB.colorHealth.r, nivcfgDB.colorHealth.g, nivcfgDB.colorHealth.b, nivvcfgDB.colorHealth.a)	
self.Castbar:SetParent(self)
self.Castbar:SetMinMaxValues(1, 100)
self.Castbar:SetValue(1)
self.Castbar:Hide()  
self.Castbar.bg = self.Castbar:CreateTexture(nil, "BORDER")
self.Castbar.bg:SetAllPoints(self.Castbar)
self.Castbar.bg:SetTexture("Interface\\AddOns\\oUF_Nivaya\\textures\\Minimalist")
self.Castbar.bg:SetAlpha(0.05)	
self.Castbar.Time = self.Castbar:CreateFontString(nil, "OVERLAY")
self.Castbar.Time:SetPoint("RIGHT", self.Castbar, -2, 0)
self.Castbar.Time:SetFont(nivDB.fontStrValues, nivcfgDB.fontHeightV)
self.Castbar.Time:SetTextColor(1, 1, 1)
self.Castbar.Time:SetJustifyH("RIGHT")
self.Castbar.Text = self.Castbar:CreateFontString(nil, "OVERLAY")
self.Castbar.Text:SetPoint("LEFT", self.Castbar, 2, 0)
self.Castbar.Text:SetWidth(240)
self.Castbar.Text:SetFont(nivDB.fontStrNames, nivcfgDB.fontHeightN)
self.Castbar.Text:SetTextColor(1, 1, 1)
self.Castbar.Text:SetJustifyH("LEFT")
		
if (unit=="player") then
	self.Castbar.Time:SetTextHeight(nivcfgDB.fontHeightV+2)
	self.Castbar.Text:SetTextHeight(nivcfgDB.fontHeightN+2)			
else
	self.Castbar.Time:SetTextHeight(nivcfgDB.fontHeightV)
	self.Castbar.Text:SetTextHeight(nivcfgDB.fontHeightN)			
end

self.Castbar.SafeZone = self.Castbar:CreateTexture(nil,"BORDER")
self.Castbar.SafeZone:SetTexture(nivDB.texStrHealth)
self.Castbar.SafeZone:SetVertexColor(1,1,1,0.7)
self.Castbar.SafeZone:SetPoint("TOPRIGHT")
self.Castbar.SafeZone:SetPoint("BOTTOMRIGHT")
i am creating the safezone after the bg and it doesnt work.

Code:
		local cb = CreateFrame("StatusBar", nil, self)
		cb:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -21)
		cb:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -21)
		cb:SetStatusBarTexture(texture2)
		cb:SetStatusBarColor(0.2705882352941176, 0.407843137254902, 0.5450980392156862)
		cb:SetBackdrop(backdrop)
		cb:SetBackdropColor(0, 0, 0)
		cb:SetHeight(15)
		cb:SetWidth(300)
		cb:SetMinMaxValues(1, 100)
	    cb:SetValue(1)
	    cb:Hide()
		self.Castbar = cb	
		
		local cbbg = cb:CreateTexture(nil, "BORDER")
		cbbg:SetAllPoints(cb)
		cbbg:SetTexture(0.3, 0.3, 0.3)
		cb.bg = cbbg		

		local cbtime = SetFontString(cb, fontn, 14, "THINOUTLINE")
		cbtime:SetPoint("RIGHT", cb, -3, 1)
		cbtime:SetJustifyH("RIGHT")
		cb.CustomTimeText = OverrideCastbarTime
		cb.Time = cbtime

		local cbtext = SetFontString(cb, fontn, 14, "THINOUTLINE")
		cbtext:SetPoint("LEFT", cb, 3, 1)
		cbtext:SetPoint("RIGHT", cbtime, "LEFT")
		cb.Text = cbtext
		
		if(cbarsafe == true and unit == "player") then
			local cbsafe = cb:CreateTexture(nil,"ARTWORK")
			cbsafe:SetTexture(texture2)
			cbsafe:SetVertexColor(.69,.31,.31)
			cbsafe:SetPoint("TOPRIGHT")
			cbsafe:SetPoint("BOTTOMRIGHT")
			cb.SafeZone = cbsafe
		end
 
03-25-09, 10:28 AM   #943
Luzzifus
A Warpwood Thunder Caller
 
Luzzifus's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 94
Try this:
Code:
		local cb = CreateFrame("StatusBar", nil, self)
		cb:SetPoint("TOPRIGHT", self, "BOTTOMRIGHT", 0, -21)
		cb:SetPoint("TOPLEFT", self, "BOTTOMLEFT", 0, -21)
		cb:SetStatusBarTexture(texture2, "OVERLAY")
		cb:SetStatusBarColor(0.2705882352941176, 0.407843137254902, 0.5450980392156862)
		cb:SetBackdrop(backdrop)
		cb:SetBackdropColor(0, 0, 0)
		cb:SetHeight(15)
		cb:SetWidth(300)
		cb:SetMinMaxValues(1, 100)
	    cb:SetValue(1)
	    cb:Hide()
		self.Castbar = cb	
		
		local cbbg = cb:CreateTexture(nil, "BACKGROUND")
		cbbg:SetAllPoints(cb)
		cbbg:SetTexture(0.3, 0.3, 0.3)
		cb.bg = cbbg		

		local cbtime = SetFontString(cb, fontn, 14, "THINOUTLINE")
		cbtime:SetPoint("RIGHT", cb, -3, 1)
		cbtime:SetJustifyH("RIGHT")
		cb.CustomTimeText = OverrideCastbarTime
		cb.Time = cbtime

		local cbtext = SetFontString(cb, fontn, 14, "THINOUTLINE")
		cbtext:SetPoint("LEFT", cb, 3, 1)
		cbtext:SetPoint("RIGHT", cbtime, "LEFT")
		cb.Text = cbtext
		
		if(cbarsafe == true and unit == "player") then
			local cbsafe = cb:CreateTexture(nil, "ARTWORK")
			cbsafe:SetTexture(texture2)
			cbsafe:SetVertexColor(.69,.31,.31)
			cbsafe:SetPoint("TOPRIGHT")
			cbsafe:SetPoint("BOTTOMRIGHT")
			cb.SafeZone = cbsafe
		end
So since "ARTWORK" is above "BACKGROUND" and "OVERLAY" is above "ARTWORK", this should work. However, I don't understand why setting both bg and safezone as "BORDER" works for me but not for you.

Last edited by Luzzifus : 03-25-09 at 10:30 AM.
 
03-25-09, 08:00 PM   #944
kimboslice
A Defias Bandit
Join Date: Jun 2008
Posts: 3
How would I define the castbar spellname to be lowercase?
 
03-26-09, 01:13 PM   #945
Vranx
A Flamescale Wyrmkin
 
Vranx's Avatar
Join Date: May 2008
Posts: 101
Im trying to get a target frame to only show buffs/debuffs I can cast. I put in
auras.filter = "PLAYER" but now it doesnt show anything. Can someone tell me what im doing wrong? Here is what I have:

Code:
if(unit=="target") then     
        local auras = CreateFrame("Frame", nill, self)
        auras.filter = "PLAYER"
        auras:SetPoint("TOPLEFT", self, "BOTTOMLEFT", -2, -3)
        auras.initialAnchor = "TOPLEFT"
        auras["growth-x"] = "RIGHT"
        auras["growth-y"] = "DOWN"
        auras.numDebuffs = 8   
        auras:SetHeight(373)
        auras:SetWidth(248)
        auras.spacing = 1
        auras.size = 30
        auras.gap = true        
	self.Auras = auras
    end
 
03-26-09, 01:21 PM   #946
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
auras.onlyShowPlayer = true is probably what you want. You should also not that you should use .buffFilter and .debuffFilter on .Auras. You also need to append HARMFUL/HELPFUL on those filters.
 
03-26-09, 05:40 PM   #947
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Originally Posted by kimboslice View Post
How would I define the castbar spellname to be lowercase?
To demonstrate this for yourself ingame without reloading the UI :

/run print(("UPPERCASE SENTENCE"):lower())

/run print(UnitName('player'):lower())

You then need to provide the override update function within your layout and make use of that idea on the spellname variable passed to that override.

looking within the ouf/elements/castbar.lua file should provide you with some clues.
 
03-27-09, 10:13 AM   #948
demitri
A Fallenroot Satyr
Join Date: Jul 2008
Posts: 20
i have a problem..

i got some code from ouf_freeb for his indicators on raid frames and such..

here is the code

Code:
local function applyAuraIndicator(self)

		self.AuraStatusBR = self.Health:CreateFontString(nil, "OVERLAY")
		self.AuraStatusBR:ClearAllPoints()
		self.AuraStatusBR:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 5)
		self.AuraStatusBR:SetFont(font, 25, "OUTLINE")
		self:Tag(self.AuraStatusBR, oUF.classIndicators[playerClass]["BR"])	
        
end
i want to know how i can put in "isMine" in this
 
03-27-09, 02:27 PM   #949
demitri
A Fallenroot Satyr
Join Date: Jul 2008
Posts: 20
i cant seeem to get my ouf layout to load when i use my Death Knight
 
03-28-09, 01:46 AM   #950
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Originally Posted by demitri View Post
i have a problem..

i got some code from ouf_freeb for his indicators on raid frames and such..

here is the code

Code:
local function applyAuraIndicator(self)

		self.AuraStatusBR = self.Health:CreateFontString(nil, "OVERLAY")
		self.AuraStatusBR:ClearAllPoints()
		self.AuraStatusBR:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, 5)
		self.AuraStatusBR:SetFont(font, 25, "OUTLINE")
		self:Tag(self.AuraStatusBR, oUF.classIndicators[playerClass]["BR"])	
        
end
i want to know how i can put in "isMine" in this
the variable/return value 'isMine' is used further up where the tags themselves are defined.

'isMine' is a return value from the UnitAura function.

The code block you have paste here is merely a placement function which makes use of a table to arrange tagstrings for a paticular placement.
 
03-28-09, 02:51 AM   #951
demitri
A Fallenroot Satyr
Join Date: Jul 2008
Posts: 20
Code:
oUF.Tags["[beacon]"] = function(u) return UnitAura(u, "Beacon of Light") and "|cffFF5500.|r" or "" end

oUF.Tags["[shield]"] = function(u) return UnitAura(u, "Sacred Shield") and "|cffFFCF7F.|r" or "" end

oUF.TagEvents["[beacon]"] = "UNIT_AURA"
oUF.TagEvents["[shield]"] = "UNIT_AURA"
is the tags..
 
03-28-09, 05:12 AM   #952
jadakren
A Flamescale Wyrmkin
 
jadakren's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 103
Post

Originally Posted by demitri View Post
Code:
oUF.Tags["[beacon]"] = function(u) return UnitAura(u, "Beacon of Light") and "|cffFF5500.|r" or "" end

oUF.Tags["[shield]"] = function(u) return UnitAura(u, "Sacred Shield") and "|cffFFCF7F.|r" or "" end

oUF.TagEvents["[beacon]"] = "UNIT_AURA"
oUF.TagEvents["[shield]"] = "UNIT_AURA"
is the tags..
So considering that the information provided at :
http://www.wowwiki.com/API_UnitAura

It tells use that there nine return values from this function.

Code:
name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable = UnitAura("unit", index or ["name", "rank"][, "filter"])
what you do here is modify your function to show :
Code:
oUF.Tags["[beacon]"] = function(u)
 local name, _,_,_,_,_,_, isMine,_ = UnitAura("unit")
 if not isMine then return end -- if its not ours then exit function
 return (name == "Beacon of Light") and "|cffFF5500.|r" or ""
end
 
03-28-09, 07:49 AM   #953
demitri
A Fallenroot Satyr
Join Date: Jul 2008
Posts: 20
ty ty... that seems to have worked.. now i have a new problem...

i cant get ouf runebar to spawn... it keeps the default one...

Code:
if(class == 'DEATHKNIGHT') then
			self.RuneBar = {}
			for i = 1, 6 do
				self.RuneBar[i] = CreateFrame('StatusBar', nil, self)
				if(i == 1) then
					self.RuneBar[i]:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -40)
				else
					self.RuneBar[i]:SetPoint('TOPLEFT', self.RuneBar[i-1], 'TOPRIGHT', 1, 0)
				end
				self.RuneBar[i]:SetStatusBarTexture(bartex)
				self.RuneBar[i]:SetStatusBarColor(unpack(runeloadcolors[i]))
				self.RuneBar[i]:SetHeight(4)
				self.RuneBar[i]:SetWidth(230/6 - 0.85)
				self.RuneBar[i]:SetBackdrop(backdrop)
				self.RuneBar[i]:SetBackdropColor(0, 0, 0)
				self.RuneBar[i]:SetMinMaxValues(0, 1)
				self.RuneBar[i]:SetID(i)

				self.RuneBar[i].bg = self.RuneBar[i]:CreateTexture(nil, 'BORDER')
				self.RuneBar[i].bg:SetAllPoints(self.RuneBar[i])
				self.RuneBar[i].bg:SetTexture(0.3, 0.3, 0.3)			
			end

			RuneFrame:Hide()

			self:RegisterEvent('RUNE_TYPE_UPDATE', UpdateRuneType)
			self:RegisterEvent('RUNE_REGEN_UPDATE', UpdateRuneType)
			self:RegisterEvent('RUNE_POWER_UPDATE', UpdateRunePower)
		end
using p3lims
 
03-28-09, 08:36 AM   #954
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by demitri View Post
ty ty... that seems to have worked.. now i have a new problem...

i cant get ouf runebar to spawn... it keeps the default one...

Code:
if(class == 'DEATHKNIGHT') then
			self.RuneBar = {}
			for i = 1, 6 do
				self.RuneBar[i] = CreateFrame('StatusBar', nil, self)
				if(i == 1) then
					self.RuneBar[i]:SetPoint('TOPLEFT', self, 'BOTTOMLEFT', 0, -40)
				else
					self.RuneBar[i]:SetPoint('TOPLEFT', self.RuneBar[i-1], 'TOPRIGHT', 1, 0)
				end
				self.RuneBar[i]:SetStatusBarTexture(bartex)
				self.RuneBar[i]:SetStatusBarColor(unpack(runeloadcolors[i]))
				self.RuneBar[i]:SetHeight(4)
				self.RuneBar[i]:SetWidth(230/6 - 0.85)
				self.RuneBar[i]:SetBackdrop(backdrop)
				self.RuneBar[i]:SetBackdropColor(0, 0, 0)
				self.RuneBar[i]:SetMinMaxValues(0, 1)
				self.RuneBar[i]:SetID(i)

				self.RuneBar[i].bg = self.RuneBar[i]:CreateTexture(nil, 'BORDER')
				self.RuneBar[i].bg:SetAllPoints(self.RuneBar[i])
				self.RuneBar[i].bg:SetTexture(0.3, 0.3, 0.3)			
			end

			RuneFrame:Hide()

			self:RegisterEvent('RUNE_TYPE_UPDATE', UpdateRuneType)
			self:RegisterEvent('RUNE_REGEN_UPDATE', UpdateRuneType)
			self:RegisterEvent('RUNE_POWER_UPDATE', UpdateRunePower)
		end
using p3lims

Is 'class' defined?
Do you have the toc metadata?
 
03-28-09, 09:32 AM   #955
demitri
A Fallenroot Satyr
Join Date: Jul 2008
Posts: 20
Originally Posted by p3lim View Post
Is 'class' defined?
Do you have the toc metadata?
what yes i have the toc metadata (well i THINK i do)... not sure abut the class being defined tho :S
 
03-28-09, 09:33 AM   #956
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by demitri View Post
what yes i have the toc metadata (well i THINK i do)... not sure abut the class being defined tho :S
replace the 'class' with 'select(2, UnitClass('player'))'
 
03-28-09, 10:03 AM   #957
demitri
A Fallenroot Satyr
Join Date: Jul 2008
Posts: 20
woohoo.. ur the man..thanks so much!
 
03-28-09, 10:12 AM   #958
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I'm not going to lock this topic, but I would like it if people posted new threads instead now. The two oUF threads are currently very large, and it's quite hard to see what posts have been left unanswered.

Another gain would be that it's easier to find the information in smaller threads, and the discussions won't be absorbed by the more common problems people have. We have an entire forum dedicated to oUF now, so continuing to use these "monster" threads seem illogical .
 
03-29-09, 04:12 PM   #959
nin
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 213
this is such a small and probably a little stupid question so i won't start another thread for it

Im having an error msg i quite don't understand why im getting.. it doesn't seem to do anything to my layout more than annoy me..


part of error msg is :

"Attempt to index global 'color' a nil value"

This is the part of the lua that it complains about..

if unit=="target" then
self.Name:SetTextColor(1,1,1)

else
local _, class = UnitClass(unit)
color = self.colors.class[class]
self.Name:SetTextColor(color[1], color[2], color[3])

Any pointers and hints on what it is that can cause this would be much appreciated
 
03-29-09, 07:17 PM   #960
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Nin, there is no entry in "self.colors.class" for some class, you can probably set up an __index metamethod for "self.colors.class", I think thats what p3lim and other people do so check out their code.
 

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF - Layout discussion


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