Example #1
0
 public ScreenManager(Game game = null, Bubble player = null)
     : base(game)
 {
     this.game = game;
     this.player = player;
     this.texManager = ((Spectrum)game).getTexManager();
     lifeTexture = texManager.getUITexture(SpectrumEnums.icons.life);
     splashScreenTexture = texManager.getSplashScreen(SpectrumEnums.splashScreen.start);
 }
Example #2
0
 public Button(Vector2 position, Game game, SpectrumEnums.icons iconId = SpectrumEnums.icons.close)
 {
     this.texManager = ((Spectrum)game).texManager;
     this.currentIconId = iconId;
     this.currentbuttonId = SpectrumEnums.buttons.None;
     this.game = game;
        // this.padlock = texManager.getPadlockTexture();
     isIcon = true;
     textureUp = texManager.getUITexture(iconId);
     textureDown = textureUp;
     textureOver = textureUp;
     activeTexture = textureUp;
     int scaledTexWidth = (int)(textureUp.Width * scale);
     int scaledTexHeight = (int)(textureUp.Height * scale);
     // TODO fix scaling problem
     origin = new Vector2(scaledTexWidth / 2f, scaledTexHeight / 2f);
     recPosition = new Rectangle((int)position.X - (int)origin.X, (int)position.Y - (int)origin.Y, scaledTexWidth, scaledTexHeight);
     center = new Vector2(position.X + recPosition.Width / 2f, position.Y + recPosition.Height / 2f);
     this.position = position;
 }
Example #3
0
        //================== Music Settings Bars =====================//
        public PopUp(Game game, ScreenManager screenManager, Bubble player, SpectrumEnums.popUpId style = SpectrumEnums.popUpId.custom, string headline = "", string text = "")
        {
            this.position = new Vector2(game.Window.ClientBounds.Width / 2f, game.Window.ClientBounds.Height / 2f);
            this.game = game;
            this.texManager = ((Spectrum)game).texManager;
            this.screenManager = screenManager;
            this.player = player;
            this.headlineFont = screenManager.modelManager.getHeadlineFont();
            this.textFont = screenManager.modelManager.getTextFont();
            this.buttonHandler = screenManager.modelManager.buttonHandler;

            popUpTexture = texManager.getUITexture(style);
            currentStyle = style;
            switch (style)
            {
                case SpectrumEnums.popUpId.custom:
                    this.headline = headline;
                    this.text = text;
                    break;
                case SpectrumEnums.popUpId.win:
                    this.headline = "Congratulations!";
                    this.text = "You beat the level! \n You can go on with the next level \nor play again.";
                    break;
                case SpectrumEnums.popUpId.lose:
                    this.headline = "Game over";
                    this.text = "You lose, try again!";
                    break;
            }
            origin = new Vector2(popUpTexture.Width / 2f, popUpTexture.Height / 2f);
            center = new Vector2(position.X + recPosition.Width / 2f, position.Y + recPosition.Height / 2f);
            recPosition = new Rectangle((int)position.X - (int)origin.X, (int)position.Y - (int)origin.Y, popUpTexture.Width, popUpTexture.Height);
            setButtons();
        }