Add more docstrings
This commit is contained in:
@@ -74,7 +74,7 @@
|
|||||||
replaced by simply reloading the namespace, and creates a var for the symbol `n`
|
replaced by simply reloading the namespace, and creates a var for the symbol `n`
|
||||||
bound to a map containing various important values related to the screen
|
bound to a map containing various important values related to the screen
|
||||||
|
|
||||||
(defscreen text-screen
|
(defscreen main-screen
|
||||||
:on-show
|
:on-show
|
||||||
(fn [screen entities]
|
(fn [screen entities]
|
||||||
(update! screen :renderer (stage))
|
(update! screen :renderer (stage))
|
||||||
@@ -136,7 +136,8 @@ object, sets it as the screen for the `game`, and runs the functions from
|
|||||||
|
|
||||||
(defn update!
|
(defn update!
|
||||||
"Runs the equivalent of `(swap! screen-atom assoc ...)`, where `screen-atom`
|
"Runs the equivalent of `(swap! screen-atom assoc ...)`, where `screen-atom`
|
||||||
is the atom storing the screen map behind the scenes
|
is the atom storing the screen map behind the scenes, and returns the new screen
|
||||||
|
map
|
||||||
|
|
||||||
(update! screen :renderer (stage))
|
(update! screen :renderer (stage))
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
; graphics
|
; graphics
|
||||||
|
|
||||||
(defn clear!
|
(defn clear!
|
||||||
|
"Clears the screen with a uniform color, defaulting to black
|
||||||
|
|
||||||
|
(clear!)
|
||||||
|
(clear! 0.5 0.5 1 1)
|
||||||
|
"
|
||||||
([]
|
([]
|
||||||
(clear! 0 0 0 0))
|
(clear! 0 0 0 0))
|
||||||
([r g b a]
|
([r g b a]
|
||||||
@@ -11,6 +16,8 @@
|
|||||||
(.glClear GL20/GL_COLOR_BUFFER_BIT))))
|
(.glClear GL20/GL_COLOR_BUFFER_BIT))))
|
||||||
|
|
||||||
(defmacro color
|
(defmacro color
|
||||||
|
"Returns a [Color](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Color.html)
|
||||||
|
object"
|
||||||
[& args]
|
[& args]
|
||||||
`~(if (keyword? (first args))
|
`~(if (keyword? (first args))
|
||||||
`(Color. ^Color (u/static-field-upper :graphics :Color ~(first args)))
|
`(Color. ^Color (u/static-field-upper :graphics :Color ~(first args)))
|
||||||
@@ -19,30 +26,58 @@
|
|||||||
; interop
|
; interop
|
||||||
|
|
||||||
(defmacro app!
|
(defmacro app!
|
||||||
|
"Calls a single method on [Gdx.app](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Application.html)
|
||||||
|
|
||||||
|
(app! :error \"MYTAG\" \"An error occurred, so I'm logging it!\")
|
||||||
|
"
|
||||||
[k & options]
|
[k & options]
|
||||||
`(u/call! ^Application (Gdx/app) ~k ~@options))
|
`(u/call! ^Application (Gdx/app) ~k ~@options))
|
||||||
|
|
||||||
(defmacro audio!
|
(defmacro audio!
|
||||||
|
"Calls a single method on [Gdx.audio](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Audio.html)
|
||||||
|
|
||||||
|
(audio! :new-audio-recorder 44100 false)
|
||||||
|
"
|
||||||
[k & options]
|
[k & options]
|
||||||
`(u/call! ^Audio (Gdx/audio) ~k ~@options))
|
`(u/call! ^Audio (Gdx/audio) ~k ~@options))
|
||||||
|
|
||||||
(defmacro files!
|
(defmacro files!
|
||||||
|
"Calls a single method on [Gdx.files](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Files.html)
|
||||||
|
|
||||||
|
(files! :internal \"image.png\")
|
||||||
|
"
|
||||||
[k & options]
|
[k & options]
|
||||||
`(u/call! ^Files (Gdx/files) ~k ~@options))
|
`(u/call! ^Files (Gdx/files) ~k ~@options))
|
||||||
|
|
||||||
(defmacro gl!
|
(defmacro gl!
|
||||||
|
"Calls a single method on [Gdx.gl20](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/GL20.html)
|
||||||
|
|
||||||
|
(gl! :gl-create-program)
|
||||||
|
"
|
||||||
[k & options]
|
[k & options]
|
||||||
`(u/call! ^GL20 (Gdx/gl20) ~k ~@options))
|
`(u/call! ^GL20 (Gdx/gl20) ~k ~@options))
|
||||||
|
|
||||||
(defmacro graphics!
|
(defmacro graphics!
|
||||||
|
"Calls a single method on [Gdx.graphics](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Graphics.html)
|
||||||
|
|
||||||
|
(graphics! :is-fullscreen)
|
||||||
|
"
|
||||||
[k & options]
|
[k & options]
|
||||||
`(u/call! ^Graphics (Gdx/graphics) ~k ~@options))
|
`(u/call! ^Graphics (Gdx/graphics) ~k ~@options))
|
||||||
|
|
||||||
(defmacro input!
|
(defmacro input!
|
||||||
|
"Calls a single method on [Gdx.input](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Input.html)
|
||||||
|
|
||||||
|
(input! :is-touched)
|
||||||
|
"
|
||||||
[k & options]
|
[k & options]
|
||||||
`(u/call! ^Input (Gdx/input) ~k ~@options))
|
`(u/call! ^Input (Gdx/input) ~k ~@options))
|
||||||
|
|
||||||
(defmacro net!
|
(defmacro net!
|
||||||
|
"Calls a single method on [Gdx.net](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Net.html)
|
||||||
|
|
||||||
|
(net! :open-uri \"https://nightcode.info/\")
|
||||||
|
"
|
||||||
[k & options]
|
[k & options]
|
||||||
`(u/call! ^Net (Gdx/net) ~k ~@options))
|
`(u/call! ^Net (Gdx/net) ~k ~@options))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user