Exemplo n.º 1
0
        public override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            if (!firstText)
            {
                foreach (var s in input.KeysPressedInLastFrame)
                {
                    Output += s;
                }
            }
            else
            {
                foreach (var s in input.KeysPressedInLastFrame)
                {
                    Output   += "*";
                    Password += s;
                }
            }

            keyboard.Draw();
            if (Done)
            {
                return;
            }
            spriteBatch.Begin();
            //spriteBatch.DrawString(sfont, keyboard.Output, new Vector2(10, GraphicsDevice.Viewport.Height - 30), Color.LawnGreen);
            if (!firstText)
            {
                spriteBatch.DrawString(sfont, "User Name " + Output, new Vector2(10, GraphicsDevice.Viewport.Height - 60), Color.Red);
            }
            else
            {
                spriteBatch.DrawString(sfont, "Password " + Output, new Vector2(10, GraphicsDevice.Viewport.Height - 60), Color.Red);
            }
            //spriteBatch.DrawString(sfont, Name, new Vector2(200, 400), Color.White);
            //spriteBatch.DrawString(sfont, Password, new Vector2(200, 440), Color.White);
            spriteBatch.End();

            base.Draw(gameTime);
        }
Exemplo n.º 2
0
        public override void Draw(GameTime gameTime)
        {
            //Draws the background for the keyboard
            GraphicsDevice.Clear(Color.Turquoise);
            if (!firstText)
            {
                foreach (var s in input.KeysPressedInLastFrame)
                {
                    Output += s;
                }
            }
            else
            {
                foreach (var s in input.KeysPressedInLastFrame)
                {
                    Output   += "*";
                    Password += s;
                }
            }

            keyboard.Draw();
            if (Done)
            {
                return;
            }
            spriteBatch.Begin();
            if (!firstText)
            {
                spriteBatch.DrawString(sfont, "User Name " + Output, new Vector2(10, GraphicsDevice.Viewport.Height - 60), Color.Black); //draws the user name that the player inputs
            }
            else
            {
                spriteBatch.DrawString(sfont, "Password " + Output, new Vector2(10, GraphicsDevice.Viewport.Height - 60), Color.Black);  //draws the password that the player inputs
            }
            spriteBatch.End();

            base.Draw(gameTime);
        }