> For the complete documentation index, see [llms.txt](https://tanishisherewith.gitbook.io/dynamic-hud/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/dynamic-hud/widget/scaling.md).

# Scaling

DynamicHUD provides a global scaling setting for all widgets which are set to be scalable.\
The scale can only be changed by the player and all widgets displayed with `canScale` set as true are affected by it.&#x20;

> The scale can be changed from `0.1f - 2.5f`,
>
> The default being `1f`

In order to disable scaling for a single widget, you can set `canScale` flag to false.

```java
MyWidget.setCanScale(false);
```

The scaling is implemented by using the DrawHelper class

{% code title="Widget.java" overflow="wrap" %}

```java
DrawHelper.scaleAndPosition(drawContext.getMatrices(), getX(), getY(), GlobalConfig.get().getScale());.
```

{% endcode %}

### New

Since version `4.0.0`, DynamicHUD allows user to change the scale of widgets by `CTRL+Mouse Scroll` or dragging the bottom right dot of the widget in an editor. The minimum and maximum value of this scale can be changed in the respective widget class. Default value is:

{% code title="Widget.java" %}

```java
protected float minScale = 0.3f;
protected float maxScale = 3.0f;
```

{% endcode %}

{% hint style="info" %}
Use `GlobalConfig.get().getScale()` if you want to make use of DynamicHUD's inbuilt global scaling for your custom widget.
{% endhint %}
