Ejemplo n.º 1
0
 public miniHUD(Texture2D bGround, Texture2D bar, Rectangle bGround_rect)
 {
     HUD_bGround = bGround_rect;
     bGround_color = bGround;
     stat_height = 18;
     stat_width = bGround_rect.Width / 2 - 16;
     intoxBar = new Bar(bar, new Vector2(bGround_rect.X + 8, bGround_rect.Y + 28),
                             new Rectangle(bGround_rect.X + 8, bGround_rect.Y + 28, stat_width, stat_height));
     energyBar = new Bar(bar, new Vector2(bGround_rect.X + 8, bGround_rect.Y + 73),
                              new Rectangle(bGround_rect.X + 8, bGround_rect.Y + 73, stat_width, stat_height));
     wantedBar = new Bar(bar, new Vector2(bGround_rect.X + 274, bGround_rect.Y + 28),
                             new Rectangle(bGround_rect.X + 274, bGround_rect.Y + 28, stat_width, stat_height));
     odorBar = new Bar(bar, new Vector2(bGround_rect.X + 274, bGround_rect.Y + 73),
                             new Rectangle(bGround_rect.X + 274, bGround_rect.Y + 73, stat_width, stat_height));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new HUD for GamePlay Screen
        /// </summary>
        /// <param name="horizontalBar"></param>
        /// <param name="verticalBar"></param>
        /// <param name="powerBar1"></param>
        /// <param name="powerBar2"></param>
        /// <param name="statsFont"></param>
        /// <param name="screenWidth"></param>
        /// <param name="screenHeight"></param>
        /// <param name="Player"></param>
        public gameplayHUD(Texture2D horizontalBar, Texture2D verticalBar, Texture2D powerBar1, Texture2D powerBar2,
                            Texture2D powerBar3, Texture2D smallBeer, Texture2D portraitTexture,
                            Texture2D paperBag, Texture2D trashBag, Texture2D cart,
                            SpriteFont statsFont, int screenWidth, int screenHeight, character Player)
        {
            beerHeight = (int)(horizontalBar.Height * 0.75);
            beerWidth = 12;
            this.Player = Player;
            this.smallBeer = smallBeer;
            containerImage = new Texture2D[3] { paperBag,
                                                trashBag,
                                                cart };
            reminderColor = Color.Black;
            fntAttribs = statsFont;
            #region BACKGROUND RECTANGLE ARRAY INITIALIZATION
            background = new Sprite[3];
            background[0] = new Sprite(horizontalBar, Vector2.Zero);
            background[1] = new Sprite(horizontalBar, new Vector2(0, screenHeight - horizontalBar.Height));
            background[2] = new Sprite(verticalBar, new Vector2(screenWidth - verticalBar.Width, 0));
            #endregion
            #region STATS RECTANGLE ARRAY INITIALIZATION
            statRectWidth = ((horizontalBar.Width - verticalBar.Width) / 2) - 10;
            statRectHeight = (int)(horizontalBar.Height * 0.75);

            intoxBar = new Bar(powerBar1, new Vector2(0, 8),
                new Rectangle(0, 0, statRectWidth, statRectHeight));

            odorBar = new Bar(powerBar3, new Vector2((((horizontalBar.Width - verticalBar.Width) / 2) + 10), 8),
                new Rectangle(0, 0, statRectWidth, statRectHeight));

            energy = new Bar(powerBar2, new Vector2(0, (screenHeight - horizontalBar.Height + 8)),
                new Rectangle(0, 0, statRectWidth, statRectHeight));

            wantedLevel = new Bar(powerBar1, new Vector2((((horizontalBar.Width - verticalBar.Width) / 2) + 10),
                (screenHeight - horizontalBar.Height + 8)),
                new Rectangle(0, 0, statRectWidth, statRectHeight));
            #endregion
            #region STAT BARS VECTOR2 ARRAY INITIALIZATION
            statLoc = new Vector2[6];
            for (int index = 0; index < 2; index++)
            {
                statLoc[index].X = (index * ((horizontalBar.Width - verticalBar.Width) / 2) + 10) + 4;
                statLoc[index].Y = 10;
            }
            for (int index = 0; index < 2; index++)
            {
                statLoc[index + 2].X = (index * ((horizontalBar.Width - verticalBar.Width) / 2) + 10) + 4;
                statLoc[index + 2].Y = (screenHeight - horizontalBar.Height + 8) + 2;
            }
            #endregion

            #region CHARACTER PORTRAIT INITIALIZATION
            this.portraitTexture = portraitTexture;
            portraitRect = new Rectangle(screenWidth - verticalBar.Width + 8, 8, 224, 268);
            #endregion
            #region CHARACTER INVENTORY INITIALIZATION
            inventoryLoc = new Vector2[7] { new Vector2(screenWidth - verticalBar.Width + 73, 345),
                                            new Vector2(1150, 390),
                                            new Vector2(screenWidth - verticalBar.Width + 16, 495),
                                            new Vector2(screenWidth - verticalBar.Width + 16, 525),
                                            new Vector2(screenWidth - verticalBar.Width + 16, 555),
                                            new Vector2(screenWidth - verticalBar.Width + 16, 585),
                                            new Vector2(screenWidth - verticalBar.Width + 58, 620) };
            #endregion
        }