41 lines
836 B
Lua
41 lines
836 B
Lua
local syscalls = require("syscalls")
|
|
|
|
local systemColors = syscalls.GetSystemColors()
|
|
|
|
|
|
|
|
local function redraw()
|
|
syscalls.StartRedraw()
|
|
|
|
syscalls.CreateWindow(100, 100, 200, 200, "Hello World", systemColors.workArea, 3)
|
|
|
|
local t = syscalls.ThreadInfo(-1)
|
|
|
|
|
|
local y = syscalls.GetSkinHeight()
|
|
for i, v in pairs(syscalls.textSize) do
|
|
local a = string.gmatch(i, "(%d+)")()
|
|
syscalls.DrawTextFixSize("HelloWorld " .. i, math.floor(t.winXSize / 8), y, systemColors.workText, v)
|
|
y = y + tonumber(a) + 24
|
|
end
|
|
|
|
syscalls.EndRedraw()
|
|
end
|
|
|
|
redraw()
|
|
|
|
local exit = false
|
|
while not exit do
|
|
local event = syscalls.WaitEvent()
|
|
|
|
if event == syscalls.Event.Redraw then
|
|
redraw()
|
|
elseif event == syscalls.Event.Button then
|
|
local ButtonID = syscalls.GetButton()
|
|
|
|
if ButtonID == syscalls.buttons.close then
|
|
exit = true
|
|
end
|
|
end
|
|
end
|