public override void OnPaintScene2DView(CSharpFramework.Controls.Scene2DView view, System.Windows.Forms.PaintEventArgs e) { _pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; Point p1 = view.Transform(new Vector3F(this._selection.WorldSpaceExtent.X1, this._selection.WorldSpaceExtent.Y1, this._selection.DisplayZ)); Point p2 = view.Transform(new Vector3F(this._selection.WorldSpaceExtent.X2, this._selection.WorldSpaceExtent.Y2, this._selection.DisplayZ)); Rectangle r = view.MakeValidRect(p1, p2); e.Graphics.DrawRectangle(_pen, r); }
public override void OnPaintScene2DView(CSharpFramework.Controls.Scene2DView view, PaintEventArgs e) { base.OnPaintScene2DView(view, e); Vector3F shapePos = Position; Point point = view.Transform(shapePos); Rectangle rectToDraw = new Rectangle(point, new Size(30, 30)); e.Graphics.FillRectangle(Brushes.DarkGreen, rectToDraw); Pen pen = new Pen(Color.LightGreen, 1); e.Graphics.DrawRectangle(pen, rectToDraw); }
public override void OnPaintScene2DView(CSharpFramework.Controls.Scene2DView view, System.Windows.Forms.PaintEventArgs e) { base.OnPaintScene2DView(view, e); BoundingBox absBox = this.AbsoluteBoundingBox; Point p1 = view.Transform(absBox.vMin); Point p2 = view.Transform(absBox.vMax); Rectangle rect = view.MakeValidRect(p1, p2); zoneBrush.Color = Color.FromArgb(120, _previewColor.R, _previewColor.G, _previewColor.B); zonePen.Color = Color.FromArgb(255, _previewColor.R, _previewColor.G, _previewColor.B); e.Graphics.FillRectangle(zoneBrush, rect); e.Graphics.DrawRectangle(zonePen, rect); }
public override float GetScene2DRenderingSortingKey(CSharpFramework.Controls.Scene2DView view) { return(100000000000.0f); // render last }
public override float GetScene2DRenderingSortingKey(CSharpFramework.Controls.Scene2DView view) { return(AbsoluteBoundingBox.Z1); // bottom of box }
public override void OnPaintScene2DView(CSharpFramework.Controls.Scene2DView view, PaintEventArgs e) { if (SectorVisibleMask == 0) { return; } if (_bViewBitmapDirty) { UpdatePreviewBitmap(); _bViewBitmapDirty = false; } if (_2dViewBitmap != null) { BoundingBox sectorBBox = SectorExtent; Point p1 = view.Transform(sectorBBox.vMin); Point p2 = view.Transform(sectorBBox.vMax); Rectangle dst = view.MakeValidRect(p1, p2); // darker images for unloaded sectors _2dViewAttr.SetGamma(CurrentStatus == SectorAction.Reloaded ? 1.0f : 4.0f); e.Graphics.DrawImage(_2dViewBitmap, dst, 0, _2dViewBitmapResolution - 1, _2dViewBitmapResolution, -_2dViewBitmapResolution, GraphicsUnit.Pixel, _2dViewAttr); // flip vertically // inside selection? then overlay with color if (view.TouchesSelectionMarquee(sectorBBox)) { e.Graphics.FillRectangle(_selectionFill, dst); } _pen.Color = Color.Turquoise; if (CurrentStatus == SectorAction.Modified) { _pen.Color = Color.Orange; } if (CurrentStatus == SectorAction.Reloaded) { _pen.Color = Color.Magenta; } dst.Location = new Point(p1.X, p2.Y); dst.Size = new Size(p2.X - p1.X, p1.Y - p2.Y); e.Graphics.DrawRectangle(_pen, dst); //Display terrain status // Locked, Modified, Unmodified if (_ownerTerrain.EngineTerrain.GetSectorNetworkLock(_iSectorX, _iSectorY)) { dst.Width = 10; dst.Height = 10; _pen.Color = Color.Red; e.Graphics.DrawRectangle(_pen, dst); } if (_ownerTerrain.EngineTerrain.GetSectorOwnsLock(_iSectorX, _iSectorY)) { dst.Width = 10; dst.Height = 10; _pen.Color = Color.Green; e.Graphics.DrawRectangle(_pen, dst); } } else { base.OnPaintScene2DView(view, e); } if (FilterCollisionCat != null && FilterCollisionCat.Enabled) { if (SectorCollisionMask > 0) { BoundingBox sectorBBox = SectorExtent; Point p1 = view.Transform(sectorBBox.vMin); Point p2 = view.Transform(sectorBBox.vMax); Rectangle dst = view.MakeValidRect(p1, p2); e.Graphics.DrawString("C", _font, Brushes.White, dst); } } }