You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been reading through the documents, and I'm trying to access the state. My current work around is as followed
-- eFactorylocalhelium, useState=..., ...returnhelium(function(parameter, view)
parameter.r=parameter.ror1localstate=useState(parameter)
returnfunction()
love.graphics.setColor(state.r,1,1)
love.graphics.rectangle("fill", 0, 0, view.w, view.h)
endend)
---- main.lua-- Skips creation of scene to make example simplelocalstate= {}
locale=eFactory(state, ...)
love.update=function(dt)
state.r=state.r+0.1*dtwhilestate.r>1thenstate.r=state.r-1endendlove.draw=...
Is there a recommended way of how to access the element's state outside of the element creation than passing a table through parameter or using parameter itself?
The text was updated successfully, but these errors were encountered:
I've been reading through the documents, and I'm trying to access the state. My current work around is as followed
Is there a recommended way of how to access the element's state outside of the element creation than passing a table through
parameter
or usingparameter
itself?The text was updated successfully, but these errors were encountered: