Code: Select all
-- Make a new console window with ease. The default background is black and text color white.
--
-- Example:
--
-- createConsole("myConsoleWindow", 8, 80, 20, 200, 400)
--
-- This will create a miniconsole window that has a font size of 8pt, will display 80 characters in width,
-- hold a maximum of 20 lines and be place at 200x400 of your mudlet window.
-- If you wish to change the color you can easily do this when updating your text or manually somewhere, using
-- setFgColor() and setBackgroundColor().
function createConsole(consoleName, fontSize, charsPerLine, numberOfLines, Xpos, Ypos)
createMiniConsole(consoleName,0,0,1,1)
setMiniConsoleFontSize(consoleName, fontSize)
local x,y = calcFontSize( fontSize )
resizeWindow(consoleName, x*charsPerLine, y*numberOfLines)
setWindowWrap(consoleName, Xpos)
moveWindow(consoleName, Xpos, Ypos)
setBackgroundColor(consoleName,0,0,0,0)
setFgColor(consoleName, 255,255,255)
end