aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/unit.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-12-10 07:11:02 -0800
committercolin <colin@cicadas.surf>2024-12-14 08:35:58 -0800
commit8a51ba81c7df6b0b6dab7cf4b35b5ca084b653ba (patch)
tree23f5f0a5449a06473aba2ec7914a3c2193823a10 /src/core/unit.lisp
parent2cbb8e4114c860e1774efd40d18661aee8ab2a72 (diff)
Replaced defclass-std with defrefactor-with-def
Diffstat (limited to 'src/core/unit.lisp')
-rw-r--r--src/core/unit.lisp37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/core/unit.lisp b/src/core/unit.lisp
index 1102f20..308b715 100644
--- a/src/core/unit.lisp
+++ b/src/core/unit.lisp
@@ -2,15 +2,34 @@
(in-package #:wheelwork)
-(defclass/std unit ()
- ((cached-model cached-projected-matrix cached-rectangle :a)
- (visiblep :with :std t)
- (in-scene-p :with :a :std nil)
- (region :with :std *application*
- :doc "The screen region where the unit will be visible.")
- (base-width base-height :r :std 1.0 :doc "Determined by content.")
- (scale-x scale-y :std 1.0)
- (rotation x y :std 0.0)))
+(def:class unit ()
+ (cached-model cached-projected-matrix cached-rectangle
+ :initform nil :documentation "internal caches")
+
+ ((visiblep "Whether or not to render unit")
+ :prefix :type boolean :initform t)
+
+ ((in-scene-p "Indicates if unit is considered for display & events")
+ :prefix :type boolean :initform nil)
+
+ ((region "The screen region where this unit will be visible.")
+ :prefix :type region :initform *application*)
+
+ ((base-height "Content's base height")
+ (base-width "Content's base width")
+ :ro :type float :initform 1.0)
+
+ ((scale-x "Factor by which to resize base-width")
+ (scale-y "Factor by which to resize base-heght")
+ :type float :initform 1.0)
+
+ ((rotation "Rotation in radians about objects' bounding box center")
+ (x "X position, → is positive direction")
+ (y "Y position, ↑ is positive direction")
+ :type float :initform 0.0)
+
+ :documentation "Fundamental display unit")
+
(defmethod render :around ((unit unit))
(when (unit-visiblep unit)