diff --git a/doclet/resources/classes.edn b/doclet/resources/classes.edn index 3c79c96..8b93305 100644 --- a/doclet/resources/classes.edn +++ b/doclet/resources/classes.edn @@ -160,6 +160,7 @@ "perspective!" :methods} "Pixmap" {"pixmap" :methods "pixmap!" :methods} + "Pixmap.Format" {"pixmap-format" :static-fields} "Plane" {"plane" :methods "plane!" :methods} "Plane.PlaneSide" {"plane-side" :static-fields} diff --git a/src/play_clj/core_graphics.clj b/src/play_clj/core_graphics.clj index 3160994..afe584a 100644 --- a/src/play_clj/core_graphics.clj +++ b/src/play_clj/core_graphics.clj @@ -1,9 +1,18 @@ (in-ns 'play-clj.core) +(defmacro pixmap-format + "Returns a static field from [Pixmap.Format](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Pixmap.Format.html). + + (pixmap-format :alpha)" + [k] + (u/gdx-field :graphics "Pixmap$Format" (u/key->pascal k))) + (defn pixmap* - [path] - (or (u/load-asset path Pixmap) - (Pixmap. (files! :internal path)))) + ([^String path] + (or (u/load-asset path Pixmap) + (Pixmap. (files! :internal path)))) + ([^long width ^long height ^Pixmap$Format fmt] + (Pixmap. width height fmt))) (defmacro pixmap "Returns a [Pixmap](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Pixmap.html).