Default Casting Bar
I have been able to put together simple addons for my unit frames and minimap by looking at the code from other addons. I haven't been able to find code that works for moving the casting bar. I found this:
CastingBarFrame:ClearAllPoints() CastingBarFrame:SetPoint("CENTER", 0, 0) but it doesn't do anything. Can someone help? |
Without a RelativePoint specified, SetPoint anchors to it's current parent
Maybe SetPoint("CENTER", UIParent) |
/me waves at Vranx
Welcome back! :) Since the SetPoint call doesn't reference a frame to anchor it to, it will anchor the casting bar to the center of its parent. I don't remember what the parent is (though I would assume UIParent). Just in case, try this: CastingBarFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) |
It gets roped into the PlayerFrame with the where depending on class and what is showing:
Lua Code:
|
I tried both of your codes and it didnt move. I must not be coding it right. I appreciate your help. I will try to figure it out tomorrow.
|
Just tried
/run CastingBarFrame:ClearAllPoints(); CastingBarFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 0) Edit and after a /reload, /run CastingBarFrame:ClearAllPoints(); CastingBarFrame:SetPoint("CENTER", UIParent) Both worked. It might be a matter of when you're running your code. If it's during ADDON_LOADED or just as your .lua files are loading, Blizzard may be resetting the bar later in the load process like OnEvent for the Totem frame. PlayerFrame_AdjustAttachments() gets called from various places depending on class. |
Lua Code:
|
I figured it out. It moves the castbar that is under the unitframe, not the default castbar that is in the middle of the screen. I just had to switch the option. Thanks all.
|
All times are GMT -6. The time now is 03:45 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI