Difference between revisions of "Manual:Display Functions"
Jump to navigation
Jump to search
(Imcreasing headline levels for visibility) |
(→wrapLine: remove double section) |
||
Line 40: | Line 40: | ||
[[Category:Mudlet Manual]] | [[Category:Mudlet Manual]] | ||
[[Category:Mudlet API]] | [[Category:Mudlet API]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 18:40, 5 July 2017
Display Functions
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
-- ask it to display a table
display({a = "somevalue", 1,2,3})
-- or some other target
display(target)
showColors
- showColors(columns, filterColor)
- 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: bg(), fg(), cecho()
- Parameters
- columns:
- Optional: number of columns to print the color table in. Passed as a number.
- filterColor:
- Optional: limits the display to only certain colours that contain this word.
- Example
-- display as four columns:
showColors(4)
-- show only red colours:
showColors("red")
The output for this is: