update helloWorld.lua

This commit is contained in:
2025-04-11 15:00:56 +05:00
parent 0eb821a67b
commit ca877bfd38

View File

@@ -1,24 +1,40 @@
local syscalls = require("syscalls")
local function Redraw()
local systemColors = syscalls.GetSystemColors()
local function redraw()
syscalls.StartRedraw()
syscalls.CreateWidnow(100)
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.Redraw then
Redraw()
elseif event == syscalls.Button then
if syscalls.GetButton() == syscalls.buttons.close then
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
print("End")