diff --git a/src/play_clj/core_interop.clj b/src/play_clj/core_interop.clj index 3ffcc3d..25f8d1f 100644 --- a/src/play_clj/core_interop.clj +++ b/src/play_clj/core_interop.clj @@ -26,3 +26,30 @@ ; ui +(defmacro check-box! + [entity k & options] + `(utils/call! ^Checkbox (:object ~entity) ~k ~@options)) + +(defmacro image-button! + [entity k & options] + `(utils/call! ^ImageButton (:object ~entity) ~k ~@options)) + +(defmacro image-text-button! + [entity k & options] + `(utils/call! ^ImageTextButton (:object ~entity) ~k ~@options)) + +(defmacro label! + [entity k & options] + `(utils/call! ^Label (:object ~entity) ~k ~@options)) + +(defmacro text-button! + [entity k & options] + `(utils/call! ^TextButton (:object ~entity) ~k ~@options)) + +(defmacro text-field! + [entity k & options] + `(utils/call! ^TextField (:object ~entity) ~k ~@options)) + +(defmacro dialog! + [entity k & options] + `(utils/call! ^Dialog (:object ~entity) ~k ~@options)) diff --git a/src/play_clj/core_ui.clj b/src/play_clj/core_ui.clj index 2c94b5b..f6c7aaa 100644 --- a/src/play_clj/core_ui.clj +++ b/src/play_clj/core_ui.clj @@ -1,9 +1,5 @@ (in-ns 'play-clj.core) -(defmacro bitmap-font - [& options] - `(BitmapFont. ~@options)) - (defmacro style [type & options] `(~(symbol (str utils/gdx-package "scenes.scene2d.ui." diff --git a/src/play_clj/utils.clj b/src/play_clj/utils.clj index 34e104a..ec095ec 100644 --- a/src/play_clj/utils.clj +++ b/src/play_clj/utils.clj @@ -48,7 +48,7 @@ (defmacro call! [obj k & args] - `(~(key->method k) ~obj ~@(flatten args))) + `(~(key->method k) ~obj ~@args)) (defn calls!* [[k v]]