diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2020-04-10 22:42:26 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2020-04-10 22:42:26 -0400 |
commit | ebc1c54b8f184ff485561b7c039be368b6a9d2c9 (patch) | |
tree | e7a5354a90e06758966091c181c3b5555766f4c2 /lisparuga/asset.scm | |
parent | 2c5b19226815a406c60cc1a49c59864922364c55 (diff) |
Day 1 progress.
Diffstat (limited to 'lisparuga/asset.scm')
-rw-r--r-- | lisparuga/asset.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisparuga/asset.scm b/lisparuga/asset.scm index b4969b0..a2b0c99 100644 --- a/lisparuga/asset.scm +++ b/lisparuga/asset.scm @@ -22,6 +22,7 @@ ;;; Code: (define-module (lisparuga asset) + #:use-module (chickadee render texture) #:use-module (ice-9 ftw) #:use-module (ice-9 match) #:use-module (oop goops) @@ -38,7 +39,8 @@ reload-modified-assets clear-asset-cache asset-ref - define-asset)) + define-asset + load-tile-atlas)) (define-class <asset> () (watch? #:allocation #:class #:init-form #f) @@ -198,3 +200,9 @@ #:file-name file-name #:loader loader #:loader-args (list loader-args ...)))) + +;; Convenience procedure for loading tilesets +(define* (load-tile-atlas file-name tile-width tile-height + #:key (margin 0) (spacing 0)) + (split-texture (load-image file-name) tile-width tile-height + #:margin margin #:spacing spacing)) |