/// <inheritdoc />
 /// <summary>
 /// If the action of selecting scene nodes at the scene is active 
 /// we will draw selecting rectangle.
 /// </summary>
 public override void Draw(SceneBatch sceneBatch)
 {
     // If the action of selecting objects at the scene is active
     // we will draw selecting rectangle.
     if (SelectingNodes)
     {
         sceneBatch.ApplyBasicEffect();
         sceneBatch.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, drawSelectingRectangle, 0, 2);
     }
 }
示例#2
0
        /// <summary>
        /// Initializes <see cref="SceneScreen"/>.
        /// </summary>
        protected override void Initialize()
        {
            _nodes = new SceneNodesList(this);

            AllowDrop = true;

            font       = Content.Load <SpriteFont>("EditorFont");
            updateIcon = Content.Load <Texture2D>("UpdateIcon");

            MouseMove  += new MouseEventHandler(SceneScreenControl_MouseMove);
            MouseUp    += new MouseEventHandler(SceneScreenControl_MouseUp);
            MouseDown  += new MouseEventHandler(SceneScreenControl_MouseDown);
            MouseWheel += new MouseEventHandler(SceneScreenControl_MouseWheel);

            KeyDown  += new KeyEventHandler(SceneScreenControl_KeyDown);
            KeyUp    += new KeyEventHandler(SceneScreenControl_KeyUp);
            KeyPress += new KeyPressEventHandler(SceneScreenControl_KeyPress);

            DragEnter += new DragEventHandler(SceneScreen_DragEnter);
            DragDrop  += new DragEventHandler(SceneScreenControl_DragDrop);

            Resize += new EventHandler(SceneScreen_Resize);

            // set moving state as default state
            State = new MovingNodesSceneState()
            {
                Screen = this
            };

            sceneBatch = new SceneBatch(GraphicsDevice);

            RenderCircle.Init(GraphicsDevice, Content);

            SceneScreen_Resize(null, null);

            Position = new Vector2();
            Zoom     = 100;
        }
 /// <summary>
 /// Draws the shapes of the scene node, if any.
 /// </summary>
 /// <param name="sceneBatch">The scene batch for drawing the shapes of the scene node.</param>
 public abstract void DrawShapes(SceneBatch sceneBatch);
 /// <summary>
 /// Draws the scene node.
 /// </summary>
 /// <param name="sceneBatch">The scene batch for drawing the scene node.</param>
 public abstract void Draw(SceneBatch sceneBatch);
 /// <summary>
 /// Called when the <see cref="SceneScreen"/> is drawing. Override this method with state-specific drawing code.
 /// </summary>
 /// <param name="sceneBatch">The scene batch for drawing the state.</param>
 public virtual void Draw(SceneBatch sceneBatch)
 {
 }