Esempio n. 1
0
        public TextConfig(
            Asset fontAsset, Dictionary<char, Tuple<Vector2, Vector2>> charToSprite,
            Color fontBaseColor = default(Color), float spaceWidth = 44f, float spaceHeight = 31f,
            float padding = float.MinValue, Func<float, float> paddingFunc = null, bool staticColor = true)
        {
            if (fontBaseColor == default(Color))
                fontBaseColor = Color.Black;
            if (paddingFunc == null && padding == float.MinValue)
                padding = 0;
            FontAsset = fontAsset;
            FontTexture = new Texture(fontAsset.FileName);
            CharToSprite = charToSprite;
            FontBaseColor = fontBaseColor;
            SpaceWidth = spaceWidth;
            SpaceHeight = spaceHeight;
            Padding = padding;
            PaddingFunc = paddingFunc;
            StaticColor = staticColor;

            if (Default == null)
                Default = this;
        }
Esempio n. 2
0
        /*
		 * 
		 * Asset's management
		 * 
		 */

        public void LoadAsset(string name, Asset asset)
        {
            asset.Engine = this;
            Assets[name] = asset;
        }