void Button_Down(object sender, Duality.Input.MouseButtonEventArgs e) { // did I click the left button and am I hovering a component? do something! if (e.Button == Duality.Input.MouseButton.Left && this.currentComponent != null) { this.currentComponent.DoAction(); } }
private void Mouse_ButtonDown(object sender, Duality.Input.MouseButtonEventArgs e) { if (DualityApp.Mouse.ButtonPressed(Duality.Input.MouseButton.Left)) { Camera cam = GameObj.GetComponent <Camera>(); cam.RenderPickingMap(new Point2(DualityApp.UserData.GfxWidth, DualityApp.UserData.GfxHeight), false); ICmpRenderer clicked = cam.PickRendererAt(DualityApp.Mouse.X, DualityApp.Mouse.Y); if (clicked != null && clicked is SpriteRenderer) { SpriteRenderer r = clicked as SpriteRenderer; IClickable clickable = r.GameObj.GetComponent <IClickable>(); if (clickable != null) { clickable.RespondToClick(MouseArgs.LeftButton); } } } }
private void Mouse_ButtonDown(object sender, Duality.Input.MouseButtonEventArgs e) { Beam.IsFiring = true; }
private void Mouse_ButtonUp(object sender, Duality.Input.MouseButtonEventArgs e) { Beam.IsFiring = false; }