> For the complete documentation index, see [llms.txt](https://tanishisherewith.gitbook.io/archived-legacy-dynamichud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tanishisherewith.gitbook.io/archived-legacy-dynamichud/widgets/widgetbox.md).

# WidgetBox

This page talks about WidgetBox class

## WidgetBox:&#x20;

The [`WidgetBox`](https://github.com/V-Fast/DynamicHUD/blob/master/src/main/java/com/tanishisherewith/dynamichud/widget/WidgetBox.java) class represents a box around a widget.

## Fields

* `width`: The width of the box.
* `height`: The height of the box.
* `x1`, `x2`, `y1`, `y2`: The coordinates of the box.

## Constructors

* `WidgetBox(float x1, float y1, float x2, float y2, float scale)`: Constructs a WidgetBox object with the given coordinates and scale.
* `WidgetBox(float x1, float y1, double height, double width, float scale)`: Constructs a WidgetBox object with the given height and width and scale.

## Methods

* `contains(Widget widget, double x, double y)`: Returns whether the given point is inside this box.
* `intersects(int otherX1, int otherY1, int otherX2, int otherY2)`: Returns whether this box intersects with another box defined by the given coordinates.
* `getWidth()`: Returns the width of this box.
* `getHeight()`: Returns the height of this box.
