Hello, I'm pretty new to writing AddOns so I'm hoping someone might be able to help me. I'm trying to make some text appear at the top of my minimap that tells me the zone I'm in, and colors depending if I'm in friendly(green), neutral(yellow), or hostile(red) territory. The reason I'm trying to do this is because somewhere in MazzleUI it hides the minimap text and I want to make it myself. Anyway, what I need to know is this:
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Frame name="MinimapTextFrame" parent="UIParent" hidden="false" movable="false">
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parent_ZoneText" inherits="GameFontNormal" text="?????">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="Minimap" relativePoint="TOPLEFT">
<Offset x="?" y="?"/>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
</Ui>
This is my XML script. I have question marks in the text for <FontString> because I don't know what to put there. I can't put a variable there, so I figured I'd have to set the text in the .lua file. In the WoW UI Designer it set the text of the label like this
label = getglobal("TutorialProjectForm".."CountLabel".."Label")
label:SetText("......")
So, my first question is, how would I use the getglobal function to assign my <FontString> text to a variable then change the text using SetText()?
My second question is how would I then set the color of it? I'm especially clueless when it comes to the colors, like r=0.5, etc. Hopefully someone with more experience could help me out.
Also if there's a list of all the Lua functions and what they do somewhere, a link would be greatly appreciated.
Thanks in advance.