Exemple #1
0
        public void Init(Image unhighli, Image highli, Vector2 position, ButtonEffect effect)//Button without text
        {
            unhighlightedButton = unhighli;
            highlightedButton = highli;
            this.position = position;
            Effect = effect;

        }
Exemple #2
0
 public void Init(Image unhighli, Image highli, Vector2 position, ButtonEffect effect, string text)//Button with text
 {
     unhighlightedButton = unhighli;
     highlightedButton = highli;
     this.position = position;
     Effect = effect;
     buttonFont = null; //fix this
     buttonText = text;
 }
Exemple #3
0
        //On creation generates the button effect by dictionary, little janky but this works
        public void Run()
        {
            if (nextScreen != null)
            {
                Effects.Add("ChangeScreen", new ChangeScreen(nextScreen));
            }
            Effect = Effects[buttonType];
            Effect.Run();

        }
Exemple #4
0
        public Button CreateChangeScreenButton(Image image, string text, SpriteFont font, Vector2 pos, GameScreen nextScreen)
        {
            effect = new ChangeScreen(nextScreen);
            if (text == null || font == null)
            {

                button = new Button(image, image, pos, effect);
            }
            else
                button = new Button(image, image, pos, effect, text, font);

            return button;
        }