Пример #1
0
        public void SetSprite(List <System.Drawing.Bitmap> bitmaps)
        {
            if (bitmaps.Count > 0)
            {
                // Clear current list of frames
                foreach (Texture2D texture in spriteFrames)
                {
                    // Delete texture
                }
                spriteFrames.Clear();

                // Add all frames
                foreach (System.Drawing.Bitmap bitmap in bitmaps)
                {
                    Texture2D tex = TextureSprite.GetTexture(GraphicsDevice, bitmap);
                    spriteFrames.Add(tex);
                }
            }
        }
Пример #2
0
 public TextureSprite(GraphicsDevice graphics, Bitmap bitmap)
 {
     Texture = TextureSprite.GetTexture(graphics, bitmap);
     CalculateCenter();
 }