mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Added State Change Callback Functions example
This commit is contained in:
parent
96dd0de7ba
commit
36995a68c7
@ -28,8 +28,18 @@ function example.func(loveframes, centerarea)
|
|||||||
frame:SetHeight(text:GetHeight() + 65)
|
frame:SetHeight(text:GetHeight() + 65)
|
||||||
frame:SetState("newstate")
|
frame:SetState("newstate")
|
||||||
|
|
||||||
|
loveframes.SetStateOnOpenCallback("newstate", stateOnOpen)
|
||||||
|
loveframes.SetStateOnCloseCallback("newstate", stateOnClose)
|
||||||
|
|
||||||
loveframes.SetState("newstate")
|
loveframes.SetState("newstate")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
stateOnClose = function(currentState, newState)
|
||||||
|
print("Closing "..currentState.." before opening "..newState)
|
||||||
|
end
|
||||||
|
stateOnOpen = function(currentState, oldState)
|
||||||
|
print("Opening "..currentState.." after closing "..oldState)
|
||||||
|
end
|
||||||
|
|
||||||
return example
|
return example
|
Loading…
Reference in New Issue
Block a user