Added State Change Callback Functions example

This commit is contained in:
João Lopes 2021-04-09 12:13:26 +01:00
parent 96dd0de7ba
commit 36995a68c7

View File

@ -28,8 +28,18 @@ function example.func(loveframes, centerarea)
frame:SetHeight(text:GetHeight() + 65)
frame:SetState("newstate")
loveframes.SetStateOnOpenCallback("newstate", stateOnOpen)
loveframes.SetStateOnCloseCallback("newstate", stateOnClose)
loveframes.SetState("newstate")
end
return example
stateOnClose = function(currentState, newState)
print("Closing "..currentState.." before opening "..newState)
end
stateOnOpen = function(currentState, oldState)
print("Opening "..currentState.." after closing "..oldState)
end
return example