private void CreateControls()
        {
            var leftTexture = Game.Content.Load<Texture2D>(@"GUI\leftarrowUp");
            var rightTexture = Game.Content.Load<Texture2D>(@"GUI\rightarrowUp");
            var stopTexture = Game.Content.Load<Texture2D>(@"GUI\StopBar");

            _backgroundImage = new PictureBox(
                Game.Content.Load<Texture2D>(@"Backgrounds\startScreen"),
                GameRef.ScreenRectangle);
            ControlManager.Add(_backgroundImage);

            var label1 = new Label {
                Text = "Who shall Thy be?"
            };
            label1.Size = label1.SpriteFont.MeasureString(label1.Text);
            label1.Position = new Vector2((GameRef.Window.ClientBounds.Width - label1.Size.X) / 2, 150);
            ControlManager.Add(label1);

            _genderSelector = new LeftRightSelector(leftTexture, rightTexture, stopTexture);
            _genderSelector.SetItems(_genderItems, 125);
            _genderSelector.Position = new Vector2(label1.Position.X, 200);
            ControlManager.Add(_genderSelector);

            _classSelector = new LeftRightSelector(leftTexture, rightTexture, stopTexture);
            _classSelector.SetItems(_classItems, 125);
            _classSelector.Position = new Vector2(label1.Position.X, 250);
            ControlManager.Add(_classSelector);

            var linklabel1 = new LinkLabel {Text = "Accept", Position = new Vector2(label1.Position.X, 300)};
            linklabel1.Selected += linklabel1_Selected;
            ControlManager.Add(linklabel1);

            ControlManager.NextControl();
        }
Esempio n. 2
0
 internal SkillLabelSet(Label label, Label skillLabel, LinkLabel linkLabel)
 {
     Label = label;
     SkillLabel = skillLabel;
     LinkLabel = linkLabel;
     SkillValue = 0;
 }
        private void CreateControls()
        {
            Texture2D leftTexture = Game.Content.Load<Texture2D>(@"GUI\leftarrowUp");
            Texture2D rightTexture = Game.Content.Load<Texture2D>(@"GUI\rightarrowUp");
            Texture2D stopTexture = Game.Content.Load<Texture2D>(@"GUI\StopBar");

            backgroundImage = new PictureBox(
                Game.Content.Load<Texture2D>(@"Backgrounds\titlescreen"),
                GameRef.ScreenRectangle);
            ControlManager.Add(backgroundImage);

            Label label1 = new Label();

            label1.Text = "Who will search for the Eyes of the Dragon?";
            label1.Size = label1.SpriteFont.MeasureString(label1.Text);
            label1.Position = new Vector2((GameRef.Window.ClientBounds.Width - label1.Size.X) / 2, 150);

            ControlManager.Add(label1);

            genderSelector = new LeftRightSelector(leftTexture, rightTexture, stopTexture);
            genderSelector.SetItems(genderItems, 125);
            genderSelector.Position = new Vector2(label1.Position.X, 200);
            genderSelector.SelectionChanged += new EventHandler(selectionChanged);

            ControlManager.Add(genderSelector);

            classSelector = new LeftRightSelector(leftTexture, rightTexture, stopTexture);
            classSelector.SetItems(classItems, 125);
            classSelector.Position = new Vector2(label1.Position.X, 250);
            classSelector.SelectionChanged += selectionChanged;

            ControlManager.Add(classSelector);

            LinkLabel linkLabel1 = new LinkLabel();
            linkLabel1.Text = "Accept this character.";
            linkLabel1.Position = new Vector2(label1.Position.X, 300);
            linkLabel1.Selected += new EventHandler(linkLabel1_Selected);

            ControlManager.Add(linkLabel1);

            characterImage = new PictureBox(
                characterImages[0, 0], 
                new Rectangle(500, 200, 96, 96), 
                new Rectangle(0, 0, 32, 32));
            ControlManager.Add(characterImage);

            ControlManager.NextControl();
        }
        private void CreateControls()
        {
            Texture2D leftTexture = Game.Content.Load<Texture2D>(@"GUI/leftarrow");
            Texture2D righTexture = Game.Content.Load<Texture2D>(@"GUI/rightarrow");
            Texture2D stopTexture = Game.Content.Load<Texture2D>(@"GUI/stopshield");

            backgroundImage = new PictureBox(Game.Content.Load<Texture2D>(@"Backgrounds/title"),
                                             gameRef.ScreenRectangle);
            ControlManager.Add(backgroundImage);

            Label label = new Label();

            label.Text = "Predict The Chosen One";
            label.Size = label.SpriteFont.MeasureString(@"Fonts/ControlFont");
            label.Position = new Vector2((gameRef.Window.ClientBounds.Width - label.Size.X) / 2 - 25, 400);

            ControlManager.Add(label);

            genderSelector = new LeftRightSelector(leftTexture, righTexture, stopTexture);
            genderSelector.SetItems(genderItems, 40);
            genderSelector.Position = new Vector2(395, 475);
            genderSelector.Selected += new EventHandler(SelectionChanged);

            ControlManager.Add(genderSelector);

            classSelector = new LeftRightSelector(leftTexture, righTexture, stopTexture);
            classSelector.SetItems(classItems, 40);
            classSelector.Position = new Vector2(395, 550);
            classSelector.Selected += SelectionChanged;

            ControlManager.Add(classSelector);

            LinkLabel link = new LinkLabel();
            link.Text = "Accept His Fate";
            link.Position = new Vector2(label.Position.X + 45, 625);
            link.Selected = new EventHandler(LinkLabel_Selected);

            ControlManager.Add(link);

            characterBox = new PictureBox(characterImages[0,0],
                                          new Rectangle(470,260,96,96),
                                          new Rectangle(0,0,32,32));

            ControlManager.Add(characterBox);

            ControlManager.NextControl();
        }
