Announcement

Collapse
No announcement yet.

UT2K4: Custom Font-Styles don't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UT2K4: Custom Font-Styles don't work

    I'm working on a Mod for UT2K4, making the GUI.
    I wanted to use some custom Fonts in custom GUI-Styles, und made it like shown in the tutorials from the UDN.
    But it doesn't work

    - made the Font-Texture-Pack (which works)
    - made my own GUI-Controller (from the UT2K4-GuiController)
    - registered my own Fonts to the Fontstack (starting where superclass left off)
    - registered my own guistyle (button...)

    Instead of using my new Font it uses the Standard-UT-Font.
    The style seems to work cause the textcolors are right, but the font is wrong.

    I can't look how the original styles are made, cause the classfiles are empty, there are only the keynames.
    Where can I find the code ?

    Any idea how I get my fonts working ?

    #2
    The class files are empty because you exported them from UEd. Download the source scripts from Epic (just google unrealscript source).

    Comment


      #3
      Source files can be found here:

      http://udn.epicgames.com/Two/PublicModResource

      MUCH better than anything UED will export for you.

      Comment


        #4
        Thanks
        Have looked through the original files, but haven't found new infos.

        Here's some code:
        All Files stored in the subdirectory "TUMGUI" in the Mod-Directory

        Code:
        class TUM_fntDefault extends GUIFont;
        defaultproperties
        {
            KeyName="TUM_DefaultFont"
        
            FontArrayNames(0)="TUM_Fonts2.AdSu10"
            FontArrayNames(1)="TUM_Fonts2.AdSu12"
            FontArrayNames(2)="TUM_Fonts2.AdSu14"
            FontArrayNames(3)="TUM_Fonts2.AdSu16"
            FontArrayNames(4)="TUM_Fonts2.AdSu18"
        }
        
        
        
        class TUM_STY_Button extends GUIStyles;
        DefaultProperties
        {
           KeyName="TUM_Button"
        
           FontNames(0)="TUM_DefaultFont"
           FontNames(1)="TUM_DefaultFont"
           FontNames(2)="TUM_DefaultFont"
           FontNames(3)="TUM_DefaultFont"
           FontNames(4)="TUM_DefaultFont"
        
        }
        
        
        
        class TUM_GUIController extends UT2K4GUIController;
        //...
        defaultproperties
        {
             Begin Object Class=TUMGUI.TUM_fntDefault Name=GUITUM_DefaultFont
             End Object
        
             FontStack(11)=GUITUM_DefaultFont
             FONT_NUM=12
        
             DefaultStyleNames(60)="TUMGUI.TUM_STY_MenuButton"
             DefaultStyleNames(61)="TUMGUI.TUM_STY_Button"
             STYLE_NUM=62
        
        //...
        }

        I've no Idea where's the problem...

        Comment


          #5
          Hmm, it looks good to me.

          What about your button? When you create it, are you setting StyleName="TUM_Button"?

          And are you SURE that the game is using YOUR GUIController?

          Otherwise it looks correct.

          Comment


            #6
            Yes the button has the right stylesetting
            And I am sure that my GuiController is used.

            made the entry in the TUM.ini:
            [Engine.Engine]
            GUIController=TUMGUI.TUM_GUIController

            How I wrote above the Style seems to work partially because the textcolors that are displayed are the same as I defined in the style.
            And I tested Backgroundimages for the button, they worked too.
            Only the Font is wrong. :bulb:

            Comment


              #7
              Check the log, it usually says something useful. Maybe your font is broken. Try using a default font (in your own font class) for testing purposes.

              Comment


                #8
                I feel you. I've done everyhing just like you've done, and it just keeps on using the default font. There's no documentation anywhere to check - the font stuff on UDN is good for creating the font and it works, but not when using it on GUIFonts/GUIStyles. Everything I could learn I've learn from the original uc code, but even so, it doesn't work. :/

                EDIT: Holy ****ing ****, I finally got it to work. Apparently, it's all related to some font size settings.. which are not mentioned on UDN and I don't understand what are they for. Anyways, after messing with GUI design mode, I was able to get it running.

                The lowdown: just do "FontNames(x)=..." on your style class naming all strings, from 0 to 14.. not from 0 to 4, not from 10 to 14 (like I found on some original ut2k4 .uc file).

                Comment

                Working...
                X