Ejemplo n.º 1
0
 //Завершение рисования фигуры
 private void canvas1_MouseUp(object sender, MouseEventArgs e)
 {
     if (shape != null)
     {
         shape.EndDraw(e.Location, this.canvas1);
         //Фигура дорисована - добавляет в коллекцию
         shapesForDrawing.Add(shape);
         shape = null;
     }
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        public virtual void Draw(GameTime gameTime)
        {
            lock (_drawableComponent)
            {
                _currentlyDrawableComponent.AddRange(_drawableComponent);
            }

            for (int i = 0; i < _currentlyDrawableComponent.Count; i++)
            {
                IDrawable drawable = _currentlyDrawableComponent[i];
                if (drawable.BeginDraw())
                {
                    drawable.Draw(gameTime);
                    drawable.EndDraw();
                }
            }

            _currentlyDrawableComponent.Clear();
        }