Example #1
0
        protected override void LoadContent()
        {
            base.LoadContent();

            AddBackground("Backgrounds\\MainMenu");

            LinkLabel startLabel = new LinkLabel("Press ENTER to begin", new Vector2(350, 500));
            startLabel.Selected += new EventHandler(startLabel_selected);

            ControlManager.Add(startLabel);
            ControlManager.NextControl();
        }
Example #2
0
        protected override void LoadContent()
        {
            base.LoadContent();

            AddBackground("Backgrounds\\MainMenu");

            arrowImage = new PictureBox(Content.Load<Texture2D>("GUI\\leftarrowUp"));
            ControlManager.Add(arrowImage);

            startGame = new LinkLabel("The Story Begins");
            startGame.Selected += menuItem_Selected;
            ControlManager.Add(startGame);

            loadGame = new LinkLabel("The Story Continues");
            loadGame.Selected += menuItem_Selected;
            ControlManager.Add(loadGame);

            exitGame = new LinkLabel("The Story Ends");
            exitGame.Selected += menuItem_Selected;
            ControlManager.Add(exitGame);

            ControlManager.NextControl();
            ControlManager.FocusChanged += ControlManager_FocusChanged;

            Vector2 position = new Vector2(350, 500);
            foreach (Control c in ControlManager)
            {
                if (c is LinkLabel)
                {
                    c.Position = position;
                    position.Y += c.Size.Y + 5f;
                }
            }

            ControlManager_FocusChanged(startGame, EventArgs.Empty);
        }
Example #3
0
 internal SkillLabelSet(Label label, Label skillLabel, LinkLabel linkLabel)
 {
     Label = label;
     SkillLabel = skillLabel;
     LinkLabel = linkLabel;
     SkillValue = 0;
 }
Example #4
0
        private void CreateControls()
        {
            AddBackground("Backgrounds\\MainMenu");

            float padding = ControlManager.SpriteFont.LineSpacing + 10f;

            string skillPath = Content.RootDirectory + "\\Game\\Skills";
            string[] skillFiles = Directory.GetFiles(skillPath, "*.xnb");

            for (int i = 0; i < skillFiles.Length; i++)
                skillFiles[i] = "Game\\Skills\\" + Path.GetFileNameWithoutExtension(skillFiles[i]);

            List<SkillData> skillData = new List<SkillData>();

            Vector2 nextControlPosition = new Vector2(300, 150);
            pointsRemaining = new Label("Skill Points: " + unassignedPoints.ToString(), nextControlPosition);
            ControlManager.Add(pointsRemaining);

            nextControlPosition.Y += padding;

            foreach (string s in skillFiles)
            {
                SkillData data = Content.Load<SkillData>(s);

                Label label = new Label(data.Name, nextControlPosition);
                label.Type = data.Name;
                ControlManager.Add(label);

                Label sLabel = new Label("0", new Vector2(nextControlPosition.X + 300, nextControlPosition.Y));
                ControlManager.Add(sLabel);

                LinkLabel linkLabel = new LinkLabel("+", new Vector2(nextControlPosition.X + 350, nextControlPosition.Y));
                linkLabel.Type = data.Name;
                linkLabel.Selected += addSkillLabel_Selected;
                ControlManager.Add(linkLabel);

                nextControlPosition.Y += padding;
                skillLabels.Add(new SkillLabelSet(label, sLabel, linkLabel));
            }

            nextControlPosition.Y += padding;

            LinkLabel undoLabel = new LinkLabel("Undo", nextControlPosition);
            undoLabel.Selected += new EventHandler(undoLabel_Selected);
            ControlManager.Add(undoLabel);

            nextControlPosition.Y += padding;

            LinkLabel acceptLabel = new LinkLabel("Accept Changes", nextControlPosition);
            acceptLabel.Selected += new EventHandler(acceptLabel_Selected);
            ControlManager.Add(acceptLabel);

            ControlManager.NextControl();
        }
        private void CreateControls()
        {
            AddBackground("Backgrounds\\MainMenu");

            Label label = new Label("Select Character", new Vector2(StateManager.ScreenCentre.X, StateManager.ScreenCentre.Y / 2));
            ControlManager.Add(label);

            genderSelector = new LeftRightSelector(
                Content.Load<Texture2D>("GUI\\leftarrowUp"),
                Content.Load<Texture2D>("GUI\\rightarrowUp"),
                label.Position + new Vector2(0, StateManager.Viewport.Height / 6));
            genderSelector.SetItems(genderItems);
            genderSelector.SelectionChanged += selectionChanged;
            ControlManager.Add(genderSelector);

            classSelector = new LeftRightSelector(
                Content.Load<Texture2D>("GUI\\leftarrowUp"),
                Content.Load<Texture2D>("GUI\\rightarrowUp"),
                genderSelector.Position + new Vector2(0, StateManager.Viewport.Height / 6));
            classSelector.SetItems(classItems);
            classSelector.SelectionChanged += selectionChanged;
            ControlManager.Add(classSelector);

            LinkLabel acceptCharacter = new LinkLabel(
                "Accept this character.",
                classSelector.Position + new Vector2(0, StateManager.Viewport.Height / 6));
            acceptCharacter.Selected += new EventHandler(acceptCharacter_Selected);
            ControlManager.Add(acceptCharacter);

            characterImage = new PictureBox(
                characterImages[0, 0],
                new Vector2(StateManager.Viewport.Width * 0.75f, genderSelector.Position.Y),
                new Rectangle(0, 0, 32, 32));
            characterImage.Size = new Vector2(64, 64);
            ControlManager.Add(characterImage);

            ControlManager.NextControl();
        }