示例#1
0
文件: Option.cs 项目: kjin/TubeRacer
 public override void Initialize(AssetManager assets, string themeName)
 {
     TextDictionary assetDictionary = new TextDictionary(assets.GetText("option"));
     fontFace = assets.GetFont(assetDictionary.LookupString(themeName, "fontFace"));
     try { fontColor = new Color(assetDictionary.LookupVector4(themeName, "fontColor")); }
     catch { fontColor = new Color(assetDictionary.LookupVector3(themeName, "fontColor")); }
     dimensions = fontFace.MeasureString(text) + new Vector2(0, -5);
 }
示例#2
0
文件: Cursor.cs 项目: kjin/TubeRacer
        public override void Initialize(List<Option> options, AssetManager assets, string themeName)
        {
            TextDictionary assetDictionary = new TextDictionary(assets.GetText("cursor"));
            base.Initialize(options, assets, themeName);

            graphic = assets.GetTexture(assetDictionary.LookupString(themeName, "graphic"));
            try { color = new Color(assetDictionary.LookupVector4(themeName, "color")); }
            catch { color = new Color(assetDictionary.LookupVector3(themeName, "color")); }
            offset = assetDictionary.LookupVector2(themeName, "offset");
            //optional
            bool anchorParseSuccess = Enum.TryParse<Anchor>(assetDictionary.LookupString(themeName, "anchor"), out anchor);
            if (!anchorParseSuccess)
                anchor = Anchor.TopLeft;
            try { smoothness = assetDictionary.LookupSingle(themeName, "smoothness"); }
            catch { smoothness = 0f; }
        }
示例#3
0
文件: Option.cs 项目: kjin/TubeRacer
 public override void Initialize(AssetManager assets, string themeName)
 {
     TextDictionary assetDictionary = new TextDictionary(assets.GetText("option"));
     try { textureColor = new Color(assetDictionary.LookupVector4(themeName, "textureColor")); }
     catch
     {
         try { textureColor = new Color(assetDictionary.LookupVector3(themeName, "textureColor")); }
         catch { textureColor = Color.White; }
     }
 }