home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / GUI / Classes / GUIFont.uc < prev    next >
Text File  |  2003-06-30  |  2KB  |  49 lines

  1. // ====================================================================
  2. //  Class:  GUI.GUIFont
  3. // 
  4. //  GUIFont is used to give a single pipeline for handling fonts at
  5. //    multiple resolutions while at the same time supporting resolution
  6. //    independant fonts (for browsers, etc). 
  7. //
  8. //  Written by Joe Wilcox
  9. //  (c) 2002, Epic Games, Inc.  All Rights Reserved
  10. // ====================================================================
  11.  
  12. class GUIFont extends GUI
  13.     Native;
  14.  
  15. var(Menu) string        KeyName;
  16. var(Menu) bool            bFixedSize;        // If true, only FontArray[0] is used
  17. var(Menu) localized array<String>    FontArrayNames;    // Holds all of the names of the fonts         
  18. var(Menu) array<Font>    FontArrayFonts;    // Holds all of the fonts
  19.  
  20. native event Font GetFont(int XRes);            // Returns the font for the current resolution
  21.  
  22. // Dynamically load font.
  23. static function Font LoadFontStatic(int i)
  24. {
  25.     if( i>=default.FontArrayFonts.Length || default.FontArrayFonts[i] == None )
  26.     {
  27.         default.FontArrayFonts[i] = Font(DynamicLoadObject(default.FontArrayNames[i], class'Font'));
  28.         if( default.FontArrayFonts[i] == None )
  29.             Log("Warning: "$default.Class$" Couldn't dynamically load font "$default.FontArrayNames[i]);
  30.     }
  31.  
  32.     return default.FontArrayFonts[i];
  33. }
  34.  
  35. function Font LoadFont(int i)
  36. {
  37.     if( i>=FontArrayFonts.Length || FontArrayFonts[i] == None )
  38.     {
  39.         FontArrayFonts[i] = Font(DynamicLoadObject(FontArrayNames[i], class'Font'));
  40.         if( FontArrayFonts[i] == None )
  41.             Log("Warning: "$Self$" Couldn't dynamically load font "$FontArrayNames[i]);
  42.     }
  43.     return FontArrayFonts[i];
  44. }
  45.  
  46. defaultproperties
  47. {
  48. }
  49.