private void LoadFont(string fontName) { m_LoadedFlag.Add(string.Format("Font.{0}", fontName), false); GameEntry.Resource.LoadAsset(AssetUtility.GetFontAsset(fontName), Constant.AssetPriority.FontAsset, new LoadAssetCallbacks( (assetName, asset, duration, userData) => { Font font = (Font)asset; m_LoadedFlag[string.Format("Font.{0}", fontName)] = true; FGUIForm.SetMainFont(font); FontManager.RegisterFont(FontManager.GetFont(fontName, font), fontName); if (UIConfig.defaultFont == "") { UIConfig.defaultFont += fontName; } else { UIConfig.defaultFont += "," + fontName; } Log.Info("Load font '{0}' OK.", UIConfig.defaultFont); }, (assetName, status, errorMessage, userData) => { Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, errorMessage); })); }
public static void CloseUIForm(this UIComponent uiComponent, FGUIForm uiForm) { uiComponent.CloseUIForm(uiForm.UIForm); }