|
1492 | 1492 | <param index="1" name="min" type="Variant" /> |
1493 | 1493 | <param index="2" name="max" type="Variant" /> |
1494 | 1494 | <description> |
1495 | | - Wraps the [Variant] [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces. |
1496 | | - Variant types [int] and [float] are supported. If any of the arguments is [float] this function returns a [float], otherwise it returns an [int]. |
| 1495 | + Wraps the [Variant] [param value] between [param min] and [param max]. [param min] is [i]inclusive[/i] while [param max] is [i]exclusive[/i]. This can be used for creating loop-like behavior or infinite surfaces. |
| 1496 | + Variant types [int] and [float] are supported. If any of the arguments is [float], this function returns a [float], otherwise it returns an [int]. |
1497 | 1497 | [codeblock] |
1498 | 1498 | var a = wrap(4, 5, 10) |
1499 | 1499 | # a is 9 (int) |
|
1512 | 1512 | <param index="1" name="min" type="float" /> |
1513 | 1513 | <param index="2" name="max" type="float" /> |
1514 | 1514 | <description> |
1515 | | - Wraps the float [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces. |
| 1515 | + Wraps the float [param value] between [param min] and [param max]. [param min] is [i]inclusive[/i] while [param max] is [i]exclusive[/i]. This can be used for creating loop-like behavior or infinite surfaces. |
1516 | 1516 | [codeblock] |
1517 | 1517 | # Infinite loop between 5.0 and 9.9 |
1518 | 1518 | value = wrapf(value + 0.1, 5.0, 10.0) |
|
1525 | 1525 | # Infinite rotation (in radians) |
1526 | 1526 | angle = wrapf(angle + 0.1, -PI, PI) |
1527 | 1527 | [/codeblock] |
1528 | | - [b]Note:[/b] If [param min] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead. |
1529 | | - [method wrapf] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value. |
| 1528 | + [b]Note:[/b] If [param min] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead. [method wrapf] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value. |
1530 | 1529 | </description> |
1531 | 1530 | </method> |
1532 | 1531 | <method name="wrapi"> |
|
1535 | 1534 | <param index="1" name="min" type="int" /> |
1536 | 1535 | <param index="2" name="max" type="int" /> |
1537 | 1536 | <description> |
1538 | | - Wraps the integer [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces. |
| 1537 | + Wraps the integer [param value] between [param min] and [param max]. [param min] is [i]inclusive[/i] while [param max] is [i]exclusive[/i]. This can be used for creating loop-like behavior or infinite surfaces. |
1539 | 1538 | [codeblock] |
1540 | 1539 | # Infinite loop between 5 and 9 |
1541 | 1540 | frame = wrapi(frame + 1, 5, 10) |
|
0 commit comments