protected override void Initialize() { // Hook the idle event to constantly redraw our animation. Application.Idle += delegate { Invalidate(); }; this.SizeChanged += new System.EventHandler(this.BattleMapViewerControl_SizeChanged); Timer = new System.Diagnostics.Stopwatch(); Mouse.WindowHandle = this.Handle; content = new ContentManager(Services, "Content"); g = new CustomSpriteBatch(new SpriteBatch(GraphicsDevice)); Helper = new MapScriptGUIHelper(); Helper.Load(content, g, GraphicsDevice); sprPixel = content.Load <Texture2D>("Pixel"); this.sclMapWidth = new HScrollBar(); this.sclMapHeight = new VScrollBar(); // // sclMapWidth // this.sclMapWidth.Location = new System.Drawing.Point(0, 506); this.sclMapWidth.Name = "sclMapWidth"; this.sclMapWidth.Size = new System.Drawing.Size(650, 17); this.sclMapWidth.TabIndex = 3; this.sclMapWidth.Scroll += new ScrollEventHandler(this.sclMapWidth_Scroll); // // sclMapHeight // this.sclMapHeight.Location = new System.Drawing.Point(650, 0); this.sclMapHeight.Name = "sclMapHeight"; this.sclMapHeight.Size = new System.Drawing.Size(17, 506); this.sclMapHeight.TabIndex = 4; this.sclMapHeight.Scroll += new ScrollEventHandler(this.sclMapHeight_Scroll); Controls.Add(this.sclMapWidth); Controls.Add(this.sclMapHeight); this.cmsScriptMenu = new ContextMenuStrip(); this.tsmDeleteScript = new ToolStripMenuItem(); // // cmsScriptMenu // this.cmsScriptMenu.Items.AddRange(new ToolStripItem[] { this.tsmDeleteScript }); this.cmsScriptMenu.Name = "cmsScriptMenu"; this.cmsScriptMenu.Size = new System.Drawing.Size(141, 26); // // tsmDeleteScript // this.tsmDeleteScript.Name = "tsmDeleteScript"; this.tsmDeleteScript.Size = new System.Drawing.Size(140, 22); this.tsmDeleteScript.Text = "Delete Script"; this.tsmDeleteScript.Click += tsmDeleteScript_Click; }
protected override void Initialize() { // Hook the idle event to constantly redraw our animation. Application.Idle += delegate { Invalidate(); }; Mouse.WindowHandle = this.Handle; Camera = new Rectangle(0, 0, Width, Height); content = new ContentManager(Services, "Content"); sprPixel = content.Load <Texture2D>("Pixel"); SelectedPolygonTriangle = new PolygonTriangle(); DisplayOtherLayers = true; sprRedTexture = content.Load <Texture2D>("Pixel"); sprRedTexture.SetData <Color>(new Color[] { Color.FromNonPremultiplied(255, 0, 0, 120) }); if (PolygonEffect == null) { PolygonEffect = new BasicEffect(GraphicsDevice); PolygonEffect.VertexColorEnabled = true; PolygonEffect.TextureEnabled = true; PolygonEffect.World = Matrix.Identity; PolygonEffect.View = Matrix.Identity; PolygonEffect.Texture = sprRedTexture; } g = new CustomSpriteBatch(new SpriteBatch(GraphicsDevice)); Helper = new MapScriptGUIHelper(); Helper.Load(content, g, GraphicsDevice); this.cmsScriptMenu = new ContextMenuStrip(); this.tsmDeleteScript = new ToolStripMenuItem(); // // cmsScriptMenu // this.cmsScriptMenu.Items.AddRange(new ToolStripItem[] { this.tsmDeleteScript }); this.cmsScriptMenu.Name = "cmsScriptMenu"; this.cmsScriptMenu.Size = new System.Drawing.Size(141, 26); // // tsmDeleteScript // this.tsmDeleteScript.Name = "tsmDeleteScript"; this.tsmDeleteScript.Size = new System.Drawing.Size(140, 22); this.tsmDeleteScript.Text = "Delete Script"; this.tsmDeleteScript.Click += tsmDeleteScript_Click; }