Пример #1
0
        // outdated
        public void RenderText(IRenderTarget destination, Point position, string text, int characterSize, Color color,
            bool bold, bool italic, bool underline)
        {
            UpdateCachedFont(characterSize);
            Texture textTexture = new Texture(cachedFont.Render(text, global::System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B)));

            destination.Draw(textTexture, position);
        }
Пример #2
0
        public ITexture LoadTexture(string filePath)
        {
            SdlDotNet.Graphics.Surface surface = new SdlDotNet.Graphics.Surface(filePath);//.Convert(SdlDotNet.Graphics.Video.Screen);
            surface.Alpha = 255;
            surface.AlphaBlending = true;
            surface.TransparentColor = global::System.Drawing.Color.FromArgb(0, 255, 255, 255);
            surface.Transparent = true;
            //surface.Transparent = true;

            Texture texture = new Texture(surface);

            return texture;
        }
Пример #3
0
 public RenderTexture(Surface surface)
     : base(surface)
 {
     texture = new Texture(surface);
 }
Пример #4
0
        public ITexture LoadTexture(byte[] data)
        {
            SdlDotNet.Graphics.Surface surface = new Surface(data).Convert();

            surface.Alpha = 255;
            surface.AlphaBlending = true;

            Texture texture = new Texture(surface);

            return texture;
        }