files
syscalls/tests/helloWorld.lua
2025-04-11 15:00:56 +05:00

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