Interface GuiLength

All Known Implementing Classes:
GuiLength.Calculation, GuiLength.FitContent, GuiLength.Fraction, GuiLength.Keyword, GuiLength.Percentage, GuiLength.Pixels

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.

  • Method Details

    • pixels

      static GuiLength pixels(float value)
      Creates a pixel length.
      Parameters:
      value - design-space pixels
      Returns:
      length
    • percent

      static GuiLength percent(float value)
      Creates a percentage length.
      Parameters:
      value - percentage points, where 100 is the full basis
      Returns:
      length
    • calc

      static GuiLength calc(float pixels, float percent)
      Creates a mixed pixel/percentage calculation.
      Parameters:
      pixels - design-space pixel term
      percent - percentage-point term
      Returns:
      length
    • fitContent

      static GuiLength fitContent(GuiLength limit)
      Creates a fit-content limit.
      Parameters:
      limit - definite fit limit
      Returns:
      length
    • fraction

      static GuiLength fraction(float value)
      Creates a grid fraction.
      Parameters:
      value - non-negative fraction
      Returns:
      length
    • auto

      static GuiLength auto()
    • minContent

      static GuiLength minContent()
    • maxContent

      static GuiLength maxContent()