Docs test

This commit is contained in:
Robert Jelic
2025-02-16 17:53:48 +01:00
parent 4fbe51a5f0
commit e4723cb63a
3 changed files with 78 additions and 13 deletions

View File

@@ -13,6 +13,8 @@ Button.defineProperty(Button, "text", {default = "Button", type = "string", canT
Button.listenTo(Button, "mouse_click")
Button.listenTo(Button, "mouse_up")
--- Creates a new Button instance
--- @return table self The created instance
function Button.new()
local self = setmetatable({}, Button):__init()
self.set("width", 10)
@@ -21,11 +23,15 @@ function Button.new()
return self
end
--- Initializes the Button instance
--- @param props table The properties to initialize the element with
--- @param basalt table The basalt instance
function Button:init(props, basalt)
VisualElement.init(self, props, basalt)
self.set("type", "Button")
end
--- Renders the Button
function Button:render()
VisualElement.render(self)
local text = self.get("text")