PositionSetting

A setting used to easily change the position of a Hud Element

new PositionSetting(String name, String description, int width, int height)

getX(): int

Returns the x position that should be used for rendering the HUD element.

getY(): int

Returns the y position that should be used for rendering the HUD element.

setWidth(int width): void

Update the width of the HUD Element, if your element dynamically changes size you should call this every frame.

setHeight(int height): void

Update the height of the HUD Element, if your element dynamically changes size you should call this every frame.

getName(): String

Gives the name of the setting.

getDescription(): String

Returns the description of the setting.

setHidden(boolean hidden): void

Allows you to hide a setting from the menu.

setHidden() only works on settings that have been initiated by scripts in the first place!

isHidden(boolean hidden): void

Allows you to hide a setting from the menu.

You can check the CPS Counter example module for a correct implementation of this.

Last updated