Beispiel #1
0
        public void AddTextButton(string caption, float x, float y, float width, float height, System.Drawing.Color colour, Action action)
        {
            float       buttonX = (Position.X - Size.X / 2) + (width * Size.X / 2) + (x * Size.X);
            float       buttonY = (Position.Y - Size.Y / 2) + (height * Size.Y / 2) + (y * Size.Y);
            SaltyButton button  = new SaltyButton(this, caption, buttonX, buttonY, width * Size.X, height * Size.Y, colour, action);

            Buttons.Add(button);
        }
Beispiel #2
0
        public void AddSpriteButton(string texture, float x, float y, float width, float height, float rotation, Action action)
        {
            float       buttonX = (Position.X - Size.X / 2) + (width * Size.X / 2) + (x * Size.X);
            float       buttonY = (Position.Y - Size.Y / 2) + (height * Size.Y / 2) + (y * Size.Y);
            SaltyButton button  = new SaltyButton(this, texture, buttonX, buttonY, width * Size.X, height * Size.Y, rotation, action);

            Buttons.Add(button);
        }