-
Notifications
You must be signed in to change notification settings - Fork 82
(API) Numberbox
The numberbox object allows the user to input a number into a textinput. It also comes with two buttons for increasing or decreasing the number.
local frame = loveframes.Create("frame")
frame:SetName("Numberbox")
frame:SetSize(210, 60)
frame:CenterWithinArea(unpack(demo.centerarea))
local numberbox = loveframes.Create("numberbox", frame)
numberbox:SetPos(5, 30)
numberbox:SetSize(200, 25)Called every time the object's calue changes
Arguments passed: self [object], value [number]
local numberbox = loveframes.Create("numberbox")
numberbox.OnValueChanged = function(object, value)
print("The object's new value is " ..value)
endSets the object's value
object:SetText(value[number])Gets the object's value
Returns 1 value: value [number]
local value = object:GetText()Sets the object's increase amount
object:SetIncreaseAmount(amount[number])Gets the object's increase amount
Returns 1 value: increaseamount [number]
local increaseamount = object:GetIncreaseAmount()Sets the object's decrease amount
object:SetDecreaseAmount(amount[number])Gets the object's decrease amount
Returns 1 value: decreaseamount [number]
local decreaseamount = object:GetDecreaseAmount()Sets the object's maximum value
object:SetMax(max[number])Gets the object's maximum value
Returns 1 value: max [number]
local max = object:GetMax()Sets the object's minimum value
object:SetMin(min[number])Gets the object's minimum value
Returns 1 value: min [number]
local min = object:GetMin()Sets the object's minimum and maximum values
object:SetMinMax(min[number], max[number])Gets the object's minimum and maximum values
Returns 2 values: minimum [number], maximum [number]
local min, max = object:GetMinMax(min[number], max[number])Modifies the object's value
Note: This method is used by the object internally. You should not use it unless you know what you are doing.
object:ModifyValue(type[string])