At the first I have tried to start my custom layout reading classic or lily (also because the wiki is not so much) but I find a them a bit more difficult to read and begin with than others layouts.
So I test a lot of others and at the end I have used the "Elen" layout to begin to study OUF because I have find it easier for me to begin and to understand even if the "self" construct is a thing I have to approch better ...
I simplified it a lot (also removing the things that Phanx and p3lim pointed me in the string management because I really didn't understand them :-) and then begin to rewrite my own simple layout :-)
For example... the border in this case is quite simple:
Lua Code:
-- [other code here]
local backdrop = {
bgFile = mediapath .. "back.tga",
insets = {top = -1, left = -1, bottom = -1, right = -1},
}
local backdrop2 = {
bgFile = mediapath .. "back.tga",
insets = {top = -1, left = -1, bottom = -1, right = -1},
}
local statusback = {
bgFile = mediapath .. "statusbar.tga",
insets = {top = 0, left = 0, bottom = 0, right = 0},
}
-- [other code here]
local cPlayer = function(self)
self:SetSize(250, 40)
self.Back = CreateFrame('Frame', nil, self)
self.Back:SetPoint('TOPLEFT', self)
self.Back:SetWidth(250)
self.Back:SetHeight(51)
self.Back:SetFrameStrata('BACKGROUND')
self.Back:SetBackdrop(backdrop)
self.Back:SetBackdropColor(0.05, 0.05, 0.05)
--: HEALTH BAR :--
self.Health = CreateFrame('StatusBar', nil, self)
self.Health:SetPoint('TOPLEFT', self)
self.Health:SetWidth(250)
self.Health:SetHeight(25)
self.Health:SetBackdrop(statusback)
self.Health:SetBackdropColor(0.165,0.165,0.165)
self.Health:SetFrameStrata('LOW')
self.Health:SetStatusBarTexture(statusbar)
self.Health.frequentUpdates = FreqUpdate
self.Health.Smooth = cSmooth
self.Health.colorClass = false
self.Health:SetStatusBarColor(START_green[1],START_green[2],START_green[3])
--: POWER BAR :--
self.Power = CreateFrame('StatusBar', nil, self)
self.Power:SetPoint('TOPLEFT', self.Health, 'BOTTOMLEFT', 0, -1)
self.Power:SetHeight(25)
self.Power:SetWidth(250)
self.Power:SetBackdropColor(0.15,0.15,0.15)
self.Power:SetFrameStrata('LOW')
self.Power:SetStatusBarTexture(statusbar)
self.Power:SetStatusBarColor(0.28,0.28,0.28)
self.Power.frequentUpdates = FreqUpdate
self.Power.Smooth = cSmooth
self.Power.colorClass = false
self.Power.colorPower=true
--:: PG NAME ::--
self.Info = self.Health:CreateFontString(nil, 'OVERLAY')
self.Info:SetPoint('LEFT',self.Health,'LEFT', 5, 0)
self.Info:SetAlpha(1)
self.Info:SetFont( START_font , START_fs , '')
self:Tag(self.Info,'[name]')
--: HEALTH TEXT NUM :--
self.Health.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Health.Text:SetFont( START_font , START_smfs , '')
self:Tag(self.Health.Text,'[gmarco:curhp]')
self.Health.Text.frequentUpdates = FreqUpdate
self.Health.Text:SetPoint('RIGHT',self.Health,'RIGHT', -5, 0 )
--: POWER TEXT :--
self.Power.Text = self.Health:CreateFontString(nil, 'OVERLAY')
self.Power.Text:SetFont(START_font, START_smfs, '')
self.Power.Text.frequentUpdates = FreqUpdate
self:Tag(self.Power.Text,'[curpp]')
self.Power.Text:SetPoint('RIGHT',self.Power,'RIGHT', -5, 0)
self:RegisterEvent("UNIT_THREAT_SITUATION_UPDATE", check_threat)
-- and then castbar etc etc ....
As you see :
self.Back:SetHeight(51) = self.Health:SetHeight(25) + 1 pixel from healthbar and powerbar + self.Power:SetHeight(25) .
The countour I think is made by:
insets = {top = -1, left = -1, bottom = -1, right = -1}
The result of this frame can be seen in my answer in the other link above.
Please let me know :-)