aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-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)