コード例 #1
0
        public QuestLogUI()
        {
            // Quest pages
            questInfoBars = new List <QuestInfoBarUI>();
            //currentIndex = 0;

            // this info...
            this.Size      = new Vector2(600, 400);
            this.Alignment = ControlAlignment.Center;

            // Header container
            Container headerContainer = new Container();

            headerContainer.Size      = new Vector2(this.Size.X, 20);
            headerContainer.Alignment = ControlAlignment.Left;
            //headerContainer.parent = this;
            Add(headerContainer);

            // Exit quest log
            Button closeButton = new Button();

            closeButton.Size      = new Vector2(15, 15);
            closeButton.Location  = new Vector2(5, (headerContainer.Size.Y / 2) - 7.5f);
            closeButton.Alignment = ControlAlignment.Right;
            closeButton.Text      = "X";
            closeButton.Click    += closeButton_Click;
            //closeButton.parent = headerContainer;
            headerContainer.Add(closeButton);

            // Header
            questLogHeaderLabel           = new Label();
            questLogHeaderLabel.Alignment = ControlAlignment.Center;
            questLogHeaderLabel.Text      = "QUEST LOG";
            questLogHeaderLabel.Color     = Color.Black;
            //questLogHeaderLabel.parent = headerContainer;
            headerContainer.Add(questLogHeaderLabel);

            // Quest bar container
            questBarsContainer           = new Container();
            questBarsContainer.Alignment = ControlAlignment.Left;
            questBarsContainer.Size      = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .85f);
            questBarsContainer.Location  = new Vector2(0, headerContainer.Size.Y);
            //questBarsContainer.parent = this;
            Add(questBarsContainer);

            // Forward backward button container

            // Quest UI to display more info on the quest.
            questUI = new QuestUI(new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .85f));
            //questUI.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .80f);
            questUI.Alignment = ControlAlignment.Right;
            questUI.Location  = new Vector2(0, headerContainer.Size.Y);
            //questUI.parent = this;
            Add(questUI);

            // quest buttons container.
            questActionsContainer           = new Container();
            questActionsContainer.Alignment = ControlAlignment.Right;
            questActionsContainer.Size      = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .15f);
            questActionsContainer.Location  = new Vector2(0, questUI.Size.Y + headerContainer.Size.Y);
            //questActionsContainer.parent = this;
            Add(questActionsContainer);

            // the buttons...
            startQuestButton           = new Button();
            startQuestButton.Alignment = ControlAlignment.Center;
            startQuestButton.Size      = new Vector2(100, 50);
            startQuestButton.Location  = new Vector2(-60, 0);
            startQuestButton.IsActive  = false;
            startQuestButton.Text      = "Start Quest";
            startQuestButton.Click    += startQuestButton_Click;
            startQuestButton.Click    += closeButton_Click;
            //startQuestButton.parent = questActionsContainer;
            questActionsContainer.Add(startQuestButton);

            stopQuestButton           = new Button();
            stopQuestButton.Alignment = ControlAlignment.Center;
            stopQuestButton.Size      = new Vector2(100, 50);
            stopQuestButton.Location  = new Vector2(60, 0);
            stopQuestButton.IsActive  = false;
            stopQuestButton.Text      = "Stop Quest";
            stopQuestButton.Click    += stopQuestButton_Click;
            //stopQuestButton.parent = questActionsContainer;
            questActionsContainer.Add(stopQuestButton);

            // page button container
            Container pageButtonContainer = new Container();

            pageButtonContainer.Alignment = ControlAlignment.Left;
            pageButtonContainer.Size      = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .15f);
            pageButtonContainer.Location  = new Vector2(0, questUI.Size.Y + headerContainer.Size.Y);
            //pageButtonContainer.parent = this;
            Add(pageButtonContainer);

            // forward button
            pageForwardButton           = new Button();
            pageForwardButton.Alignment = ControlAlignment.Center;
            pageForwardButton.Size      = new Vector2(100, 50);
            pageForwardButton.Location  = new Vector2(70, 0);
            pageForwardButton.IsActive  = false;
            pageForwardButton.Text      = "Forward >";
            pageForwardButton.Click    += pageForwardButton_Click;
            //pageForwardButton.parent = pageButtonContainer;
            pageButtonContainer.Add(pageForwardButton);

            // back button
            pageBackwardButton           = new Button();
            pageBackwardButton.Alignment = ControlAlignment.Center;
            pageBackwardButton.Size      = new Vector2(100, 50);
            pageBackwardButton.Location  = new Vector2(-70, 0);
            pageBackwardButton.IsActive  = false;
            pageBackwardButton.Text      = "< Backward";
            pageBackwardButton.Click    += pageBackwardButton_Click;
            //pageBackwardButton.parent = pageButtonContainer;
            pageButtonContainer.Add(pageBackwardButton);

            currentPageLabel           = new Label();
            currentPageLabel.Alignment = ControlAlignment.Center;
            currentPageLabel.Text      = "{0} / {1}";
            pageButtonContainer.Add(currentPageLabel);
        }
