/// <inheritdoc /> protected override void Dispose(bool disposing) { if (disposing) { Children.Clear(); _children = null; } }
/// <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> /// Initializes the scene node. Called after the scene node is used at the <see cref="SceneScreen"/>. /// </summary> public virtual void Initialize() { _children = new SceneNodesList(SceneControl); }