Ejemplo n.º 1
0
        public void CreateHistory()
        {
            int Idx = GameLogic.CharHistory;

            TextTitle = GameLogic.CharacterNames[Idx];

            //Animation
            if (TxtTitleCol == Color.Red)
            {
                TxtTitleCol = Color.Yellow;
            }
            else
            {
                TxtTitleCol = Color.Red;
            }

            UI2DRenderer.FillRectangle(new Rectangle(0, 0, 1280, 720), null, new Color(0, 0, 0, 170));
            UI2DRenderer.FillRectangle(new Rectangle(130, 250, Luna.Width, Luna.Height), Luna, Color.White);
            UI2DRenderer.FillRectangle(new Rectangle(50, 190, MenuHistory[Idx].Width, MenuHistory[Idx].Height), MenuHistory[Idx], Color.White);

            UI2DRenderer.FillRectangle(new Rectangle(255, 220, FrameW, FrameH), CarsTextures[Idx], Color.White);
            UI2DRenderer.FillRectangle(new Rectangle(255 - 15, 220 - 15, FrameW + 30, FrameH + 30), Marco, Color.White);

            UI2DRenderer.FillRectangle(new Rectangle(600, 140, 440, 535), null, new Color(0, 0, 0, 255));

            UI2DRenderer.WriteText(new Vector2(610, 155), GameLogic.HistoryPers[Idx], Color.LawnGreen,
                                   CasioFont, new Vector2(0.75f, 0.75f));

            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(new Vector2(0, 50), TextTitle, Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);

            UI2DRenderer.WriteText(new Vector2(450, 670), "Continue", TxtTitleCol,
                                   BladeFont, new Vector2(1.0f, 1.0f));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            UI2DRenderer.WriteText(Vector2.Zero, "Light Direction: " + lightSource.Direction.ToString(),
                                   Color.White, textFont);

            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
        }
Ejemplo n.º 3
0
        protected override void PaintComponent()
        {
            CheckMouseHeldDown();

            textField.RenderWidget();

            // Render the up and down buttons
            Color c = (!enabled || upPressed) ? disabledColor : buttonColor;

            UI2DRenderer.FillRectangle(upArrowBound, null, c);
            c = (!enabled || downPressed) ? disabledColor : buttonColor;
            UI2DRenderer.FillRectangle(downArrowBound, null, c);

            // Render the border of the up and down button
            UI2DRenderer.DrawRectangle(upArrowBound, borderColor, 1);
            UI2DRenderer.DrawRectangle(downArrowBound, borderColor, 1);

            // Render the up and down arrows
            // First render the up arrow
            if (upArrowPoints.Count > 0)
            {
                UI2DRenderer.FillPolygon(upArrowPoints, arrowColor, Point.Zero, UI2DRenderer.PolygonShape.Convex);
                UI2DRenderer.FillPolygon(downArrowPoints, arrowColor, Point.Zero, UI2DRenderer.PolygonShape.Convex);
            }
        }
