Difference between revisions of "Manual:Display Functions"

From Mudlet
Jump to navigation Jump to search
(Created page with "{{TOC right}} == Display Functions == A collection of functions for displaying or formatting information on the screen. ===display=== ; display(value) : This function will do...")
 
(Adding redirect to lua functions page.)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{TOC right}}
+
#REDIRECT [[Manual:Lua_Functions]]
== Display Functions ==
+
The contents of this page have been moved to the [[Manual:Lua_Functions|Lua Functions]] page.
A collection of functions for displaying or formatting information on the screen.
 
 
 
===display===
 
; display(value)
 
: This function will do it's best to show whatever you ask it (a number, string, table, function). This function can be useful for seeing what values does a table have, for example. Note that this doesn't handle recursive references and will loop infinitely at the moment (Mudlet 2.0-test4). If a value is a string, it'll be in single quotes, and if it's a number, it won't be quoted.
 
 
 
;Example
 
<lua>
 
-- ask it to display a table
 
display({a = "somevalue", 1,2,3})
 
-- or some other target
 
display(target)
 
</lua>
 
 
 
===showColors===
 
;showColors(columns)
 
: shows the named colors currently available in Mudlet's color table. These colors are stored in color_table, in table form. The format is color_table.colorName = {r,g,b}
 
: See Also: [[Manual:Lua_Functions#bg|bg()]], [[Manual:Lua_Functions#fg|fg()]], [[Manual:Lua_Functions#cecho|cecho()]]
 
 
 
;Parameters
 
* ''columns:''
 
: Number of columns to print the color table in. Passed as an integer number.
 
 
 
;Example:
 
<lua>
 
showColors(4)
 
</lua>
 
The output for this is:
 
 
 
[[File:ShowColors.png|showColors(4)]]
 
 
 
[[Category:Mudlet Manual]]
 
[[Category:Mudlet API]]
 

Latest revision as of 22:07, 10 July 2017

The contents of this page have been moved to the Lua Functions page.