コード例 #1
0
        /// <summary>
        /// Creates a new Pushbutton-objekt
        /// </summary>
        /// <param name="_position">where the button is drawn, upper left corner</param>
        /// <param name="idletex">texture of idlebutton</param>
        /// <param name="hoovertex">texture of hoovering button</param>
        /// <param name="presstex">texture of pressed button</param>
        public Pushbutton(Vector2 _position, Texture2D idletex, Texture2D hoovertex, Texture2D presstex, string _text, Color _color, TileMenuFunction _buttonFunction)
        {
            state    = ButtonStateType.idle;
            position = _position;

            textures.Add(ButtonStateType.idle, idletex);
            textures.Add(ButtonStateType.hoover, hoovertex);
            textures.Add(ButtonStateType.pressed, presstex);

            bounds = new Rectangle(Convert.ToInt32(position.X), Convert.ToInt32(position.Y), textures[0].Width, textures[0].Height);

            text           = _text;
            color          = _color;
            buttonFunction = _buttonFunction;
        }
コード例 #2
0
        /// <summary>
        /// Creates a new Pushbutton-objekt
        /// </summary>
        /// <param name="_position">where the button is drawn, upper left corner</param>
        /// <param name="_textures">dictionary of statetype and textures</param>
        public Pushbutton(Vector2 _position, Dictionary <ButtonStateType, Texture2D> _textures, string _text, Color _color, TileMenuFunction _buttonFunction)
        {
            state    = ButtonStateType.idle;
            position = _position;

            foreach (KeyValuePair <ButtonStateType, Texture2D> tex in _textures)
            {
                textures.Add(tex.Key, tex.Value);
            }

            bounds = new Rectangle(Convert.ToInt32(position.X), Convert.ToInt32(position.Y), textures[0].Width, textures[0].Height);

            text           = _text;
            color          = _color;
            buttonFunction = _buttonFunction;
        }
コード例 #3
0
 public TileMenuUpdateData(bool what)
 {
     tileMenuFunction = TileMenuFunction._void_;
     clickDetected    = false;
 }
コード例 #4
0
 public void TileMenuClick(TileMenuFunction function)
 {
     tileMenuUpdateData.tileMenuFunction = function;
 }