Esempio n. 1
0
 /// <summary>
 /// Remove drawable
 /// </summary>
 /// <param name="toRemove"></param>
 public void RemoveDrawable(DrawData toRemove)
 {
     _toDraw.Remove(toRemove);
 }
Esempio n. 2
0
        /// <summary>
        /// Draw DrawData
        /// </summary>
        /// <param name="drawable"></param>
        protected virtual void drawElement(DrawData drawable)
        {
            // Offset whatever is drawn based on camera position
            Rectangle worldDest = drawable.Destination;
            worldDest.X -= (int)_camera2d.Pos.X;
            worldDest.Y -= (int)_camera2d.Pos.Y;

            _spriteBatch.Draw(drawable.Art, worldDest, drawable.Source, Color.White);
        }
Esempio n. 3
0
 /// <summary>
 /// Add drawable
 /// </summary>
 /// <param name="drawable"></param>
 public void AddDrawable(DrawData drawable)
 {
     if (drawable == null || _toDraw.Contains(drawable))
     {
         Console.WriteLine("Drawable null or already added");
         return;
     }
     _toDraw.Add(drawable);
 }