new example: interactivity
Dependencies
- [2]
T7QIIGQ6attempt at better error recovery - [3]
RK2ASPN7add lots of buttons to the toolbar - [4]
J6O7HP7Jnew example: draw and update callbacks - [5]
OOSUBWKXsubject people to a tutorial - [*]
LRDM35CEapp running again
Change contents
- edit in live.lua at line 385[7.9940][2.1270]
love.graphics.setCanvas() -- undo any canvas we happened to be within, otherwise LÖVE seizes up - replacement in 0078-Example_panes at line 43
'-- For animations and interactivity, you can define various functions that will get called for you.','-- For animations, you can define various functions that will get called for you.', - replacement in 0078-Example_panes at line 45
'-- for example, love.draw, love.update, love.keypressed, etc.',"-- You can't define those directly because Carousel Shell needs to define them, but you can define your own under car.*,",'-- for example, love.draw, love.update, etc.',"-- You can't define those directly because Carousel Shell needs to define them for its UI, but you can define your own under car.*,", - edit in 0078-Example_panes at line 57
'end',},{'-- For interactivity, LÖVE provides functions like love.keypressed, love.mousepressed, etc.','-- As before, define the corresponding car.keypressed, car.mousepressed, etc.',"-- A pane's interactive events only activate when the editor is hidden using the 'hide' button above.","-- Try running this example and then pressing and holding the mouse and pressing and releasing keys.",'-- Then try hiding the editor and again pressing and holding the mouse and pressing and releasing keys','X, Y, dX = 100, 0, 10',"Log = ''",'','function car.draw()',' love.graphics.line(X,Y, X,Y+300)',' love.graphics.print(Log, 50,50)','end','','function car.update(dt)',' if X > 500 then dX = -dX end',' if X < 100 then dX = -dX end',' X = X+dX', - edit in 0078-Example_panes at line 78
'','function car.mousepressed(x,y, button)',' Y = y','end','','function car.mousereleased(x,y, button)',' Y = 0','end','','function car.keypressed(key)',' Log = Log..key','end', - edit in 0060-next_pane_button at line 8
Current_pane.car = car - edit in 0060-next_pane_button at line 11
car = Current_pane.car or {} - edit in 0059-previous_pane_button at line 8
Current_pane.car = car - edit in 0059-previous_pane_button at line 11
car = Current_pane.car or {}