IntExtensions¶
Namespace:
SideXP.Core
Extension functions for int values.
Methods¶
Ratio(int, int, int)¶
Remaps the given value from its range to a range between 0 and 1. If the input value is out of the given range, it's clamped between 0 and 1.
Parameters
value: The value to remap.min: The lower bound of the value's current range.max: The upper bound of the value's current range.
Returns
Returns the remapped value, clamped between 0 and 1.
Percents(int, int, int)¶
Remaps the given value from its range to a range between 0 and 1. If the input value is out of the given range, it's clamped between 0 and 1.
Parameters
value: The value to remap.min: The lower bound of the value's current range.max: The upper bound of the value's current range.
Returns
Returns the remapped value, clamped between 0 and 1.
Clamp(int, int, int)¶
Clamps this value between given min and max.
Parameters
value: The value to clamp.min: The lower bound of the value.max: The upper bound of the value.
Returns
Returns the clamped value.
Pad(int, int, char)¶
Pads a value as string with leading characters.
Parameters
value: The value to pad.length: The expected length of the string.padChar: The character used to pad the value.
Returns
Returns the padded value as string.