Ejemplo n.º 1
0
 /// <summary>
 /// Remove drawable
 /// </summary>
 /// <param name="toRemove"></param>
 public void RemoveDrawable(DrawData toRemove)
 {
     _toDraw.Remove(toRemove);
 }
Ejemplo 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);
        }
Ejemplo 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);
 }