update helloWorld.lua
This commit is contained in:
@@ -1,24 +1,40 @@
|
|||||||
local syscalls = require("syscalls")
|
local syscalls = require("syscalls")
|
||||||
|
|
||||||
local function Redraw()
|
local systemColors = syscalls.GetSystemColors()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local function redraw()
|
||||||
syscalls.StartRedraw()
|
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()
|
syscalls.EndRedraw()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
redraw()
|
||||||
|
|
||||||
local exit = false
|
local exit = false
|
||||||
while not exit do
|
while not exit do
|
||||||
local event = syscalls.WaitEvent()
|
local event = syscalls.WaitEvent()
|
||||||
|
|
||||||
if event == syscalls.Redraw then
|
if event == syscalls.Event.Redraw then
|
||||||
Redraw()
|
redraw()
|
||||||
elseif event == syscalls.Button then
|
elseif event == syscalls.Event.Button then
|
||||||
if syscalls.GetButton() == syscalls.buttons.close then
|
local ButtonID = syscalls.GetButton()
|
||||||
|
|
||||||
|
if ButtonID == syscalls.buttons.close then
|
||||||
exit = true
|
exit = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
print("End")
|
|
||||||
|
Reference in New Issue
Block a user