mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
28 lines
662 B
Lua
28 lines
662 B
Lua
local example = {}
|
|
example.title = "Button"
|
|
example.category = "Object Demonstrations"
|
|
|
|
function example.func(loveframes, centerarea)
|
|
|
|
local frame = loveframes.Create("frame")
|
|
frame:SetName("Button")
|
|
frame:CenterWithinArea(unpack(centerarea))
|
|
|
|
local button = loveframes.Create("button", frame)
|
|
button:SetWidth(200)
|
|
button:SetText("Button")
|
|
button:Center()
|
|
button.OnClick = function(object, x, y)
|
|
object:SetText("You clicked the button!")
|
|
end
|
|
button.OnMouseEnter = function(object)
|
|
object:SetText("The mouse entered the button.")
|
|
end
|
|
button.OnMouseExit = function(object)
|
|
object:SetText("The mouse exited the button.")
|
|
end
|
|
|
|
end
|
|
|
|
return example
|