Add actor! and actor? to play-clj.ui

This commit is contained in:
oakes
2014-05-16 15:03:27 -04:00
parent fd42615802
commit a8ea005a63
2 changed files with 14 additions and 1 deletions

View File

@@ -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}

View File

@@ -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*