UI
Functions
Section titled “Functions”getHeartRowLength()
Section titled “getHeartRowLength()”getHeartRowLength(
player):int
Defined in: packages/isaacscript-common/src/functions/ui.ts:10
Returns how many hearts are in the heart UI row. If the player has more than 6 hearts, this function will return 6.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”int
getHeartsUIWidth()
Section titled “getHeartsUIWidth()”getHeartsUIWidth():
int
Defined in: packages/isaacscript-common/src/functions/ui.ts:30
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
Section titled “Returns”int
getHUDOffsetVector()
Section titled “getHUDOffsetVector()”getHUDOffsetVector():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:74
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
Section titled “Returns”Readonly<Vector>
getScreenBottomCenterPos()
Section titled “getScreenBottomCenterPos()”getScreenBottomCenterPos():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:95
Returns
Section titled “Returns”Readonly<Vector>
getScreenBottomLeftPos()
Section titled “getScreenBottomLeftPos()”getScreenBottomLeftPos():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:100
Returns
Section titled “Returns”Readonly<Vector>
getScreenBottomRightPos()
Section titled “getScreenBottomRightPos()”getScreenBottomRightPos():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:105
Returns
Section titled “Returns”Readonly<Vector>
getScreenBottomY()
Section titled “getScreenBottomY()”getScreenBottomY():
float
Defined in: packages/isaacscript-common/src/functions/ui.ts:112
Returns
Section titled “Returns”float
getScreenCenterPos()
Section titled “getScreenCenterPos()”getScreenCenterPos():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:117
Returns
Section titled “Returns”Readonly<Vector>
getScreenRightX()
Section titled “getScreenRightX()”getScreenRightX():
float
Defined in: packages/isaacscript-common/src/functions/ui.ts:122
Returns
Section titled “Returns”float
getScreenTopCenterPos()
Section titled “getScreenTopCenterPos()”getScreenTopCenterPos():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:127
Returns
Section titled “Returns”Readonly<Vector>
getScreenTopLeftPos()
Section titled “getScreenTopLeftPos()”getScreenTopLeftPos():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:132
Returns
Section titled “Returns”Readonly<Vector>
getScreenTopRightPos()
Section titled “getScreenTopRightPos()”getScreenTopRightPos():
Readonly<Vector>
Defined in: packages/isaacscript-common/src/functions/ui.ts:136
Returns
Section titled “Returns”Readonly<Vector>
getVisibleHearts()
Section titled “getVisibleHearts()”getVisibleHearts(
player):int
Defined in: packages/isaacscript-common/src/functions/ui.ts:146
Get how many hearts are currently being shown on the hearts UI.
This function is originally from piber20 Helper.
Parameters
Section titled “Parameters”player
Section titled “player”EntityPlayer
Returns
Section titled “Returns”int
