$wrap » History » Version 5
Per Amundsen, 12/13/2019 06:23 PM
| 1 | 1 | Per Amundsen | _Added in 3.3_ |
|---|---|---|---|
| 2 | |||
| 3 | *$wrap(text, font, size, width, [word,] N)* |
||
| 4 | |||
| 5 | Returns the Nth line in text wrapped to the specified width in pixels. |
||
| 6 | |||
| 7 | *Parameters* |
||
| 8 | |||
| 9 | text - The text to wrap. |
||
| 10 | font - The font to wrap with. |
||
| 11 | 2 | Per Amundsen | size - The font size to wrap with. |
| 12 | width - The width in pixels for the area to wrap to. |
||
| 13 | 1 | Per Amundsen | [word] - If specified with "1" or word is not specified, the wrapping is performed on whole words, otherwise performed on max length. |
| 14 | N - If N = 0 number of wrapped lines, otherwise the Nth wrapped line. |
||
| 15 | |||
| 16 | 3 | Per Amundsen | *Properties* |
| 17 | |||
| 18 | 5 | Per Amundsen | .cc - Retain the control used for the previous line. *(AdiIRC only)* |
| 19 | 3 | Per Amundsen | |
| 20 | 1 | Per Amundsen | *Example* |
| 21 | |||
| 22 | <pre> |
||
| 23 | ; Show number of wrapped line for this text. |
||
| 24 | //echo -ag Number of wrapped lines is $wrap(veeeeeeerrrrrry long line, verdana, 9, 100, 0) |
||
| 25 | |||
| 26 | ; Show the first wrapped line for this text. |
||
| 27 | //echo -ag The first wrapped line is $wrap(veeeeeeerrrrrry long line, verdana, 9, 100, 1) |
||
| 28 | </pre> |