(add-on-click sprite f)Make a sprite :clickable? by adding an :on-click-fn to be invoked
by the default mouse-pressed handler.
An :on-click-fn takes the game state and the clicked sprite and
should return the new game state.
Make a sprite `:clickable?` by adding an `:on-click-fn` to be invoked by the default mouse-pressed handler. An `:on-click-fn` takes the game state and the clicked sprite and should return the new game state.
(default-key-pressed state e)Add the pressed key to the set of currently held keys.
Add the pressed key to the set of currently held keys.
(default-key-released state e)Remove the released key from the set of currently held keys.
Remove the released key from the set of currently held keys.
(default-mouse-pressed {:keys [scenes current-scene] :as state} e)Check all :clickable? sprites for collision with the mouse event,
apply the :on-click-fn of all that have been clicked on.
Check all `:clickable?` sprites for collision with the mouse event, apply the `:on-click-fn` of all that have been clicked on.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |