This commit is contained in:
Robert Jelic
2025-02-09 18:06:38 +01:00
parent a6613b76d9
commit 255e120257
2 changed files with 10 additions and 13 deletions

View File

@@ -4,7 +4,7 @@ description = "A Basalt UI Framework Documentation"
format = "markdown" format = "markdown"
dir = "docs" dir = "docs"
file = "src" file = "src"
style = "dark" style = "!new"
template = true template = true
sort = true sort = true
all = true all = true

View File

@@ -96,8 +96,8 @@ function basalt.removeSchedule(id)
basalt._schedule[id] = nil basalt._schedule[id] = nil
end end
-- Internal event handler --- Internal event handler
-- @local --- @local
local function updateEvent(event, ...) local function updateEvent(event, ...)
if(event=="terminate")then basalt.stop() end if(event=="terminate")then basalt.stop() end
@@ -120,8 +120,8 @@ local function updateEvent(event, ...)
end end
end end
-- Internal render function --- Internal render function
-- @local --- @local
local function renderFrames() local function renderFrames()
if(mainFrame)then if(mainFrame)then
mainFrame:render() mainFrame:render()
@@ -129,8 +129,7 @@ local function renderFrames()
end end
--- Updates all scheduled functions --- Updates all scheduled functions
-- @function update --- @usage basalt.update()
-- @usage basalt.update()
function basalt.update() function basalt.update()
for k,v in pairs(basalt._schedule) do for k,v in pairs(basalt._schedule) do
if type(v)=="function" then if type(v)=="function" then
@@ -140,8 +139,7 @@ function basalt.update()
end end
--- Stops the Basalt runtime --- Stops the Basalt runtime
-- @function stop --- @usage basalt.stop()
-- @usage basalt.stop()
function basalt.stop() function basalt.stop()
term.clear() term.clear()
term.setCursorPos(1,1) term.setCursorPos(1,1)
@@ -149,10 +147,9 @@ function basalt.stop()
end end
--- Starts the Basalt runtime --- Starts the Basalt runtime
-- @function run --- @param isActive boolean Whether to start active (default: true)
-- @param[opt] isActive boolean Whether to start active (default: true) --- @usage basalt.run()
-- @usage basalt.run() --- @usage basalt.run(false)
-- @usage basalt.run(false)
function basalt.run(isActive) function basalt.run(isActive)
updaterActive = isActive updaterActive = isActive
if(isActive==nil)then updaterActive = true end if(isActive==nil)then updaterActive = true end