/// <summary>
        /// Initializes a new instance of the <see cref="BoxArtDisplay"/> class.
        /// </summary>
        /// <param name="screen">The screen.</param>
        /// <param name="basePosition">The base position (positon of center of active box art).</param>
        /// <param name="boxArtOffset">The box art offset between each image.</param>
        public BoxArtDisplay(Screen screen, Vector2 basePosition, Vector2 boxArtOffset)
        {
            this.screen       = screen;
            this.basePosition = basePosition;
            this.boxArtOffset = boxArtOffset;
            this.images       = new List <GameInfoDisplayElement>();
            this.boxArtMenu   = new BoxArtMenu(new Vector2(0, -150), new MenuAction[] { }, 80f);

            // Set each element in images to the correct starting location.
            // Mind the "current Index" of GameInfoCollection.
            for (int i = 0; i < GameInfoCollection.GameInfos.Count * 5; i++)
            {
                if (i % GameInfoCollection.GameInfos.Count == GameInfoCollection.GameInfos.Count - 1)
                {
                    this.images.Add(new GameInfoDisplayMenu(screen, boxArtMenu));
                }
                else
                {
                    this.images.Add(new GameInfoDisplayElement(GameInfoCollection.GameInfos[i % GameInfoCollection.GameInfos.Count], screen));
                }
            }

            this.lastOffset = GameInfoCollection.GameInfos.Count * 3;
            this.Shift(0);
            this.fullOffset = -GameInfoCollection.GameInfos.Count * boxArtOffset;
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameInfoDisplayMenu"/> class.
 /// </summary>
 /// <param name="screen">The screen.</param>
 public GameInfoDisplayMenu(Screen screen, BoxArtMenu menu)
     : base(GameInfoCollection.GameInfos[GameInfoCollection.GameInfos.Count - 1], screen)
 {
     this.screen = screen;
     this.menu   = menu;
     this.previousGameInfoSelected = GameInfoCollection.CurrentIndex;
     this.lagOverTime = 0;
 }
 /// <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);
 }