#544 #545 work on graphics

This commit is contained in:
Mikayla Fischler
2024-09-21 18:38:25 -04:00
parent 2047794173
commit 1d53241b82
13 changed files with 126 additions and 161 deletions

View File

@@ -23,8 +23,8 @@ local ALIGN = core.ALIGN
-- new text box
---@param args textbox_args
---@return graphics_element element, element_id id
local function textbox(args)
---@return TextBox element, element_id id
return function (args)
element.assert(type(args.text) == "string", "text is a required field")
if args.anchor == true then args.can_focus = true end
@@ -42,7 +42,7 @@ local function textbox(args)
end
-- create new graphics element base object
local e = element.new(args, constrain)
local e = element.new(args --[[@as graphics_args]], constrain)
e.value = args.text
@@ -82,10 +82,8 @@ local function textbox(args)
e.redraw()
end
-- initial draw
e.redraw()
---@class TextBox:graphics_element
local TextBox, id = e.complete(true)
return e.complete()
return TextBox, id
end
return textbox