コード例 #1
0
ファイル: Sprite.cs プロジェクト: tim-ings/Dominion
        /// <summary>
        /// Draws the sprite
        /// </summary>
        /// <param name="sb"></param>
        /// <param name="dest"></param>
        /// <param name="source"></param>
        /// <param name="color"></param>
        /// <param name="scale"></param>
        /// <param name="origin"></param>
        /// <param name="rotation"></param>
        public void Draw(SpriteBatch sb, Rectangle dest, Rectangle?source = null, Color?color = null, Vector2?scale = null, Vector2?origin = null, float rotation = 0f)
        {
            // setup values
            if (color == null)
            {
                color = Color.White;
            }

            switch (spriteType)
            {
            case SpriteType.Atlas:
                Atlas.Draw(sb, AtlasKey, dest, source, color, scale, origin, rotation);
                break;

            case SpriteType.Texture:
                if (source == null)
                {
                    source = Texture.Bounds;
                }
                sb.Draw(Texture, null, dest, source, origin, rotation, scale, color);
                break;
            }
        }
コード例 #2
0
 public void Draw(RenderWindow window)
 {
     Atlas.Draw(window);
 }