summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2017-09-11 16:25:20 +0200
committersfan5 <sfan5@live.de>2017-09-12 19:33:00 +0200
commit6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974 (patch)
tree3694bada19cc38cc32a5616f7db4e9b0207b3a53 /doc/lua_api.txt
parent17fd5fe9358615633a04d7a3941b444a8ce5f199 (diff)
downloadminetest-6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974.tar.gz
minetest-6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974.tar.bz2
minetest-6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974.zip
Fix core.wrap_text and make its behaviour consistent with the docs
Code based on initial implementation by @dsohler.
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 9a5754368..3c2278c8d 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2158,9 +2158,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.