Improve docstring and symbol names
This commit is contained in:
@@ -143,7 +143,6 @@ via the screen map.
|
|||||||
entities))
|
entities))
|
||||||
|
|
||||||
; input functions
|
; input functions
|
||||||
; Tip: use input-processor! to run these functions manually
|
|
||||||
(defscreen my-screen
|
(defscreen my-screen
|
||||||
:on-key-down ; a key was pressed
|
:on-key-down ; a key was pressed
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
@@ -188,7 +187,7 @@ via the screen map.
|
|||||||
entities))
|
entities))
|
||||||
|
|
||||||
; gesture functions
|
; gesture functions
|
||||||
; Tip: use gesture-detector! to configure these functions and run them manually
|
; Tip: use gesture-detector! to configure these functions
|
||||||
(defscreen my-screen
|
(defscreen my-screen
|
||||||
:on-fling ; the user dragged over the screen and lifted
|
:on-fling ; the user dragged over the screen and lifted
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
@@ -262,7 +261,7 @@ via the screen map.
|
|||||||
entities))
|
entities))
|
||||||
|
|
||||||
; ui input functions (for play-clj.ui)
|
; ui input functions (for play-clj.ui)
|
||||||
; Tip: use change-listener! and click-listener! to configure these functions and run them manually
|
; Tip: use click-listener! to configure these functions
|
||||||
(defscreen my-screen
|
(defscreen my-screen
|
||||||
:on-ui-changed ; the ui entity was changed
|
:on-ui-changed ; the ui entity was changed
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
@@ -316,7 +315,7 @@ via the screen map.
|
|||||||
entities))
|
entities))
|
||||||
|
|
||||||
; ui drag functions (for play-clj.ui)
|
; ui drag functions (for play-clj.ui)
|
||||||
; Tip: use drag-listener! to configure these functions and run them manually
|
; Tip: use drag-listener! to configure these functions
|
||||||
(defscreen my-screen
|
(defscreen my-screen
|
||||||
:on-ui-drag
|
:on-ui-drag
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
@@ -341,7 +340,6 @@ via the screen map.
|
|||||||
entities))
|
entities))
|
||||||
|
|
||||||
; ui focus functions (for play-clj.ui)
|
; ui focus functions (for play-clj.ui)
|
||||||
; Tip: use focus-listener! to run these functions manually
|
|
||||||
(defscreen my-screen
|
(defscreen my-screen
|
||||||
:on-ui-keyboard-focus-changed
|
:on-ui-keyboard-focus-changed
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
@@ -357,7 +355,6 @@ via the screen map.
|
|||||||
entities))
|
entities))
|
||||||
|
|
||||||
; ui gesture functions (for play-clj.ui)
|
; ui gesture functions (for play-clj.ui)
|
||||||
; Tip: use actor-gesture-listener! to configure these functions and run them manually
|
|
||||||
(defscreen my-screen
|
(defscreen my-screen
|
||||||
:on-ui-fling ; the user dragged a finger over the screen and lifted it
|
:on-ui-fling ; the user dragged a finger over the screen and lifted it
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
@@ -439,11 +436,11 @@ via the screen map.
|
|||||||
`(defonce ~n (defgame* ~options)))
|
`(defonce ~n (defgame* ~options)))
|
||||||
|
|
||||||
(defn set-screen!
|
(defn set-screen!
|
||||||
"Creates and displays a screen for the `game` object, using one or more
|
"Creates and displays a screen for the `game-object`, using one or more
|
||||||
`screen` maps in the order they were provided.
|
`screen-objects` in the order they were provided.
|
||||||
|
|
||||||
(set-screen! my-game main-screen text-screen)"
|
(set-screen! my-game main-screen text-screen)"
|
||||||
[^Game game & screen-objects]
|
[^Game game-object & screen-objects]
|
||||||
(let [add-inputs! (fn []
|
(let [add-inputs! (fn []
|
||||||
(input! :set-input-processor (InputMultiplexer.))
|
(input! :set-input-processor (InputMultiplexer.))
|
||||||
(doseq [{:keys [screen]} screen-objects]
|
(doseq [{:keys [screen]} screen-objects]
|
||||||
@@ -452,14 +449,14 @@ via the screen map.
|
|||||||
run-fn! (fn [k & args]
|
run-fn! (fn [k & args]
|
||||||
(doseq [screen screen-objects]
|
(doseq [screen screen-objects]
|
||||||
(apply (get screen k) args)))]
|
(apply (get screen k) args)))]
|
||||||
(.setScreen game (reify Screen
|
(.setScreen game-object (reify Screen
|
||||||
(show [this] (add-inputs!) (run-fn! :show))
|
(show [this] (add-inputs!) (run-fn! :show))
|
||||||
(render [this d] (run-fn! :render d))
|
(render [this d] (run-fn! :render d))
|
||||||
(hide [this] (run-fn! :hide))
|
(hide [this] (run-fn! :hide))
|
||||||
(pause [this] (run-fn! :pause))
|
(pause [this] (run-fn! :pause))
|
||||||
(resize [this w h] (run-fn! :resize w h))
|
(resize [this w h] (run-fn! :resize w h))
|
||||||
(resume [this] (run-fn! :resume))
|
(resume [this] (run-fn! :resume))
|
||||||
(dispose [this])))))
|
(dispose [this])))))
|
||||||
|
|
||||||
(defn set-screen-wrapper!
|
(defn set-screen-wrapper!
|
||||||
"Sets a function that wraps around all screen functions, allowing you to
|
"Sets a function that wraps around all screen functions, allowing you to
|
||||||
|
|||||||
Reference in New Issue
Block a user