Esempio n. 1
0
 public void RemoveMethodCallWindow(CallMethodOnClickChangeWindow method)
 {
     _methodWindow -= method;
 }
Esempio n. 2
0
        public Button(Vector2 position, string text = "", CallMethodOnClick method = null, CallMethodOnClickChangeWindow methodWindow = null, string changeWin = null, ButtonType type = ButtonType.big, bool locked = false, Align al = Align.center, int?width = null)
        {
            Position       = position;
            StateOfButton  = ButtonStates.none;
            _clickedIn     = false;
            _clickedOut    = false;
            _method       += method;
            _methodWindow += methodWindow;
            _text          = text;
            _changeWin     = changeWin;
            _type          = type;
            _locked        = locked;
            Align          = al;

            switch (_type)
            {
            case ButtonType.back:
                _size = new Point(256, 64);
                _tex  = Game1.Textures["ButtonBigback"];
                ConstructButton(Globals.ColorRedish, new RectangleF(_size.ToVector2(), position), new Vector2(128, 22));
                break;

            case ButtonType.big:
                _size = new Point(256, 64);
                _tex  = Game1.Textures["ButtonBig"];
                ConstructButton(Globals.ColorGrayBlue, new RectangleF(_size.ToVector2(), position), new Vector2(128, 22));
                break;

            case ButtonType.small:
                _size = new Point(128, 32);
                _tex  = Game1.Textures["ButtonSmall"];
                ConstructButton(Globals.ColorGrayBlue, new RectangleF(_size.ToVector2(), position), new Vector2(64, 7));
                break;

            case ButtonType.scrooll:
                _size = new Point(16);
                _tex  = Game1.Textures["ScrollButton"];
                ConstructButton(Globals.ColorGrayBlue, new RectangleF(_size.ToVector2(), position), new Vector2(128, 22));
                break;

            case ButtonType.drop:
                _size     = new Point(width.Value, 32);
                _drawSize = new Point(32);
                _tex      = Game1.Textures["ButtonDrop"];
                ConstructButton(Globals.ColorGrayBlue, new RectangleF(_size.ToVector2(), position), new Vector2(128, 22));
                break;

            case ButtonType.inDrop:
                _size = new Point(224, 32);
                _tex  = Game1.Textures["ButtonInDrop"];
                ConstructButton(Globals.ColorBlueGray, new RectangleF(_size.ToVector2(), position), new Vector2(7, 7));
                Align = Align.left;
                break;

            case ButtonType.check:
                _size = new Point(24, 24);
                _tex  = null;
                ConstructButton(FourColorsButtons.Default, new RectangleF(_size.ToVector2(), position), Vector2.Zero);
                break;
            }
        }
Esempio n. 3
0
 public void AddMethodCallWindow(CallMethodOnClickChangeWindow method)
 {
     _methodWindow += method;
 }