Used for displaying hypercubes.
Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameInfoDisplayElement"/> class.
        /// </summary>
        /// <param name="gameInfo">The game info.</param>
        /// <param name="screen">The screen.</param>
        public GameInfoDisplayElement(GameInfo gameInfo, Screen screen)
        {
            this.Position = new tVector2(-500, -500);
            this.Info = gameInfo;

            if (string.IsNullOrEmpty(gameInfo.BoxArt))
            {
                this.background = new HypercubeDisplay(
                    new Rectangle((int)(this.Position.Value.X - 584f / 2f), (int)(this.Position.Value.Y - 700f / 2f), 584, 700),
                    3,
                    screen.random,
                    this.LayerDepth);
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GameInfoDisplay"/> class.
 /// </summary>
 /// <param name="screen">The screen.</param>
 /// <param name="boxArtMenu">The box art menu.</param>
 /// <param name="titlePosition">The title position.</param>
 /// <param name="maxTitleWidth">Width of the max title.</param>
 /// <param name="descriptionPosition">The description position.</param>
 /// <param name="authorsPosition">The authors position.</param>
 /// <param name="borderPosition">The border position.</param>
 public GameInfoDisplay(Screen screen, BoxArtMenu boxArtMenu, Vector2 titlePosition, float maxTitleWidth, Vector2 descriptionPosition, Vector2 borderPosition)
 {
     this.screen = screen;
     this.titlePosition = titlePosition;
     this.boxArtMenu = boxArtMenu;
     this.titleString = new FancyString();
     this.descriptionPosition = descriptionPosition;
     this.descriptionString = new FancyString();
     this.titleBorderPosition = borderPosition;
     this.previousGameInfoSelected = 10000;
     this.maxTitleWidth = maxTitleWidth;
     this.menuHasReset = false;
     this.aAndXButtonDisplay = new FancyString();
     this.aAndXButtonDisplay.Create("#A Play       #X Instructions", borderPosition + new Vector2(0, 160), borderPosition + new Vector2(0, 160), 0.35f, Color.White, "defaultFont", 0.971f, true);
     this.background = new HypercubeDisplay(
         new Rectangle((int)(borderPosition.X - 685f / 2f) - 3, (int)(borderPosition.Y - 370f / 2f) - 3, 685 + 6, 370 + 6),
         3,
         screen.random,
         0.96f);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PauseScreen"/> class.
        /// </summary>
        public PauseScreen()
            : base()
        {
            this.menu = new PauseMenu(
                new Vector2(0, -60),
                new MenuAction[]
                {
                    new MenuAction(ActionType.GoBack, new QuitPauseScreenDelegate()),
                },
                75);

            this.textDrawPosition = new Vector2(0, -225);
            this.textDrawOrigin = FontStatic.Get("defaultFont").MeasureString("Paused") / 2f;
            this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
            this.drawLagTime = DateTime.Now.Ticks + 1000000;
            this.background = new HypercubeDisplay(
                new Rectangle((int)(this.position.Value.X - 584f / 2f) - 3, (int)(this.position.Value.Y - 700f / 2f) - 3, 584 + 6, 700 + 6),
                3,
                this.random,
                0.2f);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GameOverScreen"/> class.
        /// </summary>
        public GameOverScreen(uint score)
            : base()
        {
            this.score = score;
            this.actionAvailableTime = DateTime.Now.Ticks + 30000000;
            GameClock.Pause();

            this.textDrawPosition = new Vector2(0, -125);
            this.textDrawOrigin = FontStatic.Get("defaultFont").MeasureString("Game Over") / 2f;
            this.scoreLogoPosition = new Vector2(0, -20f);
            this.scoreLogoOrigin = FontStatic.Get("defaultFont").MeasureString("Score") / 2f;
            this.scorePosition = new Vector2(0, 50f);
            this.scoreOrigin = FontStatic.Get("defaultFont").MeasureString(Drawer.FormatNumber(this.score)) / 2f;
            this.aButtonPosition = new Vector2(-240f, 150f);
            this.bButtonPosition = new Vector2(100f, 150f);
            this.actionXOffset = new Vector2(50f, 0);
            this.buttonOrigin = FontStatic.Get("ControllerFont").MeasureString(")") / 2f;
            this.aActionOrigin = new Vector2(0, FontStatic.Get("defaultFont").MeasureString("Replay").Y / 2);
            this.bActionOrigin = new Vector2(0, FontStatic.Get("defaultFont").MeasureString("Quit").Y / 2);
            this.buttonColor = Color.Transparent;

            this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
            this.background = new HypercubeDisplay(
                new Rectangle((int)(this.position.Value.X - 685f / 2f) - 3, (int)(this.position.Value.Y - 370f / 2f) - 3, 685 + 6, 370 + 6),
                3,
                this.random,
                0.2f);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScoreboardDisplay"/> class.
        /// </summary>
        /// <param name="screen">The screen.</param>
        /// <param name="textDrawLocation">The text draw location.</param>
        /// <param name="rectangleDrawLocation">The rectangle draw location.</param>
        public ScoreboardDisplay(Screen screen, Vector2 textDrawLocation, Vector2 rectangleDrawLocation)
        {
            this.textDrawLocation = textDrawLocation;
            this.nameDrawLocation = textDrawLocation + new Vector2(270, 0);
            this.scoreDrawLocation = nameDrawLocation + new Vector2(1150, 0);
            this.highScoresLogoLocation = rectangleDrawLocation + new Vector2(-310, 0);
            this.highScoresLogoOrigin = FontStatic.Get("defaultFont").MeasureString("High Scores") / 2f;
            this.verticleSpacing = 100;
            this.rectangleDrawLocation = rectangleDrawLocation;
            this.scrollableRectangle = new Viewport(
                (int)((rectangleDrawLocation.X - 685 / 2f) * Drawer.GetRatio()),
                (int)((rectangleDrawLocation.Y - 370 / 2f) * Drawer.GetRatio()),
                (int)(685 * Drawer.GetRatio()),
                (int)(370 * Drawer.GetRatio()));
            this.scoreOffset = Vector2.Zero;
            this.scoreOffsetAcceloration = 0;
            this.scoreOffsetVelocity = 0;
            this.previousHighlighted = -1;
            this.noScoresHavePosition = rectangleDrawLocation + new Vector2(0, -40f);
            this.noScoresHaveOrigin = FontStatic.Get("defaultFont").MeasureString("No scores have") / 2f;
            this.beenRecordedPosition = rectangleDrawLocation + new Vector2(0, 40f);
            this.beenRecoredOrigin = FontStatic.Get("defaultFont").MeasureString("been recorded.") / 2f;

            this.background = new HypercubeDisplay(
                new Rectangle((int)(rectangleDrawLocation.X - 685f / 2f) - 3, (int)(rectangleDrawLocation.Y - 370f / 2f) - 3, 685 + 6, 370 + 6),
                3,
                screen.random,
                0.91f);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreditsScreen"/> class.
        /// </summary>
        public CreditsScreen()
            : base()
        {
            this.shouldDispose = false;
            this.FadingOut = true;
            this.position = new tVector2(1920f / 2f - 2000f, 1080f / 2f);
            this.position.GoTo(1920f / 2f, 1080f / 2f, 0.3f, true);
            this.background = new HypercubeDisplay(
                new Rectangle((int)(this.position.Value.X - 1450f / 2f) - 3, (int)(this.position.Value.Y - 800f / 2f) - 3, 1450 + 6, 800 + 6),
                3,
                this.random,
                0.2f);
            this.scrollPosition = new tVector2(0, 1000);
            this.scrollPosition.GoTo(0, -21000, 82f, true);
            this.titleOrigin = FontStatic.Get("defaultFont").MeasureString("Credits") / 2f;
            this.viewport = new Viewport(
                (int)((this.position.Value.X - 1450f / 2f) * Drawer.GetRatio()),
                (int)((this.position.Value.Y - 800f / 2f) * Drawer.GetRatio()),
                (int)(1450 * Drawer.GetRatio()),
                (int)(800 * Drawer.GetRatio()));
            this.previousPositionX = 0;
            string fullText =
            @"Ty Taylor
            Supreme Overlord of the Universe
            Framework and Game Engine

            Marc Buchner
            Assistant to Mr. Taylor

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Some guy
            Stuff and things

            Copyright 2011
            Case Western Reserve University
            http://eecs.case.edu";

            this.display = fullText.Split('\n').ToList<string>();
            float unitSpacing = FontStatic.Get("defaultFont").MeasureString(" ").Y;
            this.verticleSpacing = new List<Vector2>(this.display.Count);
            for (int i = 0; i < this.display.Count; i++)
            {
                this.verticleSpacing.Add(new Vector2(-800, 300 + i * unitSpacing));
            }
        }