Rename symbols
This commit is contained in:
@@ -81,20 +81,16 @@
|
|||||||
(defn game
|
(defn game
|
||||||
"Provides quick access to often-used functions.
|
"Provides quick access to often-used functions.
|
||||||
|
|
||||||
(game :width) ; width of the window
|
(game :width)"
|
||||||
(game :height) ; height of the window
|
|
||||||
(game :fps) ; frames per second
|
|
||||||
(game :is-fullscreen?) ; whether the window is fullscreen
|
|
||||||
(game :is-touched?) ; whether the window is being touched/clicked
|
|
||||||
(game :x) ; the x position of the touch/click
|
|
||||||
(game :y) ; the y position of the touch/click"
|
|
||||||
[k]
|
[k]
|
||||||
(case k
|
(case k
|
||||||
:width (graphics! :get-width)
|
:width (graphics! :get-width)
|
||||||
:height (graphics! :get-height)
|
:height (graphics! :get-height)
|
||||||
:fps (graphics! :get-frames-per-second)
|
:fps (graphics! :get-frames-per-second)
|
||||||
:is-fullscreen? (graphics! :is-fullscreen)
|
:fullscreen? (graphics! :is-fullscreen)
|
||||||
:is-touched? (input! :is-touched)
|
:touched? (input! :is-touched)
|
||||||
|
:is-fullscreen? (graphics! :is-fullscreen) ; deprecated
|
||||||
|
:is-touched? (input! :is-touched) ; deprecated
|
||||||
:x (input! :get-x)
|
:x (input! :get-x)
|
||||||
:y (input! :get-y)
|
:y (input! :get-y)
|
||||||
(u/throw-key-not-found k)))
|
(u/throw-key-not-found k)))
|
||||||
@@ -107,14 +103,19 @@
|
|||||||
[k]
|
[k]
|
||||||
`~(u/gdx-field "Input$Keys" (u/key->upper k)))
|
`~(u/gdx-field "Input$Keys" (u/key->upper k)))
|
||||||
|
|
||||||
(defmacro is-pressed?
|
(defmacro pressed?
|
||||||
"Returns a boolean indicating if the key cooresponding to `k` is being pressed.
|
"Returns a boolean indicating if the key cooresponding to `k` is being pressed.
|
||||||
|
|
||||||
(is-pressed? :a)
|
(pressed? :a)
|
||||||
(is-pressed? :page-down)"
|
(pressed? :page-down)"
|
||||||
[k]
|
[k]
|
||||||
`(input! :is-key-pressed (key-code ~k)))
|
`(input! :is-key-pressed (key-code ~k)))
|
||||||
|
|
||||||
|
(defmacro is-pressed?
|
||||||
|
"Deprecated. Please us `pressed?` instead."
|
||||||
|
[k]
|
||||||
|
`(pressed? ~k))
|
||||||
|
|
||||||
(defn ^:private add-input!
|
(defn ^:private add-input!
|
||||||
[^InputProcessor p]
|
[^InputProcessor p]
|
||||||
(let [^InputMultiplexer multi (input! :get-input-processor)]
|
(let [^InputMultiplexer multi (input! :get-input-processor)]
|
||||||
|
|||||||
Reference in New Issue
Block a user