Interface DisplayUnit.Pixel

All Superinterfaces:
DisplayUnit
Enclosing interface:
DisplayUnit

@Immutable public static interface DisplayUnit.Pixel extends DisplayUnit
Represents a unit in raw pixels.
  • Field Details

  • Method Details

    • of

      static DisplayUnit.Pixel of(int value)
      Creates a new DisplayUnit.Pixel instance with the given value.
      Parameters:
      value - the value
      Returns:
      the new instance
    • getPixels

      int getPixels()
      Returns the pixels.
    • asPixels

      default int asPixels(mindustry.gen.Player player, DisplayUnit.Axis axis)
      Description copied from interface: DisplayUnit
      Converts this unit to pixels based on the player's screen size.
      Specified by:
      asPixels in interface DisplayUnit
      Parameters:
      player - the player
      axis - the axis to convert
      Returns:
      the converted value