Ejemplo n.º 4
0
        public void CreateBoxStatus(Vector2 BoxPos, Game_Player Player)
        {
            if (Player.PlyHealth < 0)
            {
                Player.PlyHealth = 0;
            }

            int PosX  = (int)BoxPos.X;
            int PosXP = (int)BoxPos.X + BoxStatusTx[0].Width;
            int PoxY  = (int)BoxPos.Y + 25;
            int Healt = Player.PlyHealth / 5;
            int Popul = Player.Popularity / 5;

            TextTitle = Player.PlyName;
            Color ColorHBar    = new Color(new Vector4(255, 0, 0, 10));
            Color ColorHPolBar = new Color(new Vector4(255, 255, 255, 10));

            UI2DRenderer.FillRectangle(new Rectangle(PosX, PoxY, BoxStatusTx[0].Width, BoxStatusTx[0].Height), BoxStatusTx[0], ColorHBar);
            UI2DRenderer.FillRectangle(new Rectangle(PosX, PoxY + 20, BoxStatusTx[0].Width, BoxStatusTx[0].Height), BoxStatusTx[0], ColorHPolBar);

            PosX += BoxStatusTx[0].Width;
            UI2DRenderer.FillRectangle(new Rectangle(PosX, PoxY, BoxStatusTx[1].Width * Healt, BoxStatusTx[1].Height), BoxStatusTx[1], ColorHBar);
            //UI2DRenderer.FillRectangle(new Rectangle(PosX, PoxY + 20, BoxStatusTx[1].Width * Popul, BoxStatusTx[1].Height), BoxStatusTx[1], ColorHPolBar);

            PosX  += BoxStatusTx[1].Width * Healt;
            PosXP += BoxStatusTx[1].Width * Popul;
            UI2DRenderer.FillRectangle(new Rectangle(PosX, PoxY, BoxStatusTx[2].Width, BoxStatusTx[2].Height), BoxStatusTx[2], ColorHBar);
            //UI2DRenderer.FillRectangle(new Rectangle(PosXP, PoxY + 20, BoxStatusTx[2].Width, BoxStatusTx[2].Height), BoxStatusTx[2], ColorHPolBar);

            UI2DRenderer.WriteText(BoxPos, TextTitle, Color.DarkGray, CalibriFont, new Vector2(0.5f, 0.5f));
        }
Ejemplo n.º 5
0
 public void Dispose()
 {
     comp2Ds.Clear();
     comp3Ds.Clear();
     UI2DRenderer.Dispose();
     UI3DRenderer.Dispose();
 }
Ejemplo n.º 6
0
 public void PutCordenates(string Legend, Vector3 Cord, Vector2 Pos)
 {
     UI2DRenderer.WriteText(Pos,
                            Legend +
                            " X: " + Cord.X.ToString() +
                            " Y: " + Cord.Y.ToString() +
                            " Z: " + Cord.Z.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
 }
Ejemplo n.º 7
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(Vector2.Zero, label, Color.Black,
                                   textFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.Top);

            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            // If car is not null and already added to the physics engine
            if (car != null && ((NewtonPhysics)scene.PhysicsEngine).GetBody(car) != IntPtr.Zero)
            {
                // Gets the keyboard state
                KeyboardState keyboard = Keyboard.GetState();

                // Control the car steering with right and left arrow keys
                if (keyboard.IsKeyDown(Keys.Right))
                {
                    car.SetSteering(-1);
                }
                else if (keyboard.IsKeyDown(Keys.Left))
                {
                    car.SetSteering(1);
                }
                else
                {
                    car.SetSteering(0);
                }

                // Control the car's forward torque with up and down arrow keys
                if (keyboard.IsKeyDown(Keys.Up))
                {
                    car.SetTireTorque(1);
                }
                else if (keyboard.IsKeyDown(Keys.Down))
                {
                    car.SetTireTorque(-1);
                }
                else
                {
                    car.SetTireTorque(0);
                }

                // Control the hand brake with space key
                if (keyboard.IsKeyDown(Keys.Space))
                {
                    car.ApplyHandBrakes(1);
                }
                else
                {
                    car.ApplyHandBrakes(0);
                }
            }

            UI2DRenderer.WriteText(new Vector2(5, 30), "Press the following keys to change " +
                                   "the active camera:", Color.Red, textFont, Vector2.One * 0.5f);
            UI2DRenderer.WriteText(new Vector2(5, 50), "'C' -- Car chasing camera",
                                   Color.Red, textFont, Vector2.One * 0.5f);
            UI2DRenderer.WriteText(new Vector2(5, 70), "'F' -- Far camera",
                                   Color.Red, textFont, Vector2.One * 0.5f);
            UI2DRenderer.WriteText(new Vector2(5, 90), "'N' -- Near camera",
                                   Color.Red, textFont, Vector2.One * 0.5f);

            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
        }
