This site makes extensive use of JavaScript.
Please
enable JavaScript
in your browser.
Classic Theme
Thottbot Theme
Button:SetTextColor 3.0
Post Reply
Return to board index
Post by
Wildhorn
Ok, because Blizzard thought it would be fun to ^&*! me off, they removed couple button editing tool in patch 3.0
So now instead of button:SetTextColor to change the color I am supposed to use:
button:SetNormalFontObject("GameFontHighlight");
local font = button:GetNormalFontObject();
font:SetTextColor(1, 0.5, 0.25, 1.0);
button:SetNormalFontObject(font);
button being replaced by the name of my button.
The problem is... when I do it, it change like 90% of all the text from all my frames ingame (loot,bag,token,skill, etc) BUT my damn button. So wtf?
I seem unable to find fix to it
Post by
pelf
The way I'd go about trying to find out how to do that is to find another addon that does what you're trying to do and filch its code. I suppose you would've thought of that, though :).
Post by
Wildhorn
yes and it seem addon that change button color are rather rare.
Post by
pelf
yes and it seem addon that change button color are rather rare.
Perhaps there's another(/better?) way to do what you're trying to do? Speaking in a UI design philosophical sense...
What is it you're trying to represent by the changing of a button's color?
Post by
Wildhorn
I want to change the color based on your agro %.
Post by
pelf
Mmm, so if I'm seeing this correctly, the inside of that frame you're using to display the numbers is actually a button?
Would it maybe be easier for you to just put a click handler on a normal frame with text in it than trying to use a button in there? If you do that, you could even display the threat as a sort of grayed out progress bar inside the frame that moves left to right inside the border. That might be neat.
Post by
Wildhorn
I have very basic knowledge of the display stuff (XML). What should I change in the following to make it a normal frame (i want it to keep the same look, aka a small grey/black box) and will it affect some of my functions?
<Ui xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns="
http://www.blizzard.com/wow/ui/">
<Script file="Frame.lua" />
<Button name="WildDPSFrame" parent ="UIParent" enableMouse="true" movable="true" frameStrata="LOW">
<Size x="300" y="60" />
<Anchors>
<Anchor point="TOP" relativePoint="BOTTOM" relativeTo="Minimap">
<Offset x="0" y="-10" />
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
<BackgroundInsets>
<AbsInset left="11" right="12" top="12" bottom="11" />
</BackgroundInsets>
<TileSize>
<AbsValue val="32" />
</TileSize>
<EdgeSize>
<AbsValue val="32" />
</EdgeSize>
</Backdrop>
<Layers>
<Layer level="OVERLAY">
<Fontstring name="$parentText" inherits="GameFontNormalSmall" justifyH="Center" setAllPoints="true" text="WildDPS" />
</Layer>
</Layers>
<Scripts>
<OnLoad>
WildDPS_OnLoad(self)
</OnLoad>
<OnEvent>
WildDPS_OnEvent(self, event, ...)
</OnEvent>
<OnClick>
WildDPS_Text()
</OnClick>
<OnDragStart>
self:StartMoving()
</OnDragStart>
<OnDragStop>
self:StopMovingOrSizing()
</OnDragStop>
</Scripts>
</Button>
</Ui>
Post by
pelf
Heh, I was hoping you might know what the WoW version of what I was suggesting would be. My language strength lies in C++/C# ... I don't actually know how to do what I suggested in WoW Lua/Frame XML.
Trying to think of something simple you might be able to look at ... how about this one:
http://www.wowinterface.com/downloads/info11429-CooldownWatch.html
I haven't looked at the code myself, but s/he says it's lightweight and clean. Maybe something in the way the frames are set up in there will help.
Post by
Wildhorn
hehe, my strenght is into C++ and C# too :) I decided to learn wow stuff for the winter veil :)
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.