mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +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
|
||||||
|
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user