mirror of
https://github.com/Insality/druid.git
synced 2025-09-28 02:22:18 +02:00
Update
This commit is contained in:
@@ -21,7 +21,7 @@ function M:init()
|
||||
self.max = 1
|
||||
|
||||
self.text_name = self.druid:new_text("text_name")
|
||||
:set_text_adjust("scale_then_trim_left", 0.3)
|
||||
:set_text_adjust("scale_then_trim", 0.3)
|
||||
|
||||
self.text_value = self.druid:new_text("text_value")
|
||||
self.slider = self.druid:new_slider("slider_pin", vmath.vector3(55, 0, 0), self.update_value) --[[@as druid.slider]]
|
||||
@@ -46,6 +46,20 @@ function M:set_text_function(callback)
|
||||
end
|
||||
|
||||
|
||||
--- Sets the text property of the slider
|
||||
---@param text string
|
||||
function M:set_text_property(text)
|
||||
self.text_name:set_text(text)
|
||||
end
|
||||
|
||||
|
||||
--- Sets the callback function for when the slider value changes
|
||||
---@param callback fun(value:number)
|
||||
function M:on_change(callback)
|
||||
self.on_change_value:subscribe(callback)
|
||||
end
|
||||
|
||||
|
||||
---@param value number
|
||||
function M:set_value(value, is_instant)
|
||||
local diff = math.abs(self.max - self.min)
|
||||
|
Reference in New Issue
Block a user