small textures on the way.

This commit is contained in:
Bryce Covert
2017-05-25 22:22:28 -07:00
parent 16819c1d36
commit 807ee8564c
222 changed files with 110 additions and 85 deletions

View File

@@ -157,11 +157,22 @@
0 0 target-width target-height)
(graphics! :new-cursor resized (* hot-x scale) (* hot-y scale) )))
(defn atlas->texture
([atlas path]
(let [region-name (str/replace path #".png" "")]
(texture (texture-atlas! atlas :find-region region-name))))
([atlas path index]
(let [region-name (str/replace path #".png" "")]
(texture (texture-atlas! atlas :find-region region-name index)))))
(defn get-texture [path]
(let [atlas-name (str/replace path #".png" "")
atlas (texture-atlas "packed/pack.atlas")]
(texture (texture-atlas! atlas :find-region atlas-name))))
(defn get-texture
([path]
(get-texture "packed/pack.atlas" path))
([atlas path]
(atlas->texture (texture-atlas atlas) path))
([atlas path index]
(atlas->texture (texture-atlas atlas) path index)))
(defn snapshot-list []