Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn preload-animations []
- (doseq [pair +preload-animations+]
- (let [symbol (first pair) path (second pair) tw (nth pair 2) th (nth pair 3) ft (nth pair 4)]
- (println "Preloading symbol" symbol "with path" path "width" tw "height" th "frame time" ft)
- (let [output []]
- (let [texture (new com.badlogic.gdx.graphics.Texture path)]
- (let [trgs (com.badlogic.gdx.graphics.g2d.TextureRegion/split texture tw th)]
- (println trgs)
- (println (range (alength trgs)))
- (for [i (range (alength trgs))]
- (let [array (nth trgs i)]
- (println array)
- (for [j (range (alength array))]
- (conj output (nth (nth i trgs) j)))))))
- (.put +animation-map+ symbol
- (struct-map Animation
- :frames (reverse output)
- :frame-time ft))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement