WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   X and Y positions of Health and Mana within a frame. (https://www.wowinterface.com/forums/showthread.php?t=29575)

eddiemars 12-26-09 12:02 AM

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?

wurmfood 12-26-09 12:14 AM

Look for code that uses the call "SetPoint" as that determines the relative location to another UI object (or to the UIParent).

eddiemars 12-26-09 01:55 PM

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?

eddiemars 12-26-09 01:59 PM

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.

Praesagus 12-26-09 02:00 PM

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.

haste 12-26-09 02:02 PM

http://wowprogramming.com/docs/widgets/Region/SetPoint -- Might want to read this.

eddiemars 12-26-09 04:48 PM

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.


All times are GMT -6. The time now is 10:10 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI