Esempio n. 1
0
        public void Draw(ITexture texture, Rect rect, Color color)
        {
            var texture2DAdapter = texture as Texture2DAdapter;

            if (texture2DAdapter != null && texture2DAdapter.Value != null)
            {
                var rectangle = new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Width, (int)rect.Height);
                this.spriteBatch.Draw(
                    texture2DAdapter.Value,
                    rectangle,
                    new Microsoft.Xna.Framework.Color(color.R, color.G, color.B, color.A));
            }
        }
Esempio n. 2
0
        public void DrawString(ISpriteFont spriteFont, string text, Point position, Color color)
        {
            var spriteFontAdapter = spriteFont as SpriteFontAdapter;

            if (spriteFontAdapter != null && spriteFontAdapter.Value != null)
            {
                this.spriteBatch.DrawString(
                    spriteFontAdapter.Value,
                    text ?? string.Empty,
                    new Vector2((int)position.X, (int)position.Y),
                    new Microsoft.Xna.Framework.Color(color.R, color.G, color.B, color.A));
            }
        }
Esempio n. 3
0
 public void Draw(ITexture texture, Rect rect, Color color)
 {
     var texture2DAdapter = texture as Texture2DAdapter;
     if (texture2DAdapter != null && texture2DAdapter.Value != null)
     {
         var rectangle = new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Width, (int)rect.Height);
         this.spriteBatch.Draw(
             texture2DAdapter.Value, 
             rectangle, 
             new Microsoft.Xna.Framework.Color(color.R, color.G, color.B, color.A));
     }
 }
Esempio n. 4
0
 public void DrawString(ISpriteFont spriteFont, string text, Point position, Color color)
 {
     var spriteFontAdapter = spriteFont as SpriteFontAdapter;
     if (spriteFontAdapter != null && spriteFontAdapter.Value != null)
     {
         this.spriteBatch.DrawString(
             spriteFontAdapter.Value, 
             text ?? string.Empty, 
             new Vector2((int)position.X, (int)position.Y),
             new Microsoft.Xna.Framework.Color(color.R, color.G, color.B, color.A));
     }
 }