Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/hud/api/hud.api
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public abstract class org/polyfrost/oneconfig/api/hud/v1/Hud : org/polyfrost/one
public final fun getPadLeft ()F
public final fun getPadRight ()F
public final fun getPadTop ()F
public final fun getPivotFractionX ()F
public final fun getPivotFractionY ()F
public final fun getPoppinsFontName ()Ljava/lang/String;
public final fun getPosSchema ()I
public fun getRelativeX ()F
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,26 @@ abstract class Hud(id: String, title: String, val category: Category) : Cloneabl
?: selfAnchorPoint.takeUnless { it == HudAnchor.Auto } ?: effectiveGrowthAnchor
}

/**
* How far across this HUD's box the point that holds still while it resizes horizontally sits
*
* 0 is the left edge and 1 the right
*
* A merge can hold each axis against a different neighbour so this can disagree with
* [effectiveSelfAnchorPoint]
*/
val pivotFractionX: Float get() = pinnedFracX(resolvedAnchorX?.selfPoint ?: growthAnchor)

/**
* How far down this HUD's box the point that holds still while it resizes vertically sits
*
* 0 is the top edge and 1 the bottom
*
* A merge can hold each axis against a different neighbour so this can disagree with
* [effectiveSelfAnchorPoint]
*/
val pivotFractionY: Float get() = pinnedFracY(resolvedAnchorY?.selfPoint ?: growthAnchor)

/** Moves this HUD's own anchor point to [point] without moving the HUD on screen */
fun setSelfAnchorPointKeepingPosition(point: HudAnchor) {
val absX = rawX
Expand Down
Loading