protected override void OnPaint(GUI.PaintEventArgs e) { base.OnPaint(e); if (testSelection != testIndex) { testIndex = testSelection; StartTest(testIndex); ResetView(); m_ExampleNumberLabel.Text = "Ex " + (testIndex + 1).ToString("0") + "/" + testCount.ToString("0"); } Graphics graphics = e.Graphics; if (!DoubleBuffered) { graphics.FillRectangle(Color.FromArgb((graphics is SoftwareGraphics) ? 96 : 192, Color.Black), ClientRectangle); } else { graphics.Clear(Color.FromArgb((graphics is SoftwareGraphics) ? 96 : 192, Color.Black)); } graphics.SmoothingMode = entry.solidDraw ? SmoothingMode.None : SmoothingMode.AntiAlias; test.DebugView.m_Graphics = graphics; test.DebugView.m_Font = m_InfoFont; test.m_Scale = viewZoom * System.Math.Min(ClientWidth, ClientHeight) / 39; test.m_CenterX = ClientWidth / 2 + test.m_OffsetX * test.m_Scale; test.m_CenterY = ClientHeight / 2 + test.m_OffsetY * test.m_Scale; m_TPSCounter.Tick(); settings.Hz = m_TPSCounter.TPS; if (test != null) { test.TextLine = 30; test.Update(settings); } test.m_CenterX = ClientWidth / 2 + test.m_OffsetX * test.m_Scale; test.m_CenterY = ClientHeight / 2 + test.m_OffsetY * test.m_Scale; test.DebugView.SetViewTransform(test.m_CenterX, test.m_CenterY, test.m_Scale); test.DrawTitle(30, 15, entry.Name); test.DebugView.RenderDebugData(); }
protected void FarseerPhysics_onPaint(Alt.GUI.PaintEventArgs e) { if (m_Test == null) { return; } Alt.Sketch.Graphics graphics = e.Graphics; graphics.SmoothingMode = SmoothingMode.AntiAlias; m_Test.DebugView.m_Graphics = graphics; m_Test.DebugView.m_Font = m_InfoFont; Alt.Sketch.Size clientSize = ClientSize; double ClientWidth = clientSize.Width; double ClientHeight = clientSize.Height; m_Test.m_Scale = viewZoom * System.Math.Min(ClientWidth, ClientHeight) / 39; m_Test.m_CenterX = ClientWidth / 2 + m_Test.m_OffsetX * m_Test.m_Scale; m_Test.m_CenterY = ClientHeight / 2 + m_Test.m_OffsetY * m_Test.m_Scale; m_TPSCounter.Tick(); settings.Hz = m_TPSCounter.TPS; m_Test.TextLine = 30; m_Test.Update(settings); m_Test.m_CenterX = ClientWidth / 2 + m_Test.m_OffsetX * m_Test.m_Scale; m_Test.m_CenterY = ClientHeight * 3 / 5 + m_Test.m_OffsetY * m_Test.m_Scale; m_Test.DebugView.SetViewTransform(m_Test.m_CenterX, m_Test.m_CenterY, m_Test.m_Scale); m_Test.DrawTitle(30, 15, "Car"); m_Test.DebugView.RenderDebugData(); }