Skip to main content

UI

Functions

getHUDOffsetVector

getHUDOffsetVector(): Readonly<Vector>

In the options menu, players have the ability to set a HUD offset (which gets written to the HudOffset attribute in the "options.ini" file). This function uses the current HUD offset to generate a vector that should be added to the corresponding position that you want to draw a UI element at.

For example:

  • If the user does not have a HUD offset configured, this function will return Vector(0, 0).
  • If the user has a HUD offset of 1.0 configured, this function will return Vector(20, 12).

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:16


getHeartRowLength

getHeartRowLength(player): int

Returns how many hearts are in the heart UI row. If the player has more than 6 hearts, this function will return 6.

Parameters

NameType
playerEntityPlayer

Returns

int

Defined in

packages/isaacscript-common/src/functions/ui.ts:41


getHeartsUIWidth

getHeartsUIWidth(): int

Helper function to get the width of the first player's hearts on the UI. This is useful for drawing UI elements to the right of where the player's hearts are. Make sure to use this in combination with the getHUDOffsetVector helper function.

Returns

int

Defined in

packages/isaacscript-common/src/functions/ui.ts:61


getScreenBottomCenterPos

getScreenBottomCenterPos(): Readonly<Vector>

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:95


getScreenBottomLeftPos

getScreenBottomLeftPos(): Readonly<Vector>

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:100


getScreenBottomRightPos

getScreenBottomRightPos(): Readonly<Vector>

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:105


getScreenBottomY

getScreenBottomY(): float

Returns

float

Defined in

packages/isaacscript-common/src/functions/ui.ts:112


getScreenCenterPos

getScreenCenterPos(): Readonly<Vector>

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:117


getScreenRightX

getScreenRightX(): float

Returns

float

Defined in

packages/isaacscript-common/src/functions/ui.ts:122


getScreenTopCenterPos

getScreenTopCenterPos(): Readonly<Vector>

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:127


getScreenTopLeftPos

getScreenTopLeftPos(): Readonly<Vector>

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:132


getScreenTopRightPos

getScreenTopRightPos(): Readonly<Vector>

Returns

Readonly<Vector>

Defined in

packages/isaacscript-common/src/functions/ui.ts:136


getVisibleHearts

getVisibleHearts(player): int

Get how many hearts are currently being shown on the hearts UI.

This function is originally from piber20 Helper.

Parameters

NameType
playerEntityPlayer

Returns

int

Defined in

packages/isaacscript-common/src/functions/ui.ts:146