コード例 #2
0
        public QuestLogUI()
        {
            // Quest pages
            questInfoBars = new List<QuestInfoBarUI>();
            //currentIndex = 0;

            // this info...
            this.Size = new Vector2(600, 400);
            this.Alignment = ControlAlignment.Center;

            // Header container
            Container headerContainer = new Container();
            headerContainer.Size = new Vector2(this.Size.X, 20);
            headerContainer.Alignment = ControlAlignment.Left;
            //headerContainer.parent = this;
            Add(headerContainer);

            // Exit quest log
            Button closeButton = new Button();
            closeButton.Size = new Vector2(15, 15);
            closeButton.Location = new Vector2(5, (headerContainer.Size.Y / 2) - 7.5f);
            closeButton.Alignment = ControlAlignment.Right;
            closeButton.Text = "X";
            closeButton.Click += closeButton_Click;
            //closeButton.parent = headerContainer;
            headerContainer.Add(closeButton);

            // Header
            questLogHeaderLabel = new Label();
            questLogHeaderLabel.Alignment = ControlAlignment.Center;
            questLogHeaderLabel.Text = "QUEST LOG";
            questLogHeaderLabel.Color = Color.Black;
            //questLogHeaderLabel.parent = headerContainer;
            headerContainer.Add(questLogHeaderLabel);

            // Quest bar container
            questBarsContainer = new Container();
            questBarsContainer.Alignment = ControlAlignment.Left;
            questBarsContainer.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .85f);
            questBarsContainer.Location = new Vector2(0, headerContainer.Size.Y);
            //questBarsContainer.parent = this;
            Add(questBarsContainer);

            // Forward backward button container

            // Quest UI to display more info on the quest.
            questUI = new QuestUI(new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .85f));
            //questUI.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .80f);
            questUI.Alignment = ControlAlignment.Right;
            questUI.Location = new Vector2(0, headerContainer.Size.Y);
            //questUI.parent = this;
            Add(questUI);

            // quest buttons container.
            questActionsContainer = new Container();
            questActionsContainer.Alignment = ControlAlignment.Right;
            questActionsContainer.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .15f);
            questActionsContainer.Location = new Vector2(0, questUI.Size.Y + headerContainer.Size.Y);
            //questActionsContainer.parent = this;
            Add(questActionsContainer);

            // the buttons...
            startQuestButton = new Button();
            startQuestButton.Alignment = ControlAlignment.Center;
            startQuestButton.Size = new Vector2(100, 50);
            startQuestButton.Location = new Vector2(-60, 0);
            startQuestButton.IsActive = false;
            startQuestButton.Text = "Start Quest";
            startQuestButton.Click += startQuestButton_Click;
            startQuestButton.Click += closeButton_Click;
            //startQuestButton.parent = questActionsContainer;
            questActionsContainer.Add(startQuestButton);

            stopQuestButton = new Button();
            stopQuestButton.Alignment = ControlAlignment.Center;
            stopQuestButton.Size = new Vector2(100, 50);
            stopQuestButton.Location = new Vector2(60, 0);
            stopQuestButton.IsActive = false;
            stopQuestButton.Text = "Stop Quest";
            stopQuestButton.Click += stopQuestButton_Click;
            //stopQuestButton.parent = questActionsContainer;
            questActionsContainer.Add(stopQuestButton);

            // page button container
            Container pageButtonContainer = new Container();
            pageButtonContainer.Alignment = ControlAlignment.Left;
            pageButtonContainer.Size = new Vector2(this.Size.X / 2, (this.Size.Y - headerContainer.Size.Y) * .15f);
            pageButtonContainer.Location = new Vector2(0, questUI.Size.Y + headerContainer.Size.Y);
            //pageButtonContainer.parent = this;
            Add(pageButtonContainer);

            // forward button
            pageForwardButton = new Button();
            pageForwardButton.Alignment = ControlAlignment.Center;
            pageForwardButton.Size = new Vector2(100, 50);
            pageForwardButton.Location = new Vector2(70, 0);
            pageForwardButton.IsActive = false;
            pageForwardButton.Text = "Forward >";
            pageForwardButton.Click += pageForwardButton_Click;
            //pageForwardButton.parent = pageButtonContainer;
            pageButtonContainer.Add(pageForwardButton);

            // back button
            pageBackwardButton = new Button();
            pageBackwardButton.Alignment = ControlAlignment.Center;
            pageBackwardButton.Size = new Vector2(100, 50);
            pageBackwardButton.Location = new Vector2(-70, 0);
            pageBackwardButton.IsActive = false;
            pageBackwardButton.Text = "< Backward";
            pageBackwardButton.Click += pageBackwardButton_Click;
            //pageBackwardButton.parent = pageButtonContainer;
            pageButtonContainer.Add(pageBackwardButton);

            currentPageLabel = new Label();
            currentPageLabel.Alignment = ControlAlignment.Center;
            currentPageLabel.Text = "{0} / {1}";
            pageButtonContainer.Add(currentPageLabel);
        }