Add pixmap

This commit is contained in:
oakes
2014-04-02 19:48:36 -04:00
parent 6fe32e21c1
commit 0854b6c0e8
2 changed files with 18 additions and 1 deletions

View File

@@ -7,7 +7,7 @@
[com.badlogic.gdx.audio Sound]
[com.badlogic.gdx.assets AssetManager]
[com.badlogic.gdx.graphics Camera Color GL20 OrthographicCamera
PerspectiveCamera Texture VertexAttributes$Usage]
PerspectiveCamera Pixmap Texture VertexAttributes$Usage]
[com.badlogic.gdx.graphics.g2d SpriteBatch]
[com.badlogic.gdx.graphics.g3d ModelBatch]
[com.badlogic.gdx.input GestureDetector

View File

@@ -1,5 +1,22 @@
(in-ns 'play-clj.core)
; pixmaps
(defmacro pixmap
"Returns a [Pixmap](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Pixmap.html).
(pixmap \"image.png\")"
[& args]
`~(if (string? (first args))
`(Pixmap. (files! :internal ~(first args)))
`(Pixmap. ~@args)))
(defmacro pixmap!
"Calls a single method on a `pixmap`."
[object k & options]
`(let [^Pixmap object# (u/get-obj ~object :renderer)]
(u/call! object# ~k ~@options)))
; tiled maps
(defn tiled-map*