5 World Operations
Every canvas comes with an associated world. A client program can set the world, start the world’s clock, stop the world’s clock, and deal with tick events (the clock ticks) and keyboard inputs (keyevents).
((init-world viewport) v) → void? |
viewport : viewport? |
v : any/c |
Sets the initial value of viewport’s world to v.
| |||||||||||||||||||||
viewport : viewport? | |||||||||||||||||||||
secs : real? | |||||||||||||||||||||
For viewport, sets update-callback to be invoked to transform the world value every secs seconds. Only one callback is installed at a time.
viewport : viewport? |
Stops updating viewport’s world via a callback installed with set-on-tick-event.
((set-on-key-event viewport) key-callback) → void? |
viewport : viewport? |
Sets key-callback as the function to call whenever a key event is received for viewport. The key-callback is given a key event and the current world, and it produces an updated world.