示例#1
0
        public void init(Microsoft.Xna.Framework.Content.ContentManager Content, Action inGameCallback, Action backToMenuCallback, Action reinitCallback)
        {
            base.init(Content);
            sideMenuBack = Content.Load <Texture2D>(".\\Sprites\\GUI\\backMenuShape");


            soundButton = new SoundButton(inGameCallback);
            soundButton.init(Content);

            homeButton = new HomeButton(backToMenuCallback);
            homeButton.init(Content);

            backButton = new BackButton(reinitCallback);
            backButton.init(Content);

            playButton = new InGamePlayButton(inGameCallback);
            playButton.init(Content);

            buttonList = new LinkedList <SimpleButton>();
            buttonList.AddLast(playButton);
            buttonList.AddLast(soundButton);
            buttonList.AddLast(homeButton);
            buttonList.AddLast(backButton);


            playButton.position.Y = 375f;
            playButton.position.X = 800f;

            soundButton.position.Y = 40f;
            soundButton.position.X = 815f;

            homeButton.position.Y = 175f;
            homeButton.position.X = 815f;

            backButton.position.Y = 255f;
            backButton.position.X = 815f;
        }
示例#2
0
        public override void build()
        {
            base.build();

            outt = false;

            wearPage = new WearPage();
            addChild(wearPage);
            wearPage.init(content);


            itemPage = new ItemPage();
            addChild(itemPage);
            itemPage.init(content);

            levelPage = new LevelPage();
            addChild(levelPage);
            levelPage.init(content);

            pages = new LinkedList <DefaultPage>();
            pages.AddLast(wearPage);
            pages.AddLast(itemPage);
            pages.AddLast(levelPage);

            currentPage = wearPage;
            currentPage.show();

            ButtonModel defaultButtonModel = new ButtonModel(".\\Sprites\\GUI\\defaultButton\\shapeButton", ".\\Sprites\\GUI\\defaultButton\\shapeButtonXML", ButtonFactory.spriteFont);

            backButton = new HomeButton(gotoInit);
            backButton.init(content);
            backButton.position.Y = 20;
            backButton.position.X = -backButton.texture.Width - 5;
            backButton.tweener    = new Tweener(-backButton.texture.Width - 5, 20f, TimeSpan.FromSeconds(.5f), Back.EaseOut);
            backButton.tweener.Start();

            wearButton = new SimpleButton(defaultButtonModel, "WEAR", new Point(205, 56), setWearPage);
            wearButton.init(content);
            wearButton.fontScale = .9f;
            // wearButton.fontColor = new Color(63, 53, 127);
            wearButton.fontMargin = new Vector2(55, 6);
            wearButton.position.Y = 85;
            wearButton.position.X = -wearButton.texture.Width - 5;
            wearButton.tweener    = new Tweener(-wearButton.texture.Width - 5, 15f, TimeSpan.FromSeconds(.7f), Back.EaseOut);
            wearButton.tweener.Start();
            wearButton.isActive = true;

            // itemButton = new SimpleButton(new ButtonModel(".\\Sprites\\GUI\\defaultButton\\itemsButton", "", null), "", new Point(), setItemPage);
            itemButton = new SimpleButton(defaultButtonModel, "ITEM", new Point(205, 56), setItemPage);
            itemButton.init(content);
            itemButton.fontScale = .9f;
            //itemButton.fontColor = new Color(63,53,127);
            itemButton.fontMargin = new Vector2(62, 6);
            itemButton.position.Y = 150;
            itemButton.position.X = -itemButton.texture.Width - 5;
            itemButton.tweener    = new Tweener(-itemButton.texture.Width - 5, 15f, TimeSpan.FromSeconds(.8f), Back.EaseOut);
            itemButton.tweener.Start();

            levelButton = new SimpleButton(defaultButtonModel, "LEVELS", new Point(205, 56), setLevelPage);
            levelButton.init(content);
            levelButton.fontScale = .9f;
            //levelButton.fontColor = new Color(63, 53, 127);
            levelButton.fontMargin = new Vector2(50, 6);
            levelButton.position.Y = 215;
            levelButton.position.X = -levelButton.texture.Width - 5;
            levelButton.tweener    = new Tweener(-levelButton.texture.Width - 5, 15f, TimeSpan.FromSeconds(.9f), Back.EaseOut);
            levelButton.tweener.Start();

            coins = new StaticObject(".\\Sprites\\GUI\\shopScreen\\starContainer");
            coins.init(content);
            coins.position.Y = 405;
            coins.position.X = levelButton.position.X - 10;

            starsLabel = new IncrementalLabel(0, ButtonFactory.spriteFont);
            starsLabel.init(content);
            starsLabel.newValue(GameModel.currentPoints);
            starsLabel.position.Y = 415;
            starsLabel.position.X = coins.position.X + 60;

            addChild(wearButton);

            addChild(itemButton);
            addChild(levelButton);
            addChild(backButton);
            addChild(coins);
            addChild(starsLabel);
        }
