Called every frame while the tool is visible. Default implementation does nothing.
hide
Called when the tool stops being visible. Default implementation does nothing.
key_pressed
Called when the tool receives a key press. Arguments after self are the same as those of love.keypressed.
text_input
Called when the tool receives text input. Arguments after self are the same as those of love.textinput.
show
Called when the tool becomes visible. Default implementation does nothing.
update
Called every frame. Default implementation does nothing. Arguments after self are the same as those of love.update.
Examples
localMyTool=Class("MyTool",crystal.Tool);MyTool.update=function(self,dt)-- do something every frameendMyTool.draw=function(self)assert(self:is_visible());-- draw something to the screenendMyTool.text_input=function(self,text)-- handle text inputendMyTool.key_pressed=function(self,key,scan_code,is_repeat)-- handle key pressendMyTool.show=function(self)-- do something when tool starts drawingendMyTool.hide=function(self)-- do something when tool stops drawingend