1. So I have a frame with this button on it:

            <Button name="AttendanceButton" inherits="UIPanelButtonTemplate" text="Attendance">
                <Size>
                    <AbsDimension x="60" y="10"/>
                </Size>
                <Anchors>
                    <Anchor point="TOPLEFT">
                        <Offset x="10" y="-10"/>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnClick>AttendanceButton_OnClick();</OnClick>
                </Scripts>
            </Button>
    

    I would like to make the text fit on the button--right now, it's too big.

    How do I change the size of the text on a button created from the UIPanelButtonTemplate?

    Thanks.

  2. For that matter, is it possible to change the color of the text as well? I want white text instead of gold text on this button.

    (p.s. I have figured out how to use FontStrings in other places, but if I somehow have to use a FontString to change the text on the button, I can't seem to be able to figure out how.)

    Thanks again.

  3. The answer lies (as almost always) in the FrameXML definition. If you look at UIPanelButtonTemplate in UIPanelTemplates.xml you'll see precisely how the button text font string is defined, along with a number of other sub-elements of the templated button. You should be able to define whatever you'd like.

    You could also do this all after the fact, in Lua by setting the font object using Button:SetNormalFontObject().

    As for the size of the button, you can control all of that.. but you should always make the button large enough to fit your text. You can find this out using :GetStringWidth() and then adding some for the artwork/borders.

    Hope that helps!

  4. I'm going to give it a shot at answering intelligently, but I'm pretty sure I'm still not looking at this correctly. Here goes. So, I've looked through the UIPanelTemplates.xml code and found this:

         <Button name="UIPanelButtonTemplate" virtual="true">
            <ButtonText name="$parentText"/>
            <NormalFont style="GameFontNormal"/>
            <HighlightFont style="GameFontHighlight"/>
            <DisabledFont style="GameFontDisable"/>
            <NormalTexture inherits="UIPanelButtonUpTexture"/>
            <PushedTexture inherits="UIPanelButtonDownTexture"/>
            <DisabledTexture inherits="UIPanelButtonDisabledTexture"/>
            <HighlightTexture inherits="UIPanelButtonHighlightTexture"/>
        </Button>
    

    It seems to me that the text styles (for the 3 different button states) are using predefined "styles". I also found, in later code, some other styles. Looking at NormalFont, it uses GameFontNormal text style.

    When I look lower in the code I see other buttons (with only 1 state--UICheckButtonTemplate for example) redefining its text layer in the <Layers><Layer..><FontString...> code.

    What I can't figure out is:

    1. How do I do that with the button I create from UIButtonPanelTemplate?
    2. If I can change it within my own UIButtonPanelTemplate based button, do I have to do it for all 3 states?

    Now, if I do it in Lua after the fact (which I would rather not do in this case), is the "font object" the same as a "FontString"?

    I completely understand the "teach a man to fish" concept, but any chance you could throw me some bait on this one?

    Thanks so much for your help.

  5. Not sure what happened in that post. Sorry for the messy post. I don't get it.

    edit - I fixed the code block above. Please ignore this single post.

  6. OK!

    So I think I'm close. In my XML file, before the <Script> tag I did this:

                  <Font name="MyGameFontNormalSmall" font="Fonts\FRIZQT__.TTF" virtual="true"> 
                    <FontHeight>
                        <AbsValue val="6" />
                    </FontHeight>
                 </Font>     
    

    and then I used this in my button definition:

                    <NormalFont style="MyGameFontNormalSmall" />
    

    and it worked!

    However, when I did this:

        <Font name="MyGameFontNormalSmall" inherits="GameFontNormalSmall" virtual="true"> 
            <FontHeight>
                <AbsValue val="6" />
            </FontHeight>
        </Font>
    

    it didn't work.

    Can someone tell me why the inherited font won't work?

    Thanks!

  7. I'm not sure.. are there any erros in your Logs\FrameXML.log?