SetText
From MaratisWiki
(Difference between revisions)
Dahnielson (Talk | contribs) |
Dahnielson (Talk | contribs) m |
||
(2 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{lua-function|setText|object, text}} | |
− | + | ||
− | Example 1 : Simple timer display. Make sure you added a Text item in the maratis editor | + | Displaying text. Can be used to display any kind of info such as objects collisions & coordinates, timers, messages, well anything you want. |
+ | |||
+ | {{lua-function-param|object|object to operate on}} | ||
+ | {{lua-function-param|text|text string}} | ||
+ | |||
+ | '''Example 1:''' Simple timer display. Make sure you added a Text item in the maratis editor. | ||
Text0 = getObject("Text0") | Text0 = getObject("Text0") | ||
Line 13: | Line 17: | ||
[[Category:Lua scripting]] | [[Category:Lua scripting]] | ||
+ | [[Category:Lua function]] | ||
+ | [[Category:Text]] |
Latest revision as of 00:04, 9 February 2014
setText(object, text)
Displaying text. Can be used to display any kind of info such as objects collisions & coordinates, timers, messages, well anything you want.
-
object
: object to operate on -
text
: text string
Example 1: Simple timer display. Make sure you added a Text item in the maratis editor.
Text0 = getObject("Text0") t = 0 function onSceneUpdate() t = t + 1 text0 = "Time = " .. t -- change the last "t" to display another info setText(Text0, text0) end