public Alt.Sketch.Vector2 ConvertScreenToWorld(double x, double y) { AltGUIHelper.Box2DContainer box2DContainer = Box2DContainer; if (box2DContainer == null) { return(new Alt.Sketch.Vector2(x, y)); } return(box2DContainer.ConvertScreenToWorld(x, y)); }
protected override void OnPaint(PaintEventArgs e) { AltGUIHelper.Box2DContainer box2DContainer = Box2DContainer; if (box2DContainer == null) { return; } box2DContainer.DoubleBuffered = !e.Graphics.IsClippingSupported; if (box2DContainer.DoubleBuffered) { box2DContainer.Refresh(); } DebugDraw.m_Graphics = e.Graphics; DebugDraw.m_Font = m_InfoFont; m_TPSCounter.Tick(); base.OnPaint(e); }
protected override void Start() { base.Start(); GwenChild = AltGUIHelper.Create_Box2DContainer(GetOrCreateGwenCanvas(), DebugDraw); AltGUIHelper.Box2DContainer box2DContainer = Box2DContainer; if (box2DContainer == null) { return; } m_InfoFont = new Alt.Sketch.Font("Arial", 10.01, Alt.Sketch.FontStyle.Bold); box2DContainer.Paint += Box2DContainer_OnPaint; box2DContainer.MouseDown += RaiseBox2DMouseDown; box2DContainer.MouseUp += RaiseBox2DMouseUp; box2DContainer.MouseMove += RaiseBox2DMouseMove; box2DContainer.Focus(); }