diff --git a/doclet/resources/classes.edn b/doclet/resources/classes.edn index 8556554..2c92be2 100644 --- a/doclet/resources/classes.edn +++ b/doclet/resources/classes.edn @@ -1,4 +1,5 @@ -{"ActorGestureListener" {"actor-gesture-listener!" :methods} +{"Actor" {"actor!" :methods} + "ActorGestureListener" {"actor-gesture-listener!" :methods} "Align" {"align" :static-fields} "com.badlogic.gdx.graphics.g2d.Animation" {"animation" :methods "animation!" :methods} diff --git a/src/play_clj/ui.clj b/src/play_clj/ui.clj index 3f4717d..b72cb66 100644 --- a/src/play_clj/ui.clj +++ b/src/play_clj/ui.clj @@ -168,6 +168,18 @@ based on the file at `path`. [^WidgetGroup group children] (apply add! (ActorEntity. group) children)) +; actor + +(defmacro actor! + "Calls a single method on an actor." + [entity k & options] + `(u/call! ^Actor (u/get-obj ~entity :object) ~k ~@options)) + +(defn actor? + "Returns true if `entity` is an actor." + [entity] + (isa? (type (u/get-obj entity :object)) Actor)) + ; check-box (defn check-box*