small textures on the way.
This commit is contained in:
@@ -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 []
|
||||
|
||||
Reference in New Issue
Block a user