void ProcessResize() { if (m_TempClientSize != paintComponent.ClientSize) { m_TempClientSize = paintComponent.ClientSize; RaiseResize(new ResizeEventArgs(ClientSize)); } }
protected override void OnResize(EventArgs e) { base.OnResize(e); Alt.Sketch.Size clientSize = ClientSize; m_TargetX = clientSize.Width / 2; m_TargetY = clientSize.Height / 2; }
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(); }
public static void DrawEditorText(Alt.GUI.PaintEventArgs e, string text, string gameObjectName, Alt.Sketch.Size clientSize, int invalidateFPS, Alt.Sketch.Rendering.RenderType renderType) { if (text.StartsWith("AltGUI ")) { text = text.Substring(7); } //e.Graphics.TextRenderingHint = Alt.Sketch.TextRenderingHint.SingleBitPerPixelGridFit; double sizeK = 1.4; int hoffset = 4; int voffset = 6; e.Graphics.DrawString("AltGUI", EditorTextFont, Alt.Sketch.Brushes.LightBlue, new Alt.Sketch.Point(hoffset, 5)); e.Graphics.DrawString(text, EditorTextFont, Alt.Sketch.Brushes.Yellow, new Alt.Sketch.Point(hoffset, voffset + EditorTextFont.Size * sizeK)); voffset += 1; e.Graphics.DrawString("[" + gameObjectName + "]", EditorTextFont, Alt.Sketch.Brushes.Yellow, new Alt.Sketch.Point(hoffset, voffset + EditorTextFont.Size * sizeK * 2)); voffset += 2; e.Graphics.DrawString("Max FPS: " + invalidateFPS.ToString(), EditorTextFont, Alt.Sketch.Brushes.WhiteSmoke, new Alt.Sketch.Point(hoffset, voffset + EditorTextFont.Size * sizeK * 3 + 1)); e.Graphics.DrawString("Render Type: " + (renderType == Alt.Sketch.Rendering.RenderType.Software ? "Software" : "Hardware"), EditorTextFont, Alt.Sketch.Brushes.WhiteSmoke, new Alt.Sketch.Point(hoffset, voffset + EditorTextFont.Size * sizeK * 4 + 2)); e.Graphics.DrawString("Size: " + clientSize.Width.ToString() + " x " + clientSize.Height.ToString(), EditorTextFont, Alt.Sketch.Brushes.WhiteSmoke, new Alt.Sketch.Point(hoffset, voffset + EditorTextFont.Size * sizeK * 5 + 3)); }