M fairy.lisp => fairy.lisp +4 -0
@@ 43,6 43,10 @@
(gamekit:y origin))
,@body)))))
+(defgeneric width (el))
+
+(defgeneric height (el))
+
(defclass rectangle (element)
((width :initarg :width
:initform (error "Must supply a width")
M tiled.lisp => tiled.lisp +6 -0
@@ 20,6 20,12 @@
(let ((tileset (cl-tiled:load-tileset (tileset el))))
(setf (change-tileset el) tileset)))
+(defmethod fairy:width ((el tile))
+ (cl-tiled:tileset-tile-width (tileset el)))
+
+(defmethod fairy:height ((el tile))
+ (cl-tiled:tileset-tile-height (tileset el)))
+
(fairy:defdraw (el tile)
(with-slots (tileset current get-resource) el
(let* ((image (cl-tiled:tileset-image (tileset el)))