Add boolean entity functions

This commit is contained in:
oakes
2014-04-05 23:50:42 -04:00
parent f094a81651
commit 25895faa9b
4 changed files with 30 additions and 0 deletions

View File

@@ -48,6 +48,11 @@
[entity k & options]
`(u/call! ^TextureRegion (u/get-obj ~entity :object) ~k ~@options))
(defn texture?
"Returns true if `entity` is a `texture`."
[entity]
(isa? (type entity) TextureEntity))
; nine-patch
(defn nine-patch*
@@ -84,6 +89,11 @@
[entity k & options]
`(u/call! ^NinePatch (u/get-obj ~entity :object) ~k ~@options))
(defn nine-patch?
"Returns true if `entity` is a `nine-patch`."
[entity]
(isa? (type entity) NinePatchEntity))
; particle-effect
(defn particle-effect*
@@ -108,6 +118,11 @@
[entity k & options]
`(u/call! ^ParticleEffect (u/get-obj ~entity :object) ~k ~@options))
(defn particle-effect?
"Returns true if `entity` is a `particle-effect`."
[entity]
(isa? (type entity) ParticleEffectEntity))
; texture-atlas
(defn texture-atlas*