Esempio n. 1
0
        public override sealed void Update(float frameTime)
        {
            hotbarBG.Position = CluwneLib.PointToVector2(Position);

            int y_dist = 30;
            int x_pos  = 175;

            int max_x = 0;
            int max_y = 0;

            foreach (GuiComponent comp in slots)
            {
                comp.Position = new Point(Position.X + x_pos, Position.Y + y_dist);
                comp.Update(frameTime);
                if (comp.ClientArea.Right > max_x)
                {
                    max_x = comp.ClientArea.Right;
                }
                if (comp.ClientArea.Bottom > max_y)
                {
                    max_y = comp.ClientArea.Bottom;
                }
                x_pos += comp.ClientArea.Width + 1;
            }

            //ClientArea = new Rectangle(Position, new Size((int)max_x - Position.X + 5, (int)max_y - Position.Y + 5));
            ClientArea = Rectangle.Round(hotbarBG.AABB);
        }