Esempio n. 5
0
        private void CreateControls(ContentManager Content)
        {
            backgroundImage = new PictureBox(
                Game.Content.Load<Texture2D>(@"Backgrounds\titlescreen"),
                GameRef.ScreenRectangle);
            ControlManager.Add(backgroundImage);

            Vector2 nextControlPosition = new Vector2(300, 150);

            pointsRemaining = new Label();
            pointsRemaining.Text = "Skill Points: " + unassignedPoints.ToString();
            pointsRemaining.Position = nextControlPosition;

            nextControlPosition.Y += ControlManager.SpriteFont.LineSpacing + 10f;

            ControlManager.Add(pointsRemaining);

            foreach (string s in DataManager.SkillData.Keys)
            {
                SkillData data = DataManager.SkillData[s];

                Label label = new Label();
                label.Text = data.Name;
                label.Type = data.Name;

                label.Position = nextControlPosition;

                Label sLabel = new Label();
                sLabel.Text = "0";

                sLabel.Position = new Vector2(
                    nextControlPosition.X + 300,
                    nextControlPosition.Y);

                LinkLabel linkLabel = new LinkLabel();
                linkLabel.TabStop = true;
                linkLabel.Text = "Add";
                linkLabel.Type = data.Name;

                linkLabel.Position = new Vector2(
                    nextControlPosition.X + 390,
                    nextControlPosition.Y);

                nextControlPosition.Y += ControlManager.SpriteFont.LineSpacing + 10f;

                linkLabel.Selected += addSkillLabel_Selected;

                ControlManager.Add(label);
                ControlManager.Add(sLabel);
                ControlManager.Add(linkLabel);

                skillLabels.Add(new SkillLabelSet(label, sLabel, linkLabel));
            }

            nextControlPosition.Y += ControlManager.SpriteFont.LineSpacing + 10f;

            LinkLabel undoLabel = new LinkLabel();
            undoLabel.Text = "Undo";
            undoLabel.Position = nextControlPosition;
            undoLabel.TabStop = true;
            undoLabel.Selected += new EventHandler(undoLabel_Selected);
            nextControlPosition.Y += ControlManager.SpriteFont.LineSpacing + 10f;

            ControlManager.Add(undoLabel);
            
            LinkLabel acceptLabel = new LinkLabel();
            acceptLabel.Text = "Accept Changes";
            acceptLabel.Position = nextControlPosition;
            acceptLabel.TabStop = true;
            acceptLabel.Selected += new EventHandler(acceptLabel_Selected);

            ControlManager.Add(acceptLabel);
            ControlManager.NextControl();
        }