示例#1
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);
        }