コード例 #1
0
 private void onRendered(object sender, RenderedEventArgs e)
 {
     if (isTitleMenuInteractable())
     {
         ui.Draw(e.SpriteBatch);
     }
 }
コード例 #2
0
        public override void draw(SpriteBatch b)
        {
            base.draw(b);
            b.Draw(Game1.staminaRect, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), new Color(0, 0, 0, 192));
            IClickableMenu.drawTextureBox(b, (Game1.viewport.Width - 800) / 2 - 12, 0, 800 + 24, 50 + 12, Color.White);
            IClickableMenu.drawTextureBox(b, (Game1.viewport.Width - 800) / 2 - 12, Game1.viewport.Height - 50 - 12, 800 + 24, 50 + 12, Color.White);

            ui.Draw(b);

            if (keybindingOpt != null)
            {
                int boxX = (Game1.viewport.Width - 650) / 2, boxY = (Game1.viewport.Height - 200) / 2;
                IClickableMenu.drawTextureBox(b, boxX, boxY, 650, 200, Color.White);

                string s  = "Rebinding key: " + keybindingOpt.Name;
                int    sw = (int)Game1.dialogueFont.MeasureString(s).X;
                b.DrawString(Game1.dialogueFont, s, new Vector2((Game1.viewport.Width - sw) / 2, boxY + 20), Game1.textColor);

                s  = "Press a key to rebind";
                sw = (int)Game1.dialogueFont.MeasureString(s).X;
                b.DrawString(Game1.dialogueFont, s, new Vector2((Game1.viewport.Width - sw) / 2, boxY + 100), Game1.textColor);
            }

            drawMouse(b);

            foreach (var label in optHovers)
            {
                if (label.Hover)
                {
                    drawToolTip(b, (string)label.UserData, label.String, null);
                }
            }
        }
コード例 #3
0
        public override void draw(SpriteBatch b)
        {
            base.draw(b);
            b.Draw(Game1.staminaRect, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), new Color(0, 0, 0, 192));

            ui.Draw(b);
        }
コード例 #4
0
        public override void draw(SpriteBatch b)
        {
            base.draw(b);
            IClickableMenu.drawTextureBox(b, xPositionOnScreen, yPositionOnScreen, width, height, Color.White);

            ui.Draw(b);

            drawMouse(b);
        }
コード例 #5
0
 public override void draw(SpriteBatch b)
 {
     base.draw(b);
     b.Draw(Game1.staminaRect, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), new Color(0, 0, 0, 192));
     if (upperRightCloseButton != null)
     {
         upperRightCloseButton.draw(b); // bring it above the backdrop
     }
     ui.Draw(b);
 }
コード例 #6
0
        public override void draw(SpriteBatch b)
        {
            base.draw(b);
            b.Draw(Game1.staminaRect, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), new Color(0, 0, 0, 192));
            IClickableMenu.drawTextureBox(b, (Game1.viewport.Width - 800) / 2 - 32, 32, 800 + 64, 50 + 20, Color.White);
            IClickableMenu.drawTextureBox(b, (Game1.viewport.Width - 800) / 2 - 32, Game1.viewport.Height - 50 - 20 - 32, 800 + 64, 50 + 20, Color.White);

            ui.Draw(b);

            if (keybindingOpt != null)
            {
                b.Draw(Game1.staminaRect, new Rectangle(0, 0, Game1.viewport.Width, Game1.viewport.Height), new Color(0, 0, 0, 192));

                int boxX = (Game1.viewport.Width - 650) / 2, boxY = (Game1.viewport.Height - 200) / 2;
                IClickableMenu.drawTextureBox(b, boxX, boxY, 650, 200, Color.White);

                string s  = "Rebinding key: " + keybindingOpt.Name;
                int    sw = (int)Game1.dialogueFont.MeasureString(s).X;
                b.DrawString(Game1.dialogueFont, s, new Vector2((Game1.viewport.Width - sw) / 2, boxY + 20), Game1.textColor);

                s  = "Press a key to rebind";
                sw = (int)Game1.dialogueFont.MeasureString(s).X;
                b.DrawString(Game1.dialogueFont, s, new Vector2((Game1.viewport.Width - sw) / 2, boxY + 100), Game1.textColor);
            }

            drawMouse(b);

            if (Constants.TargetPlatform != GamePlatform.Android)
            {
                foreach (var label in optHovers)
                {
                    if (!label.Hover)
                    {
                        continue;
                    }
                    string text = (string)label.UserData;
                    if (text != null && !text.Contains("\n"))
                    {
                        text = Game1.parseText(text, Game1.smallFont, 800);
                    }
                    string title = label.String;
                    if (title != null && !title.Contains("\n"))
                    {
                        title = Game1.parseText(title, Game1.dialogueFont, 800);
                    }
                    drawToolTip(b, text, title, null);
                }
            }
        }
コード例 #7
0
 public override void Draw(GameTime gameTime)
 {
     _rootElement.Draw();
     base.Draw(gameTime);
 }
コード例 #8
0
 protected override void DrawCore(GameTime gameTime)
 {
     RootElement.Draw();
 }