Пример #1
0
        public static void Draw(string text, Rectangle rec, Rectangle?source, Color color, float rotation, Vector2 origin, SpriteEffects effect, float depth)
        {
            var texture = new PlatformTexture()
            {
                Name = text
            };

            Draw(texture, rec, source, color, rotation, origin, effect, depth);
        }
Пример #2
0
 public static void Draw(PlatformTexture platformTexture, Vector2 pos, Rectangle?source, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effect, float depth)
 {
     if (platformTexture != null && !String.IsNullOrEmpty(platformTexture.Name))
     {
         Texture2D tex = LoadTexture(platformTexture.Name);
         if (tex != null && !tex.IsDisposed)
         {
             Session.Current.SpriteBatch.Draw(tex, pos, source, color, rotation, origin, scale, effect, depth);
         }
     }
 }
Пример #3
0
 public static void Draw(PlatformTexture platformTexture, Rectangle rec, Rectangle?source, Color color, float rotation, Vector2 origin, SpriteEffects effect, float depth)
 {
     if (platformTexture != null && !String.IsNullOrEmpty(platformTexture.Name))
     {
         Texture2D tex = LoadTexture(platformTexture.Name);
         if (tex != null && !tex.IsDisposed)
         {
             if (Scale != Vector2.One)
             {
                 rec = new Rectangle(Convert.ToInt16(rec.X * Scale.X), Convert.ToInt16(rec.Y * Scale.Y), Convert.ToInt16(rec.Width * Scale.X), Convert.ToInt16(rec.Height * Scale.Y));
             }
             Session.Current.SpriteBatch.Draw(tex, rec, source, color, rotation, origin, effect, depth);
         }
     }
 }