diff options
author | sfan5 <sfan5@live.de> | 2017-09-11 16:25:20 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2018-06-03 17:31:59 +0200 |
commit | 5b2461c713889b9832f5b99c85abf87e5d494242 (patch) | |
tree | 641c2f0b45c7518019a3b60de99dd142bdaa36bf /doc | |
parent | e9087d1be7e24557a268e77b3005052058d89adb (diff) | |
download | minetest-5b2461c713889b9832f5b99c85abf87e5d494242.tar.gz minetest-5b2461c713889b9832f5b99c85abf87e5d494242.tar.bz2 minetest-5b2461c713889b9832f5b99c85abf87e5d494242.zip |
Fix core.wrap_text and make its behaviour consistent with the docs
Code based on initial implementation by @dsohler.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 03c825689..f0e6931db 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -2128,9 +2128,11 @@ Helper functions * e.g. `string:split("a,b", ",") == {"a","b"}` * `string:trim()` * e.g. `string.trim("\n \t\tfoo bar\t ") == "foo bar"` -* `minetest.wrap_text(str, limit)`: returns a string - * Adds new lines to the string to keep it within the specified character limit +* `minetest.wrap_text(str, limit, [as_table])`: returns a string or table + * Adds newlines to the string to keep it within the specified character limit + Note that returned lines may be longer than the limit since it only splits at word borders. * limit: Maximal amount of characters in one line + * as_table: optional, if true return table of lines instead of string * `minetest.pos_to_string({x=X,y=Y,z=Z}, decimal_places))`: returns string `"(X,Y,Z)"` * Convert position to a printable string Optional: 'decimal_places' will round the x, y and z of the pos to the given decimal place. |