Interface GuiLength
- All Known Implementing Classes:
GuiLength.Calculation, GuiLength.FitContent, GuiLength.Fraction, GuiLength.Keyword, GuiLength.Percentage, GuiLength.Pixels
public sealed interface GuiLength
permits GuiLength.Pixels, GuiLength.Percentage, GuiLength.Calculation, GuiLength.FitContent, GuiLength.Fraction, GuiLength.Keyword
Typed modern layout length.
Percentages use CSS-style percentage points: percent(50) is half
of the resolved containing-block basis. Fractions are valid for grid tracks
and flex-like distribution, not ordinary box edges.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA linearpixels + percent * basiscalculation.static final recordFit-content with a definite cap.static final recordNon-negative grid fraction.static enumIntrinsic and automatic sizing keywords.static final recordPercentage points.static final recordFixed design-space pixels. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic GuiLengthauto()static GuiLengthcalc(float pixels, float percent) Creates a mixed pixel/percentage calculation.static GuiLengthfitContent(GuiLength limit) Creates a fit-content limit.static GuiLengthfraction(float value) Creates a grid fraction.static GuiLengthstatic GuiLengthstatic GuiLengthpercent(float value) Creates a percentage length.static GuiLengthpixels(float value) Creates a pixel length.
-
Method Details
-
pixels
Creates a pixel length.- Parameters:
value- design-space pixels- Returns:
- length
-
percent
Creates a percentage length.- Parameters:
value- percentage points, where100is the full basis- Returns:
- length
-
calc
Creates a mixed pixel/percentage calculation.- Parameters:
pixels- design-space pixel termpercent- percentage-point term- Returns:
- length
-
fitContent
-
fraction
Creates a grid fraction.- Parameters:
value- non-negative fraction- Returns:
- length
-
auto
-
minContent
-
maxContent
-