GuiAnchor

data class GuiAnchor(val x: Float = 0.0f, val y: Float = 0.0f)(source)

GUI 百分比锚点:(0, 0) 是左上角,(100, 100) 是右下角。 GUI anchor in percentages: (0, 0) is top-left; (100, 100) is bottom-right.

Parameters

x

水平方向占 GUI 宽度的百分比。 / Percentage of GUI width from the left.

y

垂直方向占 GUI 高度的百分比。 / Percentage of GUI height from the top.

Constructors

Link copied to clipboard
constructor(x: Float = 0.0f, y: Float = 0.0f)

Properties

Link copied to clipboard
val x: Float
Link copied to clipboard
val y: Float

Functions

Link copied to clipboard

把两个百分比限制在 0–100;不会修改原对象。 Clamps both percentages to 0–100 without mutating this anchor.