public void OnEvent(MousePositionEvent ev) { if (UIEnabled) { Overlay.System.InjectMousePosition(ev.X, ev.Y, ev.Z); } }
public void Update() { Event e = null; while ((e = Input.Poll()) != null) { switch (e.Type) { case EventType.kKeyboard: { KeyboardEvent ev = (KeyboardEvent)e; OnEvent(ev); break; } case EventType.kMouse: { MouseEvent ev = (MouseEvent)e; OnEvent(ev); break; } case EventType.kPosition: { MousePositionEvent ev = (MousePositionEvent)e; OnEvent(ev); break; } } } }
private void OnMousePosition(MousePositionEvent e) { Transform t = EntityWorld.GetComponent <Transform>(crosshairEntity); if (t != null) { t.Position = e.Position; } }
private void OnMousePosition(MousePositionEvent e) { mouseLocation = e.Position; Transform transform = EntityWorld.GetComponent <Transform>(player); if (transform != null) { Vector2 pPos = transform.Position; transform.Rotation = (float)Math.Atan2(mouseLocation.Y - pPos.Y, mouseLocation.X - pPos.X); } }
public void OnEvent(MousePositionEvent ev) { if (UIEnabled) Overlay.System.InjectMousePosition(ev.X, ev.Y, ev.Z); }