Exemple #1
0
        public void Draw(Microsoft.Xna.Framework.GameTime gameTime, ref Microsoft.Xna.Framework.Graphics.SpriteBatch sp, ref Microsoft.Xna.Framework.GraphicsDeviceManager g, ref Microsoft.Xna.Framework.Graphics.SpriteFont font)
        {
            sp.Begin();

            /// Logic for drawing the ActiveBackground
            ActiveBackground.DrawSky();
            ActiveBackground.DrawSunrays();
            ActiveBackground.DrawFlowers();
            ActiveBackground.DrawGrass();
            ActiveBackground.DrawSun();
            ActiveBackground.DrawCloud1();
            ActiveBackground.DrawCloud2();
            ActiveBackground.DrawCloud3();
            ActiveBackground.DrawCloud4();
            ActiveBackground.DrawCloud5();

            // Draws the Background-Image
            // sp.Draw(background, new Rectangle(0, 0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height), Color.White);

            // Draws the player-picture in question to detailview
            // sp.Draw(player_picture, detailPictureOutlines, Color.White);

            sp.Draw(player_picture, new Rectangle((int)(bZero * 0.300), (int)(hZero * 0.200), (int)(bZero * 0.400), (int)(hZero * 0.600)), Color.White);

            // Draws the caption in the Topleft-Corner
            // sp.DrawString(font, "Detailview - Click anywhere to return", new Vector2(20, 20), Color.Black);

            // Draws the caption that tells the player how to return to the highscore-tablescreen
            sp.DrawString(font, "Click on the Background to return", new Vector2((int)(bZero * 0.300), 40), Color.White);
            sp.End();
        }
Exemple #2
0
        public void Draw(Microsoft.Xna.Framework.GameTime gameTime, ref Microsoft.Xna.Framework.Graphics.SpriteBatch sp, ref Microsoft.Xna.Framework.GraphicsDeviceManager graphics, ref Microsoft.Xna.Framework.Graphics.SpriteFont font)
        {
            sp.Begin();

            g.Clear(Color.Black);

            /// Logic for drawing the ActiveBackground
            ActiveBackground.DrawSky();
            ActiveBackground.DrawSunrays();
            ActiveBackground.DrawFlowers();
            ActiveBackground.DrawGrass();
            ActiveBackground.DrawSun();
            ActiveBackground.DrawCloud1();
            ActiveBackground.DrawCloud2();
            ActiveBackground.DrawCloud3();
            ActiveBackground.DrawCloud4();
            ActiveBackground.DrawCloud5();

            // Draws the Background-Image
            // sp.Draw(background, new Rectangle(0, 0, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height), Color.White);

            // sp.DrawString(font, "Options", new Vector2(20, 20), Color.White);

            foreach (Button btn in bl)
            {
                sp.Draw(btn.Texture, btn.Position, btn.SourceRectangle, btn.Color, btn.Rotation, btn.Origin, btn.Scale, btn.Effect, btn.LayerDepth);
            }

            sp.End();
        }
Exemple #3
0
        public void Draw(Microsoft.Xna.Framework.GameTime gameTime, ref Microsoft.Xna.Framework.Graphics.SpriteBatch sp, ref Microsoft.Xna.Framework.GraphicsDeviceManager graphics, ref Microsoft.Xna.Framework.Graphics.SpriteFont font)
        {
            sp.Begin();
            g.Clear(Color.Black);

            /// Logic for drawing the ActiveBackground
            ActiveBackground.DrawSky();
            ActiveBackground.DrawSunrays();
            ActiveBackground.DrawFlowers();
            ActiveBackground.DrawGrass();
            ActiveBackground.DrawSun();
            ActiveBackground.DrawCloud1();
            ActiveBackground.DrawCloud2();
            ActiveBackground.DrawCloud3();
            ActiveBackground.DrawCloud4();
            ActiveBackground.DrawCloud5();

            // Draws the Background-Image
            // sp.Draw(background, new Rectangle(0, 0, bZero, hZero), Color.White);

            // Top-Left corner caption
            // sp.DrawString(font, "Endgame", new Vector2(20, 20), Color.White);

            // The Scoreboard
            sp.DrawString(GameSpecs.scoreFont, Convert.ToInt32(Timer.Score).ToString(), new Vector2((int)(bZero * 0.38), (int)(hZero * 0.011)), Color.OrangeRed);

            // The Placeholder-graphic for the KinectStream
            sp.Draw(placeholder, new Rectangle((int)(bZero * 0.300), (int)(hZero * 0.200), (int)(bZero * 0.400), (int)(hZero * 0.600)), Color.White);

            // The Countdown for taking the photo
            sp.DrawString(GameSpecs.scoreFont, Math.Round(Countdown.Counter).ToString(), new Vector2((float)(bZero / 2) - 80, (float)(hZero - 160)), Color.Turquoise);

            if (Session.PhotoTaken == true)
            {
                // Draw the Button(s)
                foreach (Button btn in bl)
                {
                    sp.Draw(btn.Texture, btn.Position, btn.SourceRectangle, btn.Color, btn.Rotation, btn.Origin, btn.Scale, btn.Effect, btn.LayerDepth);
                }
            }

            sp.End();
        }
