예제 #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; }
     }
 }