Example #1
0
        public PCButton(Texture2D lButtonSprite, Rectangle lLocation)
        {
            mButtonSprite = lButtonSprite;
            mDrawRectange = new Rectangle(0, 0, lLocation.Width, lLocation.Height);
            mLocation = lLocation;

            mStartPoints = new Point[4];
            mButtonState = PCButtonState.none;
        }
Example #2
0
 /// <summary>
 /// Set the positions of different button states
 /// </summary>
 /// <param name="lButtonState">The button state to define</param>
 /// <param name="position">The position of the button image in the sprite</param>
 public void ConfigureButton(PCButtonState lButtonState, Point position)
 {
     mStartPoints[(int)lButtonState] = position;
 }
Example #3
0
        public virtual void LeftMouseReleased()
        {
            mButtonState = PCButtonState.released;

            mDrawRectange.X = mStartPoints[(int)PCButtonState.released].X;
            mDrawRectange.Y = mStartPoints[(int)PCButtonState.released].Y;

            LeftMouseRelase(this, new EventArgs());
        }
Example #4
0
        public virtual void LeftMouseDoubeClicked()
        {
            mButtonState = PCButtonState.pressed;

            mDrawRectange.X = mStartPoints[(int)PCButtonState.pressed].X;
            mDrawRectange.Y = mStartPoints[(int)PCButtonState.pressed].Y;

            LeftMouseDoubleClick(this, new EventArgs());
        }
Example #5
0
        public virtual void MouseUnHovered()
        {
            mButtonState = PCButtonState.none;

            mDrawRectange.X = mStartPoints[(int)PCButtonState.none].X;
            mDrawRectange.Y = mStartPoints[(int)PCButtonState.none].Y;

            MouseUnHover(this, new EventArgs());
        }