Exemple #4
0
        public void Draw(Microsoft.Xna.Framework.GameTime gameTime, ref SpriteBatch sp, ref GraphicsDeviceManager graphics, ref SpriteFont font)
        {
            sp.Begin();
            g.Clear(Color.Black);

            /// Logic for drawing the ActiveBackground
            ActiveBackground.DrawSky();
            ActiveBackground.DrawSunrays();
            ActiveBackground.DrawFlowers();
            ActiveBackground.DrawGrass();
            ActiveBackground.DrawSun();
            ActiveBackground.DrawCloud1();
            ActiveBackground.DrawCloud2();
            ActiveBackground.DrawCloud3();
            ActiveBackground.DrawCloud4();
            ActiveBackground.DrawCloud5();

            // Draws the Background-Image
            // sp.Draw(background, new Rectangle(0, 0, bZero, hZero), Color.White);

            // "Cheating"-Labels: Used for development-purposes only
            // sp.DrawString(font, GameSpecs.CurrentCard.ToString(), new Vector2((int)(bZero * 0.020), hZero - 80),Color.Violet);
            // sp.DrawString(font, Session.PairsUntilWin.ToString(), new Vector2((int)(bZero * 0.020), hZero - 40), Color.Orange);
            // sp.DrawString(font, Session.TurnedCards.Count.ToString(), new Vector2((int)(bZero * 0.020), hZero - 120), Color.Black);

            // Draw the Button(s)
            foreach (Button btn in bl)
            {
                sp.Draw(btn.Texture, btn.Position, btn.SourceRectangle, btn.Color, btn.Rotation, btn.Origin, btn.Scale, btn.Effect, btn.LayerDepth);
            }

            // The Scoreboard
            sp.DrawString(GameSpecs.scoreFont, Convert.ToInt32(Timer.Score).ToString(), new Vector2((int)(bZero * 0.40), (int)(hZero * 0.011)), Color.OrangeRed);

            GameLogic(ref sp, ref graphics);

            sp.End();
        }
        public void Draw(Microsoft.Xna.Framework.GameTime gameTime, ref Microsoft.Xna.Framework.Graphics.SpriteBatch sp, ref Microsoft.Xna.Framework.GraphicsDeviceManager g, ref Microsoft.Xna.Framework.Graphics.SpriteFont font)
        {
            sp.Begin();

            g.GraphicsDevice.Clear(Color.Black);

            /// Logic for drawing the ActiveBackground
            ActiveBackground.DrawSky();
            ActiveBackground.DrawSunrays();
            ActiveBackground.DrawFlowers();
            ActiveBackground.DrawGrass();
            ActiveBackground.DrawSun();
            ActiveBackground.DrawCloud1();
            ActiveBackground.DrawCloud2();
            ActiveBackground.DrawCloud3();
            ActiveBackground.DrawCloud4();
            ActiveBackground.DrawCloud5();

            // sp.Draw(background, new Rectangle(0, 0, g.PreferredBackBufferWidth, g.PreferredBackBufferHeight), Color.White);

            // sp.DrawString(font, "Highscore", new Vector2(20, 20), Color.Black);

            /// <summary>
            /// Draws all the Lines necessary for the table to be displayed
            /// </summary>
            int index = 0;

            foreach (Rectangle line in lines)
            {
                sp.Draw(lineTexture, lines[index], Color.OrangeRed);
                index++;
            }

            int offsetX = (int)Math.Round((double)g.PreferredBackBufferWidth * 0.020);
            int offsetY = (int)Math.Round((double)g.PreferredBackBufferHeight * 0.020);

            /// <summary>
            /// Draws the linenumbers onto the table
            /// </summary>
            for (int i = 0; i < 10; i++)
            {
                switch (i)
                {
                case 0:
                {
                    sp.DrawString(GameSpecs.scoreFont, (i + 1).ToString(), new Vector2(lines[i].X + offsetX, lines[i].Y - (int)(offsetY * 10)), Color.OrangeRed);
                    break;
                }

                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                {
                    sp.DrawString(font, (i + 1).ToString(), new Vector2(lines[i - 1].X + offsetX, lines[i - 1].Y + offsetY), Color.OrangeRed);
                    break;
                }
                }
            }

            ///<summary>
            /// Writes the Highscores into the table
            ///</summary>

            int[] scores = scoreValues.ToArray();

            for (int i = 0; i < 10; i++)
            {
                if (i == 0)
                {
                    sp.DrawString(GameSpecs.scoreFont, scores[i].ToString(), new Vector2(lines[i].X + offsetX * 20, lines[i].Y + (int)(offsetY - offsetY * 11)), Color.OrangeRed);
                }
                else
                {
                    sp.DrawString(font, scores[i].ToString(), new Vector2(lines[i - 1].X + offsetX * 4, lines[i - 1].Y + offsetY), Color.OrangeRed);
                }
            }

            // Draw the Button(s)
            foreach (Button btn in bl)
            {
                sp.Draw(btn.Texture, new Rectangle((int)btn.Position.X, (int)btn.Position.Y, btn.SourceRectangle.Width, btn.SourceRectangle.Height), Color.White);
            }

            List <int> dimensions = Extension.CalculateDimensionsInPixel(ref g);

            int pictureWidth  = 0;
            int pictureHeight = 0;

            if (g.GraphicsDevice.DisplayMode.Height < 1080)
            {
                pictureHeight = 150;
                pictureWidth  = 150;
            }
            else
            {
                pictureHeight = 200;
                pictureWidth  = 200;
            }
            // Draws the picture of the leader of the highscore-ladder to the screen
            sp.Draw(player_picture_frame, new Rectangle((dimensions[6] + dimensions[9]) - 15, dimensions[4] - 15, pictureWidth + 30, pictureHeight + 30), Color.White);
            sp.Draw(leader_picture, new Rectangle(dimensions[6] + dimensions[9], dimensions[4], pictureWidth, pictureHeight), Color.White);

            sp.End();
        }