Ejemplo n.º 1
0
 public override void Draw(DB.Gui.Graphics g, Microsoft.Xna.Framework.GameTime gameTime, Room.Layer layer)
 {
     if (layer == Room.Layer.Player)
     {
         g.Begin();
         g.Draw(Tool.Icon, Position, Color.White);
         g.End();
     }
 }
Ejemplo n.º 2
0
        public override void Draw(DB.Gui.Graphics g, Microsoft.Xna.Framework.GameTime gameTime, Room.Layer layer)
        {
            int x = 0, y = 0;
            g.Begin();
            g.Draw(DiverGame.White, this.Dimension, Color.White);

            if (diverInInventory)
            {
                if (!isGUIActive)
                {
                    g.DrawStringShadowed(font,
                     "Press Space to open inventory",
                     new Rectangle(0, 100, 400, 20),
                     TextAlignment.Center,
                     Color.White);
                }

            }

            if (isGUIActive)
            {
                Color c = new Color(255, 255, 255, 230);
                x = 400/2 - backgroundTexture.Width / 2;
                y = 300/2 - backgroundTexture.Height / 2;

                g.Draw(backgroundTexture, new Point(x, y), c);
                y += 15;
                g.DrawStringShadowed(font,
                                     "Inventory",
                                     new Rectangle(x, y, backgroundTexture.Width, 20),
                                     TextAlignment.Center,
                                     Color.White);

                int spaceBetween = 30;
                x += 30; y += 20;

                int xOffs = 0;
                foreach (ITool tool in tools)
                {
                    g.Draw(tool.Icon, new Point(x + (xOffs%7)*spaceBetween + 4, y + (xOffs/7)*spaceBetween + 4), Color.White);
                    xOffs += 1;
                }

                g.Draw(toolSelectorTexture, new Point(spaceBetween*(inventorySelected%7) + x, y + (inventorySelected/7)*spaceBetween), Color.White);

            }

            g.End();
        }