Add boolean entity functions
This commit is contained in:
@@ -55,6 +55,11 @@
|
|||||||
`(let [^ShapeRenderer object# (u/get-obj ~entity :object)]
|
`(let [^ShapeRenderer object# (u/get-obj ~entity :object)]
|
||||||
(u/call! object# ~k ~@options)))
|
(u/call! object# ~k ~@options)))
|
||||||
|
|
||||||
|
(defn shape?
|
||||||
|
"Returns true if `entity` is a `shape`."
|
||||||
|
[entity]
|
||||||
|
(isa? (type entity) ShapeEntity))
|
||||||
|
|
||||||
; tiled maps
|
; tiled maps
|
||||||
|
|
||||||
(defn tiled-map*
|
(defn tiled-map*
|
||||||
|
|||||||
@@ -48,6 +48,11 @@
|
|||||||
[entity k & options]
|
[entity k & options]
|
||||||
`(u/call! ^TextureRegion (u/get-obj ~entity :object) ~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
|
; nine-patch
|
||||||
|
|
||||||
(defn nine-patch*
|
(defn nine-patch*
|
||||||
@@ -84,6 +89,11 @@
|
|||||||
[entity k & options]
|
[entity k & options]
|
||||||
`(u/call! ^NinePatch (u/get-obj ~entity :object) ~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
|
; particle-effect
|
||||||
|
|
||||||
(defn particle-effect*
|
(defn particle-effect*
|
||||||
@@ -108,6 +118,11 @@
|
|||||||
[entity k & options]
|
[entity k & options]
|
||||||
`(u/call! ^ParticleEffect (u/get-obj ~entity :object) ~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
|
; texture-atlas
|
||||||
|
|
||||||
(defn texture-atlas*
|
(defn texture-atlas*
|
||||||
|
|||||||
@@ -91,6 +91,11 @@
|
|||||||
`(let [^ModelInstance object# (u/get-obj ~entity :object)]
|
`(let [^ModelInstance object# (u/get-obj ~entity :object)]
|
||||||
(u/call! object# ~k ~@options)))
|
(u/call! object# ~k ~@options)))
|
||||||
|
|
||||||
|
(defn model?
|
||||||
|
"Returns true if `entity` is a `model`."
|
||||||
|
[entity]
|
||||||
|
(isa? (type entity) ModelEntity))
|
||||||
|
|
||||||
; model-builder
|
; model-builder
|
||||||
|
|
||||||
(defn model-builder*
|
(defn model-builder*
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
[com.esotericsoftware.tablelayout Cell]
|
[com.esotericsoftware.tablelayout Cell]
|
||||||
[play_clj.entities ActorEntity]))
|
[play_clj.entities ActorEntity]))
|
||||||
|
|
||||||
|
(defn actor?
|
||||||
|
"Returns true if `entity` is one of the UI entities."
|
||||||
|
[entity]
|
||||||
|
(isa? (type entity) ActorEntity))
|
||||||
|
|
||||||
(defmacro drawable
|
(defmacro drawable
|
||||||
"Returns a subclass of [BaseDrawable](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/utils/BaseDrawable.html).
|
"Returns a subclass of [BaseDrawable](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/utils/BaseDrawable.html).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user