Ejemplo n.º 9
0
        protected override void PaintComponent()
        {
            if (!visible)
            {
                return;
            }

            UI2DRenderer.FillRectangle(rect, null, backgroundColor);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Paints dashed border when focused.
        /// </summary>
        protected override void PaintBorder()
        {
            if (!enabled || !focused)
            {
                return;
            }

            UI2DRenderer.DrawRectangle(paintBounds, Color.Yellow, 1);
        }
Ejemplo n.º 11
0
        protected override void PaintBorder()
        {
            if (!visible)
            {
                return;
            }

            UI2DRenderer.DrawRectangle(rect, borderColor, 1);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            // Draw a 2D text string at the center of the screen
            // NOTE: Since scene.Draw(..) (which is called by base.Draw(..)) will clear the
            // background this WriteText function should be called after base.Draw(..).
            UI2DRenderer.WriteText(Vector2.Zero, "Hello World!!", Color.GreenYellow, textFont,
                                   GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.Center);

            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
        }
Ejemplo n.º 13
0
        public void CreateLoading()
        {
            //TextTitle = "PAUSE GAME";

            UI2DRenderer.FillRectangle(new Rectangle(540, 200, Loading.Width, Loading.Height), Loading, Color.White);

            // Draw a 2D text string at the center of the screen
            //UI2DRenderer.WriteText(Vector2.Zero, TextTitle, TxtTitleCol,
            //    PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.Top);
        }
Ejemplo n.º 14
0
 public void PutGameData(int PosX, int PosY)
 {
     UI2DRenderer.WriteText(new Vector2(PosX, PosY + 0), "Actual Level:" + GameLogic.ActualLevel.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
     UI2DRenderer.WriteText(new Vector2(PosX, PosY + 20), "Game State:" + GameLogic.CurrentGameState.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
     UI2DRenderer.WriteText(new Vector2(PosX, PosY + 40), "Game Mode:" + GameLogic.GameMode.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
     UI2DRenderer.WriteText(new Vector2(PosX, PosY + 60), "Multi Mode:" + GameLogic.MultiplayerMode.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
     UI2DRenderer.WriteText(new Vector2(PosX, PosY + 80), "Num Playes:" + GameLogic.NumberPlayers.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
     UI2DRenderer.WriteText(new Vector2(PosX, PosY + 100), "Pause:" + GameLogic.Pause_State.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
     UI2DRenderer.WriteText(new Vector2(PosX, PosY + 120), "Std Screen:" + GameLogic.StateScreen.ToString(), Color.LightCyan, DefaultFont, new Vector2(0.5f, 0.5f));
 }
Ejemplo n.º 15
0
 public void CreateBuilding()
 {
     TxtTitleCol = new Color(255, 10, 10, AlfaColor);
     AlfaColor  -= 3;
     if (AlfaColor < 0)
     {
         AlfaColor = 255;
     }
     // texto en Construccion
     UI2DRenderer.WriteText(new Vector2(10, 5), "Building", TxtTitleCol, BladeFont);
 }
Ejemplo n.º 16
0
        protected override void PaintComponent()
        {
            base.PaintComponent();

            if (label.Length > 0)
            {
                if (textFont != null)
                {
                    UI2DRenderer.WriteText(textPos, label, textColor, textFont);
                }
            }
        }
Ejemplo n.º 17
0
        public void CreateMenuPause()
        {
            int Idx = (int)GameLogic.Pause_State;

            TextTitle = "PAUSE GAME";

            UI2DRenderer.FillRectangle(new Rectangle(450, 200, MenuMPauseSprites[Idx].Width, MenuMPauseSprites[Idx].Height), MenuMPauseSprites[Idx], Color.White);

            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(Vector2.Zero, TextTitle, TxtTitleCol,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.Top);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
#if WINDOWS_PHONE
            UI2DRenderer.WriteText(Vector2.Zero, "Tap the screen to toggle the animation!!", Color.GreenYellow,
                                   textFont);
#else
            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(Vector2.Zero, "Press 'A' to toggle the animation!!", Color.GreenYellow,
                                   textFont);
#endif

            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
        }
Ejemplo n.º 19
0
        protected override void Draw(GameTime gameTime)
        {
            if (useImageSequence)
            {
                if (calibrateNextSequence)
                {
                    Calibrate();

                    if (sequenceID < imageNames.Length - 1)
                    {
                        sequenceID++;
                        ((NullCapture)captureDevice).StaticImageFile = imageNames[sequenceID];
                    }
                    else
                    {
                        FinalizeCalibration();
                    }

                    calibrateNextSequence = false;
                }

                UI2DRenderer.WriteText(Vector2.Zero, "Press ENTER key to proceed to the next image", Color.Yellow,
                                       font, Vector2.One * 0.6f, GoblinEnums.HorizontalAlignment.Center,
                                       GoblinEnums.VerticalAlignment.Bottom);
            }
            else
            {
                timer += (float)gameTime.ElapsedGameTime.TotalMilliseconds;

                // If we are still collecting calibration data
                // - For every 1.5s add calibration data from detected 7*9 chessboard
                if (captureCount < CALIB_COUNT_MAX)
                {
                    if (timer >= CAPTURE_INTERVAL)
                    {
                        Calibrate();
                        timer = 0;
                    }
                }
                else
                {
                    if (!finalized)
                    {
                        FinalizeCalibration();
                    }
                }
            }

            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Renders the caret.
        /// </summary>
        protected virtual void RenderCaret()
        {
            if (drawCaret && textFont != null)
            {
                UI2DRenderer.DrawLine(paintBounds.X + caretPosition.X, caretPosition.Y + textHeight,
                                      paintBounds.X + caretPosition.X, caretPosition.Y, Color.Black, 1);
            }

            if (caretTimer >= caretBlinkInterval)
            {
                drawCaret  = !drawCaret;
                caretTimer = 0;
            }
        }
Ejemplo n.º 21
0
        public void CreateMenuPly()
        {
            int    Idx;
            string NumberPly;

            TextTitle = "Select Your Player";

            UI2DRenderer.FillRectangle(new Rectangle(0, 0, 1280, 720), null, new Color(0, 0, 0, 170));
            UI2DRenderer.FillRectangle(new Rectangle(130, 250, Luna.Width, Luna.Height), Luna, Color.White);

            for (Idx = 0; Idx < 8; Idx++)
            {
                UI2DRenderer.FillRectangle(new Rectangle((int)PosObjMenu[Idx].X, (int)PosObjMenu[Idx].Y, FrameW, FrameH), CarsTextures[Idx], Color.White);
                UI2DRenderer.FillRectangle(new Rectangle((int)PosObjMenu[Idx].X - 15, (int)PosObjMenu[Idx].Y - 15, FrameW + 30, FrameH + 30), Marco, Color.White);
            }

            for (Idx = 0; Idx < GameLogic.NumberPlayers; Idx++)
            {
                UI2DRenderer.DrawRectangle(new Rectangle((int)PosObjMenu[GameLogic.Players[Idx].PlySelect - 1].X,
                                                         (int)PosObjMenu[GameLogic.Players[Idx].PlySelect - 1].Y,
                                                         FrameW,
                                                         FrameH),
                                           GameLogic.Players[Idx].PlayerColor, 5);

                if (!GameLogic.Players[Idx].IsPlyOK)
                {
                    NumberPly = (Idx + 1).ToString();
                }
                else
                {
                    NumberPly = "X";
                }
                //Player Number
                UI2DRenderer.WriteText(new Vector2(PosObjMenu[GameLogic.Players[Idx].PlySelect - 1].X + 8,
                                                   PosObjMenu[GameLogic.Players[Idx].PlySelect - 1].Y + 2),
                                       NumberPly,
                                       GameLogic.Players[Idx].PlayerColor,
                                       BladeFont);
            }

            /******** text For the Screen ********/
            UI2DRenderer.WriteText(new Vector2(0, 50), TextTitle, Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);

            UI2DRenderer.WriteText(new Vector2(1050, 680), TextIP, new Color(255, 10, 10, 255),
                                   CalibriFont, new Vector2(0.8f, 0.8f));

            UI2DRenderer.WriteText(new Vector2(0, 610), TextMsg, new Color(255, 10, 10, 255),
                                   BladeFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);
        }
Ejemplo n.º 22
0
        protected override void PaintComponent()
        {
            base.PaintComponent();

            // Show the highlight when mouse is over
            if (focused)
            {
                UI2DRenderer.DrawRectangle(focusRect, focusedColor, 2);
            }

            if (label.Length > 0 && textFont != null)
            {
                UI2DRenderer.WriteText(textPos, label, textColor, textFont);
            }
        }
Ejemplo n.º 23
0
        protected virtual void GenerateDefaultPlayTexture()
        {
            playTexture = new Texture2D(State.Device, controlButton.Bounds.Width, controlButton.Bounds.Height, false, SurfaceFormat.Bgra5551);

            int          sixth  = controlButton.Bounds.Width / 6;
            List <Point> points = new List <Point>();

            points.Add(new Point(sixth, sixth));
            points.Add(new Point(sixth, controlButton.Bounds.Width - sixth));
            points.Add(new Point(controlButton.Bounds.Width - sixth, controlButton.Bounds.Width / 2));

            UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref playTexture);

            controlButton.TextureColor = buttonColor;
        }
Ejemplo n.º 24
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
#if WINDOWS_PHONE
            UI2DRenderer.WriteText(Vector2.Zero, "Tap the screen to toggle the animation!!", Color.GreenYellow,
                                   textFont);
            UI2DRenderer.WriteText(new Vector2(0, 35), textToPrint, Color.GreenYellow,
                                   textFont);
#else
            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(Vector2.Zero, "Press the 'Space' bar to play the animation!!", Color.Orange,
                                   textFont);
            UI2DRenderer.WriteText(new Vector2(0, 40), textToPrint, Color.Orange,
                                   textFont);
#endif

            scene.Draw(gameTime.ElapsedGameTime, gameTime.IsRunningSlowly);
        }
Ejemplo n.º 25
0
        public void CreateMenuPlayMode()
        {
            int Idx = (int)GameLogic.MultiplayerMode;

            TextTitle = "Select the Multiplayer mode";

            UI2DRenderer.FillRectangle(new Rectangle(0, 0, 1280, 720), null, new Color(0, 0, 0, 170));
            UI2DRenderer.FillRectangle(new Rectangle(130, 250, Luna.Width, Luna.Height), Luna, Color.White);

            UI2DRenderer.FillRectangle(new Rectangle(450, 170, MenuMPlaySprites[Idx].Width, MenuMPlaySprites[Idx].Height), MenuMPlaySprites[Idx], Color.White);

            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(new Vector2(0, 90), TextTitle, Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);

            UI2DRenderer.WriteText(new Vector2(0, 55), TextRobert, Color.Gray,
                                   RoboCopFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);
        }
Ejemplo n.º 26
0
        public void CreateRankingTour()
        {
            int Idx;

            Idx = (int)GameLogic.EndActionTour;

            TextTitle = "Tournament Ranking";

            //Animation
            if (TxtTitleCol == Color.Red)
            {
                TxtTitleCol = Color.Yellow;
            }
            else
            {
                TxtTitleCol = Color.Red;
            }

            UI2DRenderer.FillRectangle(new Rectangle(0, 0, 1280, 720), null, new Color(0, 0, 0, 170));
            UI2DRenderer.FillRectangle(new Rectangle(130, 250, Luna.Width, Luna.Height), Luna, Color.White);
            UI2DRenderer.FillRectangle(new Rectangle(560, 560, MenuTourt[Idx].Width, MenuTourt[Idx].Height), MenuTourt[Idx], Color.White);

            for (Idx = 0; Idx < GameLogic.NumberPlayers; Idx++)
            {
                UI2DRenderer.FillRectangle(new Rectangle((int)PosObjMenu[Idx].X, 220, FrameW, FrameH), CarsTextures[GameLogic.Players[Idx].PlySelect - 1], Color.White);
                UI2DRenderer.FillRectangle(new Rectangle((int)PosObjMenu[Idx].X - 15, 220 - 15, FrameW + 30, FrameH + 30), Marco, Color.White);

                if (GameLogic.Players[Idx].IsDead == true)
                {
                    UI2DRenderer.FillRectangle(new Rectangle((int)PosObjMenu[Idx].X - 15, 220 - 15, FrameW + 30, FrameH + 30), Muerte, Color.White);
                }
                else
                {
                    UI2DRenderer.WriteText(new Vector2((int)PosObjMenu[Idx].X - 5, 160), "Winner!", TxtTitleCol, PuntosFont);
                }

                UI2DRenderer.WriteText(new Vector2((int)PosObjMenu[Idx].X + 10, 425), "Deaths: " + GameLogic.Players[Idx].NumDeads, Color.Red, BladeFont);
                //UI2DRenderer.WriteText(new Vector2((int)PosObjMenu[Idx].X + 10, 460), "Kills: " + GameLogic.Players[Idx].NumKills, Color.Red, BladeFont);
            }

            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(new Vector2(0, 50), TextTitle, Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);
        }
Ejemplo n.º 27
0
        public void CreateEndGame()
        {
            int Idx;

            TextTitle = "Congratulations!!!";

            //Animation
            if (TxtTitleCol == Color.Red)
            {
                TxtTitleCol = Color.Yellow;
            }
            else
            {
                TxtTitleCol = Color.Red;
            }

            UI2DRenderer.FillRectangle(new Rectangle(0, 0, 1280, 720), null, new Color(0, 0, 0, 170));
            UI2DRenderer.FillRectangle(new Rectangle(130, 250, Luna.Width, Luna.Height), Luna, Color.White);
            UI2DRenderer.FillRectangle(new Rectangle(260, 440, Trofeo.Width, Trofeo.Height), Trofeo, Color.White);

            for (Idx = 0; Idx < GameLogic.NumberPlayers; Idx++)
            {
                if (GameLogic.Players[Idx].IsDead == false)
                {
                    UI2DRenderer.WriteText(new Vector2(210 - 5, 160), "Winner!", TxtTitleCol, PuntosFont);

                    UI2DRenderer.FillRectangle(new Rectangle(210, 220, FrameW, FrameH), CarsTextures[GameLogic.Players[Idx].PlySelect - 1], Color.White);
                    UI2DRenderer.FillRectangle(new Rectangle(210 - 15, 220 - 15, FrameW + 30, FrameH + 30), Marco, Color.White);

                    UI2DRenderer.FillRectangle(new Rectangle(600, 250, 600, 300), null, new Color(0, 0, 0, 255));

                    UI2DRenderer.WriteText(new Vector2(610, 255), GameLogic.HistoryEndgame[GameLogic.Players[Idx].PlySelect - 1], Color.LawnGreen,
                                           CasioFont, new Vector2(0.75f, 0.75f));
                }
            }

            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(new Vector2(0, 50), TextTitle, Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);

            UI2DRenderer.WriteText(new Vector2(480, 620), "Continue", TxtTitleCol,
                                   BladeFont, new Vector2(1.0f, 1.0f));
        }
Ejemplo n.º 28
0
        public void CreateMenuSelLevel()
        {
            int Idx = (int)GameLogic.ActualLevel;

            TextTitle = "Select your level";

            UI2DRenderer.FillRectangle(new Rectangle(0, 0, 1280, 720), null, new Color(0, 0, 0, 170));

            UI2DRenderer.FillRectangle(new Rectangle(30, 180, MenuLevelsprites[Idx].Width, MenuLevelsprites[Idx].Height), MenuLevelsprites[Idx], Color.White);

            UI2DRenderer.FillRectangle(new Rectangle(450, 170, Levelsprites[Idx].Width, Levelsprites[Idx].Height), Levelsprites[Idx], Color.White);

            // Draw a 2D text string at the center of the screen
            UI2DRenderer.WriteText(new Vector2(0, 90), TextTitle, Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);

            UI2DRenderer.WriteText(new Vector2(0, 55), TextRobert, Color.Gray,
                                   RoboCopFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);
        }
Ejemplo n.º 29
0
        protected virtual void CreateDefaultButtonArrows()
        {
            upLeftTexture    = new Texture2D(State.Device, upLeftButton.Bounds.Width, upLeftButton.Bounds.Height, false, SurfaceFormat.Bgra5551);
            downRightTexture = new Texture2D(State.Device, downRightButton.Bounds.Width, downRightButton.Bounds.Height, false, SurfaceFormat.Bgra5551);

            int          sixth  = downRightButton.Bounds.Width / 6;
            List <Point> points = new List <Point>();

            upLeftButton.TextureColor    = buttonColor;
            downRightButton.TextureColor = buttonColor;

            if (orientation == GoblinEnums.Orientation.Vertical)
            {
                points.Add(new Point(upLeftButton.Bounds.Width / 2, sixth));
                points.Add(new Point(upLeftButton.Bounds.Width - sixth, upLeftButton.Bounds.Height - sixth));
                points.Add(new Point(sixth, upLeftButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref upLeftTexture);

                points.Clear();
                points.Add(new Point(sixth, sixth));
                points.Add(new Point(downRightButton.Bounds.Width - sixth, sixth));
                points.Add(new Point(downRightButton.Bounds.Width / 2, downRightButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref downRightTexture);
            }
            else
            {
                points.Add(new Point(sixth, upLeftButton.Bounds.Height / 2));
                points.Add(new Point(upLeftButton.Bounds.Width - sixth, sixth));
                points.Add(new Point(upLeftButton.Bounds.Width - sixth, upLeftButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref upLeftTexture);

                points.Clear();
                points.Add(new Point(sixth, sixth));
                points.Add(new Point(downRightButton.Bounds.Width - sixth, downRightButton.Bounds.Height / 2));
                points.Add(new Point(sixth, downRightButton.Bounds.Height - sixth));

                UI2DRenderer.GetPolygonTexture(points, UI2DRenderer.PolygonShape.Convex, ref downRightTexture);
            }
        }
Ejemplo n.º 30
0
        public void CreateCredits()
        {
            int Idx = (int)GameLogic.CreditScreen;

            //Velo
            UI2DRenderer.FillRectangle(new Rectangle(0, 0, 1280, 720), null, new Color(0, 0, 0, 190));
            UI2DRenderer.FillRectangle(new Rectangle(130, 250, Luna.Width, Luna.Height), Luna, Color.White);

            UI2DRenderer.FillRectangle(new Rectangle(74, 200, Credits[Idx].Width, Credits[Idx].Height), Credits[Idx], Color.White);

            //Title 1
            UI2DRenderer.WriteText(new Vector2(0, 30), "Credits:", Color.Gray,
                                   RoboCopFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);
            //Title A
            UI2DRenderer.WriteText(new Vector2(0, 60), "ultimate demolition derby", Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);
            //Title B
            UI2DRenderer.WriteText(new Vector2(0, 110), "on the moon", Color.Red,
                                   PuntosFont, GoblinEnums.HorizontalAlignment.Center, GoblinEnums.VerticalAlignment.None);
        }