dfhack/scripts/gui/hello-world.lua

32 lines
585 B
Lua

-- Test lua viewscreens.
--[[=begin
gui/hello-world
===============
A basic example for testing, or to start your own script from.
=end]]
local gui = require 'gui'
local text = 'Woohoo, lua viewscreen :)'
local screen = gui.FramedScreen{
2012-08-22 03:06:06 -06:00
frame_style = gui.GREY_LINE_FRAME,
frame_title = 'Hello World',
frame_width = #text,
frame_height = 1,
frame_inset = 1,
}
function screen:onRenderBody(dc)
dc:string(text, COLOR_LIGHTGREEN)
end
function screen:onInput(keys)
if keys.LEAVESCREEN or keys.SELECT then
self:dismiss()
end
end
screen:show()