示例#3
0
        public override void build()
        {
            base.build();

            loadScreen.init(content);
            //SALVAR O CENARIO ATUAL
            RufusModel     temp  = GameModel.levelsModels.ElementAt(GameModel.currentLevelID);
            LevelBehaviour temp2 = (LevelBehaviour)(temp.behaviour);

            currentLevelModel = temp2.levelModel;

            background = new BackLevelView(currentLevelModel.bgPath);
            if (currentLevelModel.clouds != null)
            {
                background.addClouds(currentLevelModel.clouds);
            }
            background.setColor(currentLevelModel.color);

            background.init(content);
            addChild(background);
            background.start();
            outt = false;

            ButtonModel playModel = new ButtonModel(".\\Sprites\\GUI\\readyButton\\readyButton", ".\\Sprites\\GUI\\readyButton\\readyButtonXML", null);

            playButton = new SimpleButton(playModel, "", new Point(), gotoGame);
            playButton.init(content);
            playButton.position.Y = 570;
            playButton.position.X = 400 - playButton.texture.Width / 2;
            playButton.tweener    = new Tweener(playButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            playButton.tweener.Start();

            locationButton = new SimpleButton(new ButtonModel(".\\Sprites\\GUI\\locationButton\\locationButton", ".\\Sprites\\GUI\\locationButton\\locationButtonXML", null), "", new Point(), changeLevelModel);
            locationButton.init(content);
            locationButton.position.Y = 480;
            locationButton.position.X = 400 - locationButton.texture.Width / 2;
            locationButton.tweener    = new Tweener(locationButton.position.Y, 260f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            locationButton.tweener.Start();

            backButton = new HomeButton(gotoInit);
            backButton.init(content);
            backButton.position.Y = 40;
            backButton.position.X = 40;
            // backButton.tweener = new Tweener(backButton.position.Y, 40f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            // backButton.tweener.Start();

            changeLevel = new ArrowButton(changeRufus);
            changeLevel.init(content);
            changeLevel.position.Y    = -40;
            changeLevel.position.X    = 490;
            changeLevel.spriteEffects = SpriteEffects.FlipHorizontally;
            changeLevel.scale         = new Vector2(.8f);
            changeLevel.tweener       = new Tweener(changeLevel.position.Y, 120f, TimeSpan.FromSeconds(1.0f), Cubic.EaseOut);
            changeLevel.tweener.Start();

            changeLevelBack = new ArrowButton(changeRufusBack);
            changeLevelBack.init(content);
            changeLevelBack.position.Y    = -40;
            changeLevelBack.position.X    = 268;
            changeLevelBack.spriteEffects = SpriteEffects.None;
            changeLevelBack.scale         = new Vector2(.8f);
            changeLevelBack.tweener       = new Tweener(changeLevel.position.Y, 120f, TimeSpan.FromSeconds(1.0f), Cubic.EaseOut);
            changeLevelBack.tweener.Start();

            backRufusBox = new SimpleButton(new ButtonModel(".\\Sprites\\GUI\\backChoiceRufus", "", null), "", new Point(), openCard);
            backRufusBox.init(content);
            backRufusBox.position.Y = -backRufusBox.texture.Height;
            backRufusBox.position.X = 400 - backRufusBox.texture.Width / 2;
            backRufusBox.tweener    = new Tweener(backRufusBox.position.Y, 40f, TimeSpan.FromSeconds(1.0f), Cubic.EaseOut);
            backRufusBox.tweener.Start();


            rufusImage = new StaticObject(GameModel.rufusModels.ElementAt(GameModel.currentRufusID).largePath);
            rufusImage.init(content);
            rufusImage.position.Y = backRufusBox.position.Y + rufusImage.texture.Height / 2 + backRufusBox.texture.Height / 2;
            rufusImage.position.X = 400 - rufusImage.texture.Width / 2;

            soundButton = new SoundButton(null);
            soundButton.init(content);
            soundButton.position.X = 700f;
            soundButton.position.Y = 40f;

            helpButton = new HelpButton(null);
            helpButton.init(content);
            helpButton.position.X = 600f;
            helpButton.position.Y = 40f;

            addChild(backRufusBox);
            addChild(playButton);
            addChild(changeLevel);
            addChild(changeLevelBack);
            addChild(locationButton);
            addChild(backButton);
            addChild(rufusImage);
            addChild(soundButton);
            addChild(helpButton);
        }
示例#4
0
        public void init(Microsoft.Xna.Framework.Content.ContentManager Content, Action inGameCallback, Action backToMenuCallback, Action reinitCallback, Action shopCallback, Action backToPreGameCallback)
        {
            base.init(Content);
            sideMenuBack = Content.Load <Texture2D>(".\\Sprites\\GUI\\backEndGame");


            soundButton = new SoundButton(inGameCallback);
            soundButton.init(Content);

            homeButton = new HomeButton(backToMenuCallback);
            homeButton.init(Content);

            backButton = new ArrowButton(backToPreGameCallback);
            backButton.init(Content);

            playButton = new InGamePlayButton(reinitCallback);
            playButton.init(Content);

            shopButton = new SimpleButton(new ButtonModel(".\\Sprites\\GUI\\shopButton\\shopButton", ".\\Sprites\\GUI\\shopButton\\shopButtonXML", null), "", new Point(), shopCallback);
            shopButton.init(Content);
            shopButton.position.Y = 480;
            shopButton.position.X = 400 - shopButton.texture.Width / 2;
            shopButton.tweener    = new Tweener(shopButton.position.Y, 270f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            shopButton.tweener.Start();


            buttonList = new LinkedList <SimpleButton>();
            buttonList.AddLast(soundButton);
            buttonList.AddLast(homeButton);
            buttonList.AddLast(backButton);
            buttonList.AddLast(playButton);
            buttonList.AddLast(shopButton);

            levelScore = new IncrementalLabel(0, ButtonFactory.spriteFont);
            levelScore.init(Content);
            levelScore.fontSize = 1.2f;
            levelScore.mask     = true;

            totalScore = new IncrementalLabel(GameModel.currentPoints, ButtonFactory.spriteFont);
            totalScore.init(Content);
            totalScore.fontSize = 0.8f;

            maxMush = new IncrementalLabel(0, ButtonFactory.spriteFont);
            maxMush.init(Content);
            maxMush.fontSize = 0.6f;
            //maxMush.mask = true;

            maxSpecial = new IncrementalLabel(0, ButtonFactory.spriteFont);
            maxSpecial.init(Content);
            maxSpecial.fontSize = 0.6f;
            // maxSpecial.mask = true;

            maxBoobs = new IncrementalLabel(0, ButtonFactory.spriteFont);
            maxBoobs.init(Content);
            maxBoobs.fontSize = 0.6f;
            //maxBoobs.mask = true;

            maxCombo = new IncrementalLabel(0, ButtonFactory.spriteFont);
            maxCombo.init(Content);
            maxCombo.fontSize = 0.6f;
            //maxCombo.mask = true;

            maxJump = new IncrementalLabel(0, ButtonFactory.spriteFont);
            maxJump.init(Content);
            maxJump.fontSize = 0.6f;
            //maxJump.mask = true;


            soundButton.position.X = 700f;

            homeButton.position.X = 515f;


            playButton.position.X = sideMenuPos.X + sideMenuBack.Width / 2 - playButton.texture.Width / 4;
            playButton.position.Y = -100;

            backButton.position.X = sideMenuPos.X + 10f;

            sideMenuPos.Y          = -480f;
            soundButton.position.Y = -140f;
        }