Thread Tools Display Modes
12-26-09, 12:02 AM   #1
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
X and Y positions of Health and Mana within a frame.

Hello. I am currently using oUF_Nivaya, as my lua skills are 0, it has that handy in-game config. I do however know other kinds of code so reading through the lua files does end up making some sense to me, I have been able to figure out the fairly obvious.

I was wondering how I might go about go about moving the X and Y position of the mana bar within the Player and Target (and Focus etc) frames. I can move the X and Y position of the specific frames to high heaven, but I can't seem to specifically target the mana bar (or any specific bar within a frame).

I noticed these lines that I thought I could add to:
Code:
    ptWidth = 140,	-- Size Variables for Player and Target frames
    ptHeight = 28,
    ptHealthHeight = 22,
    ptManaHeight = 5,
So I tried adding this to the bottom:
Code:
    ptManaX = 5,
    ptManaY = 10,
Seemed logical enough, but nothing happened. Any tips?
  Reply With Quote
12-26-09, 12:14 AM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
Look for code that uses the call "SetPoint" as that determines the relative location to another UI object (or to the UIParent).
  Reply With Quote
12-26-09, 01:55 PM   #3
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
in oUF_Nivaya.lua :
Code:
	self.Power:SetPoint("LEFT")
	self.Power:SetPoint("RIGHT")
	self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -1)
My instincts tell me that the "self.Health" beside "TOP" might have something to do with anchoring the mana to health. I mentioned in my first post something I tried but I actually did notice this section before and I tried out this:
Code:
	self.Power:SetPoint("LEFT", 5)
	self.Power:SetPoint("RIGHT")
	self.Power:SetPoint("TOP", 5, "BOTTOM", 0, -1)
Just to see what happened but nothing did. Any Suggestions?
  Reply With Quote
12-26-09, 01:59 PM   #4
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
I found another cluster of line very similar in the file init_and_config.lua :
Code:
 self.Power:SetPoint("LEFT", self.Portrait, "RIGHT", 2, 0)
 self.Power:SetPoint("RIGHT")
 self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -1)
This was under :
Code:
function oUF_Nivaya:UpdatePortrait(self, unit)
And was also surrounded by SetPoints for Health as well, and also a lot of if's and elseif's. I didn't fiddle with this because I do not plan to have a portrait involved, so didn't think this would apply.
  Reply With Quote
12-26-09, 02:00 PM   #5
Praesagus
A Theradrim Guardian
 
Praesagus's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 64
I'm probably way off but the last setpoint

Code:
self.Power:SetPoint("TOP", self.Health, "BOTTOM", 0, -1)
the 0 is the x offset and the -1 is the y offset. Try messing with the offset's only.
  Reply With Quote
12-26-09, 02:02 PM   #6
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
http://wowprogramming.com/docs/widgets/Region/SetPoint -- Might want to read this.
__________________
「貴方は1人じゃないよ」
  Reply With Quote
12-26-09, 04:48 PM   #7
eddiemars
A Cyclonian
 
eddiemars's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 43
Thanks a lot, that link is great. There is so many pages about lua and WoW I found it nigh impossible to find a really good site like this via google. This is helpful for more than just info about the specific topic for me thanks.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » X and Y positions of Health and Mana within a frame.

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