Bring back shape-type

This commit is contained in:
oakes
2014-04-04 03:16:08 -04:00
parent 52ef5b9a38
commit f094a81651
2 changed files with 6 additions and 2 deletions

View File

@@ -177,6 +177,7 @@
"SelectBox.SelectBoxStyle" {"style :select-box" :constructors} "SelectBox.SelectBoxStyle" {"style :select-box" :constructors}
"ShapeRenderer" {"shape" :methods "ShapeRenderer" {"shape" :methods
"shape!" :methods} "shape!" :methods}
"ShapeRenderer.ShapeType" {"shape-type" :static-fields}
"Skin" {"skin" :methods "Skin" {"skin" :methods
"skin!" :methods} "skin!" :methods}
"SkinLoader" {"loader :skin" :methods "SkinLoader" {"loader :skin" :methods

View File

@@ -14,7 +14,10 @@
[object k & options] [object k & options]
`(u/call! ^Pixmap ~object ~k ~@options)) `(u/call! ^Pixmap ~object ~k ~@options))
(defmacro shape-type* (defmacro shape-type
"Returns a static field from [ShapeRenderer.ShapeType](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShapeRenderer.ShapeType.html).
(shape-type :filled)"
[k] [k]
`~(u/gdx-field :graphics :glutils "ShapeRenderer$ShapeType" (u/key->pascal k))) `~(u/gdx-field :graphics :glutils "ShapeRenderer$ShapeType" (u/key->pascal k)))
@@ -41,7 +44,7 @@
Throwable. Throwable.
throw)) throw))
`(let [entity# ~(if (keyword? type) `(let [entity# ~(if (keyword? type)
`(assoc (shape*) :type (shape-type* ~type)) `(assoc (shape*) :type (shape-type ~type))
type) type)
^ShapeRenderer object# (u/get-obj entity# :object)] ^ShapeRenderer object# (u/get-obj entity# :object)]
(assoc entity# :draw! (fn [] (u/calls! object# ~@options))))) (assoc entity# :draw! (fn [] (u/calls! object# ~@options)))))