Esempio n. 1
0
        public override void DrawAbove(GameContext context)
        {
            XnaGraphics xna = new XnaGraphics(context);
            xna.DrawStringCentered(context.Camera.Width / 2, 50, "τυχαία", "TitleFont");
            xna.DrawStringCentered(context.Camera.Width / 2, 200, "(tychaía)", "SubtitleFont");

            MouseState state = Mouse.GetState();
            foreach (Button b in this.m_Buttons)
                b.Process(xna, state);

            xna.DrawStringCentered(context.Camera.Width / 2, 750, "Using static seed: " + m_StaticSeed.ToString(), "Arial");
        }
Esempio n. 2
0
        public override void DrawAbove(GameContext context)
        {
            // Are we waiting for players?
            #if MULTIPLAYER
            if (this.m_GlobalSession.Waiting || (this.m_GlobalSession.LoadingInitialData && !LocalNode.Singleton.IsServer))
            #else
            if (this.m_GlobalSession.Waiting)
            #endif
            {
                XnaGraphics graphics = new XnaGraphics(context);
                graphics.FillRectangle(new Rectangle(0, 0, context.Graphics.GraphicsDevice.Viewport.Width, context.Graphics.GraphicsDevice.Viewport.Height), Color.Black);
                int dialogX = context.Graphics.GraphicsDevice.Viewport.X + context.Graphics.GraphicsDevice.Viewport.Width / 2 - 300;
                int dialogY = context.Graphics.GraphicsDevice.Viewport.Y + context.Graphics.GraphicsDevice.Viewport.Height / 2 - 200;
                graphics.FillRectangle(new Rectangle(dialogX, dialogY, 600, 400), Color.DarkSlateGray);
                graphics.DrawStringCentered(dialogX + 300, dialogY + 8, this.m_GlobalSession.LobbyMessage, "BigArial");
                graphics.DrawStringCentered(dialogX + 300, dialogY + 32, "Press enter to toggle ready status.");
                int a = 0;
                for (int i = 0; i < this.m_GlobalSession.Players.Count; i++)
                {
                    Player p = this.m_GlobalSession.Players[i];
                    if (p.Ready)
                        graphics.DrawStringLeft(dialogX + 8, dialogY + 48 + a * 16, "Player " + a + " (" + p.PlayerID + ") ready.");
                    else
                        graphics.DrawStringLeft(dialogX + 8, dialogY + 48 + a * 16, "Player " + a + " (" + p.PlayerID + ") not ready.");
                    a++;
                }
                return;
            }

            // Handle game normally.
            if (this.m_ActiveLevel != null)
                this.m_ActiveLevel.DrawAbove(context);
            this.m_UiManager.Draw(this, context, new XnaGraphics(context));
        }
Esempio n. 3
0
 public void Process(XnaGraphics xna, MouseState mouse)
 {
     if (this.m_PulseValue >= 1)
         this.m_PulseModeUp = false;
     else if (this.m_PulseValue <= 0)
         this.m_PulseModeUp = true;
     this.m_PulseValue += this.m_PulseModeUp ? 0.01 : -0.01;
     if (this.m_Area.Contains(mouse.X, mouse.Y) && mouse.LeftButton == ButtonState.Pressed)
         this.m_OnClick();
     if (this.m_Area.Contains(mouse.X, mouse.Y))
         xna.FillRectangle(this.m_Area, new Color(1f, 1f, 1f, 0.25f + (float)(this.m_PulseValue / 2.0)).ToPremultiplied());
     else
         xna.FillRectangle(this.m_Area, new Color(1f, 1f, 1f, 0.1f + (float)(this.m_PulseValue / 32.0)).ToPremultiplied());
     xna.DrawStringCentered(this.m_Area.X + this.m_Area.Width / 2, this.m_Area.Y + 4, this.m_Text, "ButtonFont");
 }
Esempio n. 4
0
        public override void Draw(World world, XnaGraphics graphics)
        {
            this.m_World = world as RedMeansGoWorld;
            base.Draw(world, graphics);

            graphics.DrawSprite((int)this.X, (int)this.Y, this.Width - 8, this.Height - 8, "player.powerup", this.PowerupColor, false, this.Rotation,
                                new Vector2(54 / 2, 54 / 2));

            string msg;
            if (this.Health <= 0)
                msg = "You win.  They died.";
            else
                msg = "Distance to Heart: " + (this.Health * 150).ToString("F2") + "cm";
            graphics.DrawStringCentered((int)this.X, (int)this.Y + 40, msg);
            RedMeansGoGame.SetWindowTitle(msg);
        }