Function wrap
pub fn wrap(value: &Variant, min: &Variant, max: &Variant) -> VariantExpand description
Wraps the Variant value between min and max. min is inclusive while max is exclusive. This can be used for creating loop-like behavior or infinite surfaces.
Variant types int and float are supported. If any of the arguments is float, this function returns a float, otherwise it returns an int.
var a = wrap(4, 5, 10)
# a is 9 (int)
var a = wrap(7, 5, 10)
# a is 7 (int)
var a = wrap(10.5, 5, 10)
# a is 5.5 (float)