Ejemplo n.º 1
0
        public override void ProcessCanvas(TextCanvas canvas)
        {
            canvas.ClearColor(Black);

            canvas.WriteTextCenter(2, "                       ", White, DarkRed);
            canvas.WriteTextCenter(3, "   <<< GAME OVER >>>   ", White, DarkRed);
            canvas.WriteTextCenter(4, "                       ", White, DarkRed);

            canvas.WriteTextCenter(7, $"{gameOverInfo.Reason}", Yellow, Black);

            canvas.WriteTextCenter(10, $"Player: {gameOverInfo.PlayerName}", Lime, Black);
            canvas.WriteTextCenter(12, $"SCORE: {gameOverInfo.Score}", LightTeal, Black);

            if (placement.HasValue)
            {
                canvas.WriteTextCenter(15, $"Congratulations!", White, Black);
                canvas.WriteTextCenter(16, $"You have earned enough points to be ranked!", Silver, Black);

                int x = placementImage.Size.AsRectangle.CenterAt(canvas.Size.AsRectangle.Center).TopLeft.X;
                int y = canvas.Size.Height - placementImage.Size.Height - 5;

                canvas.DrawImage(placementImage, new Point(x, y));
            }

            canvas.WriteTextCenter(canvas.Size.Height - 2, "-- Presc ESC to back to main menu --", Silver, Black);
        }
Ejemplo n.º 2
0
        //====== public methods

        public void DrawCenter(TextCanvas canvas, int y)
        {
            int currentScore = scoreStatus.Value;

            if (lastScore != currentScore || lastImage is null)
            {
                lastImage = new BigDigitsValueRenderer(currentScore, ForeColor).RenderImage();
                lastScore = currentScore;
            }

            int xOffset = (canvas.Size.Width / 2) - (lastImage.Size.Width / 2);

            canvas.DrawImage(lastImage, new Point(xOffset, y));
        }