Exemplo n.º 1
0
        public override void Activate(bool instancePreserved)
        {
            base.Activate(instancePreserved);

            // Add buttons
            single = new LargeButton("Single Player");
            single.Position = new Vector2(1560, 360);
            single.TextFont = "tahomaLarge";
            single.TextScale = 0.8f;
            single.Tapped += singleButton_Tapped;

            multi = new LargeButton("Multiplayer");
            multi.Position = new Vector2(1560, 612);
            multi.ButtonTexture.Tint = new Color(72, 182, 216);
            multi.TextFont = "tahomaLarge";
            multi.TextScale = 0.8f;
            multi.Tapped += multiButton_Tapped;

            back = new SmallButton("Back");
            back.Position = new Vector2(1560, 894);
            back.Tapped += backButton_Tapped;

            AddButton(single, multi, back);
            mainView.AddElement(single, multi, back);

            SearchingButtons = new View();
            SearchingButtons.Disabled = false;
            SearchingButtons.Visible = false;

            playersInParty = new Label("Searching for players: 1/4", new Vector2(1560, 550));
            playersInParty.Scale = 0.8f;
            playersInParty.TextColor = Color.White;

            AnimatedPigs = new List<Image>();
            int size = Constants.BUFFER_SPRITE_DIM;
            Vector2 StartingPosition = new Vector2(1600 - size * 3f, 650);
            for(int i = 0; i < 6; i++) {
                Image PigImage = new Image("pig", i);
                PigImage.Position = StartingPosition + new Vector2(size * i, 0);
                SearchingButtons.AddElement(PigImage);
                AnimatedPigs.Add(PigImage);
            }
            SearchingButtons.AddElement(playersInParty);

            mainView.AddElement(SearchingButtons);
        }
Exemplo n.º 2
0
        public override void Activate(bool instancePreserved)
        {
            base.Activate(instancePreserved);

            myData = Storage.Get<PlayerData>("myPlayerData");
            TransitionAnimations = new List<UIElement>();

            categorySelected = false;
            gameSelected = false;
            itemSelected = false;

            BorderedView storeCategories = new BorderedView(new Vector2(672, 450), new Vector2(1536, 258));
            storeCategories.BorderWidth = 0;
            Label categories = new Label("Categories", new Vector2(rightXMiddle, 125));
            categories.Font = "gillsans";
            categories.Scale = 1.2f;
            Button skins = new SmallButton("Skins");
            skins.Position = new Vector2(rightXMiddle, 250);
            skins.TappedArgs.Arg = "skins";
            skins.Tapped += CategoryButton_Tapped;
            Button upgrades = new SmallButton("Upgrades");
            upgrades.Position = new Vector2(rightXMiddle, 370);
            upgrades.TappedArgs.Arg = "upgrades";
            upgrades.Tapped += CategoryButton_Tapped;
            storeCategories.Disabled = false;
            storeCategories.AddElement(categories, skins, upgrades);
            storeCategories.SetAnimationOffset(new Vector2(1000, 0), Helpers.EaseOutBounceAnimation, false); // set the animation to start 1000 pixels to the right
            storeCategories.UpdateAnimationPosition(0); // start the animation to move the elements out of screen
            TransitionAnimations.Add(storeCategories); // add it to the list of animated objects
            mainView.AddElement(storeCategories);

            BorderedView itemDetails = new BorderedView(new Vector2(672, 552), new Vector2(rightXMiddle, 780));
            itemDetails.BorderWidth = 0;

            itemName = new Label("", new Vector2(rightXMiddle, 580));
            itemName.Font = "gillsans";
            itemName.MaxSize(760);
            itemDescription = new Label("", new Vector2(rightXMiddle, 650));
            itemDescription.MaxSize(760);
            buyItem = new SmallButton("");
            buyItem.Position = new Vector2(1536, 745);
            buyItem.ButtonImage = "buyButton";
            buyItem.Tapped += BuyItem_Tapped;
            ClearItem();

            currentMoney = new Label("$" + myData.money, new Vector2(rightXMiddle, 870));
            currentMoney.Font = "gillsans";
            currentMoney.TextColor = Color.Yellow;
            Button back = new SmallButton("Back");
            back.Position = new Vector2(1536, 978);
            back.Tapped += backButton_Tapped;
            itemDetails.Disabled = false;
            itemDetails.AddElement(itemName, itemDescription, buyItem, currentMoney, back);
            itemDetails.SetAnimationOffset(new Vector2(1000, 0), Helpers.EaseOutBounceAnimation, false); // set the animation to start 1000 pixels to the right
            itemDetails.UpdateAnimationPosition(0); // start the animation to move the elements out of screen
            TransitionAnimations.Add(itemDetails); // add it to the list of animated objects
            mainView.AddElement(itemDetails);

            BorderedView storeLeft = new BorderedView(new Vector2(1152, 1300), new Vector2(leftXMiddle, 540));
            storeLeft.Disabled = false;
            itemView = new View(new Vector2(1152, 1300), new Vector2(leftXMiddle, 540));
            itemView.Disabled = false;
            itemViewLabel = new Label("Select a category at the right", new Vector2(leftXMiddle, leftYTop));
            itemViewLabel.Font = "gillsans";
            storeLeft.AddElement(itemViewLabel, itemView);
            storeLeft.SetAnimationOffset(new Vector2(-1500, 0), Helpers.EaseOutBounceAnimation, false); // set the animation to start 1500 pixels to the left
            storeLeft.UpdateAnimationPosition(0); // start the animation to move the elements out of screen
            TransitionAnimations.Add(storeLeft); // add it to the list of animated objects
            mainView.AddElement(storeLeft);
        }
Exemplo n.º 3
0
        public override void Activate(bool instancePreserved)
        {
            // When the screen is activated, we have a valid ScreenManager so we can arrange
            // our buttons on the screen
            float center = ScreenManager.GraphicsDevice.Viewport.Bounds.Center.X;

            mainView = new View(new Vector2(1920, 1080), new Vector2(1920/2, 1080/2));
            mainView.Disabled = false; // allow this view to handle inputs

            base.Activate(instancePreserved);
        }