Difference between revisions of "Manual:Display Functions"

From Mudlet
Jump to navigation Jump to search
(→‎display: remove double entry to manual)
(Only 1 function remaining here: showColors() - Move that to UI_Functions, then remove Display_Functions from Lua_Functions)
Line 1: Line 1:
{{TOC right}}
 
= Display Functions =
 
A collection of functions for displaying or formatting information on the screen.
 
  
==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: [[Manual:Lua_Functions#bg|bg()]], [[Manual:Lua_Functions#fg|fg()]], [[Manual:Lua_Functions#cecho|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:
 
<syntaxhighlight lang="lua">
 
-- display as four columns:
 
showColors(4)
 
 
-- show only red colours:
 
showColors("red")
 
</syntaxhighlight>
 
The output for this is:
 
 
[[File:ShowColors.png|showColors(4)|border|center]]
 
 
[[Category:Mudlet Manual]]
 
[[Category:Mudlet API]]
 

Revision as of 21:21, 8 July 2017