/// <summary> /// Triggered when an object extending this class is placed /// in GuiManager.MouseDownListeners and the mouse up event /// is fired. /// </summary> /// <param name="args"></param> public void MouseUp(GuiMouseEventArgs args) { if (Clicked != null) { // remove ourselves args.GuiManager.MouseUpListeners.Remove(this); Clicked(this, new EventArgs()); } }
public void MouseMotion(GuiMouseEventArgs args) { // Figure out translate point float x = args.Point.X - this.screenPoint.X - this.ViewportOffset.X; float y = args.Point.Y - this.screenPoint.Y - this.ViewportOffset.Y; // Save the point mousePoint = new PointF(x, y); }
/// <summary> /// Triggered when the mouse is released. /// </summary> /// <param name="args"></param> public void MouseUp(GuiMouseEventArgs args) { // Pass it to the minor mode if we have it if (minorMode != null) { minorMode.MouseUp(args); return; } // Figure out the mouse button if (args.Button == MfGames.Sprite3.Gui.MouseButtons.Left) { // Grab it Grab(); } else if (args.Button == MfGames.Sprite3.Gui.MouseButtons.Right) { // Drop the block Drop(); } }
public override void MouseButtonUp(MouseEventArgs args) { // Call our parent base.MouseButtonUp(args); // Process our events GuiMouseEventArgs gargs = new GuiMouseEventArgs(); // Translate the mouse buttons if (args.Button == BooGame.Input.MouseButtons.Left || args.Button == BooGame.Input.MouseButtons.None) { gargs.Button = MfGames.Sprite3.Gui.MouseButtons.Left; } if (args.Button == BooGame.Input.MouseButtons.Right) { gargs.Button = MfGames.Sprite3.Gui.MouseButtons.Right; } // Fire the event Game.GuiManager.MouseUp(gargs); }
/// <summary> /// Triggered when the mouse is released over this sprite. /// </summary> public void MouseUp(GuiMouseEventArgs args) { // We only do stuff if we haven't been accepted if (Game.PlayMode == null || prayer.IsAccepted) { return; } // Create the center point PointF p = new PointF( Point.X + 31, Point.Y + 90); // We want to accept this one prayer.IsAccepted = true; secondsLeft = Constants.PrayerSpeechFade; Game.PlayMode .SwarmHearts(Constants.HeartsPerPrayerAcceptance, p); // End the turn Game.State.EndTurn(); args.StopProcessing = true; }
/// <summary> /// Triggered when an object extending this class is placed /// in GuiManager.MouseDownListeners and the mouse up event /// is fired. /// </summary> /// <param name="args"></param> public void MouseUp(GuiMouseEventArgs args) { Close(); }
/// <summary> /// Triggered when an object extending this class is placed /// in GuiManager.MouseDownListeners and the mouse up event /// is fired. /// </summary> /// <param name="args"></param> public void MouseUp(GuiMouseEventArgs args) { Timeout(); }
/// <summary> /// Triggered when an object extending this class is placed /// in GuiManager.MouseDownListeners and the mouse motion event /// is fired. /// </summary> /// <param name="args"></param> public void MouseMotion(GuiMouseEventArgs args) { }
/// <summary> /// Triggered when the mouse is released over this sprite. /// </summary> public void MouseUp(GuiMouseEventArgs args) { // We only do stuff if we haven't been accepted if (Game.PlayMode == null || prayer.IsAccepted) return; // Create the center point PointF p = new PointF( Point.X + 31, Point.Y + 90); // We want to accept this one prayer.IsAccepted = true; secondsLeft = Constants.PrayerSpeechFade; Game.PlayMode .SwarmHearts(Constants.HeartsPerPrayerAcceptance, p); // End the turn Game.State.EndTurn(); args.StopProcessing = true; }
/// <summary> /// Triggered when an object extending this class is placed /// in GuiManager.MouseDownListeners and the mouse down event /// is fired. /// </summary> /// <param name="args"></param> public void MouseDown(GuiMouseEventArgs args) { }
public void MouseMotion(GuiMouseEventArgs args) { throw new Exception("The method or operation is not implemented."); }
/// <summary> /// Triggered with mouse movement. /// </summary> /// <param name="args"></param> public void MouseMotion(GuiMouseEventArgs args) { // We don't do anything about this one }
/// <summary> /// Triggered when an object extending this class is placed /// in GuiManager.MouseDownListeners and the mouse up event /// is fired. /// </summary> /// <param name="args"></param> public void MouseUp(GuiMouseEventArgs args) { // Switch modes Debug("Mouse up!"); Game.GameMode = nextMode; }
public override void MouseButtonUp(MouseEventArgs args) { // Call our parent base.MouseButtonUp(args); // Process our events GuiMouseEventArgs gargs = new GuiMouseEventArgs(); // Translate the mouse buttons if (args.Button == BooGame.Input.MouseButtons.Left || args.Button == BooGame.Input.MouseButtons.None) gargs.Button = MfGames.Sprite3.Gui.MouseButtons.Left; if (args.Button == BooGame.Input.MouseButtons.Right) gargs.Button = MfGames.Sprite3.Gui.MouseButtons.Right; // Fire the event Game.GuiManager.MouseUp(gargs); }