Plaster
New
List
Login
common-lisp
default
isoraqathedh
2018.11.21 10:46:33
(define-presentation test (1024 576) 1 1 (T ;; station label, contents defined later. (enter group-actor :location (vec 0 0) :locations (list (vec (rx 1/4) (ry 4/10)) (vec (+ (rx 1/8) (* 30 1/2)) (ry 1/2))) :name :station-label)) 1 1 (:station-label (enter textbox :border (cons (vec 0 0 0 0) (->colour 0 0 0 0)) :location (vec (rx 1/4) (ry 4/10)) :size (vec (rx 5/8) (ry 2/10)) :align (cons :left :center) :text "London King's Cross" :font-size 50 :background *background-colour* :name :station-code-box) (enter oval :location (vec (+ (rx 1/8) (* 30 1/2)) (ry 1/2)) :size (vec 80 80) :border (cons 15 *background-colour*) :background *text-colour* :name :station-oval))) ;;; later, in (setf location) (defmethod (setf location) :after (value (group-actor group-actor)) (format t "~&~40~") (for:for ((actor flare-queue:in-queue (objects group-actor)) (actor-offset in (locations group-actor))) (let* ((subactor-location (location actor)) (group-location (location group-actor)) (new-subactor-location (setf (location actor) (v+ subactor-location group-location)))) (format *debug-io* "~&Location of ~40a~& set to ~20a (was ~20a)" actor subactor-location new-subactor-location))))
Raw
Annotate
Repaste
Annotations
text
default
isoraqathedh
2018.11.21 10:49:41
(Output from original) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Location of #<OVAL STATION-OVAL => #<SCENE 7 items {1002598913}>> set to (VEC2 143.0 288.0) (was (VEC2 143.0 281.70267)) Location of #<TEXTBOX STATION-CODE-BOX => #<SCENE 7 items {1002598913}>> set to (VEC2 256.0 230.4) (was (VEC2 256.0 224.10266)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Location of #<OVAL STATION-OVAL => #<SCENE 7 items {1002598913}>> set to (VEC2 143.0 281.70267) (was (VEC2 143.0 263.06332)) Location of #<TEXTBOX STATION-CODE-BOX => #<SCENE 7 items {1002598913}>> set to (VEC2 256.0 224.10266) (was (VEC2 256.0 205.46332)) (&c)
Raw
Repaste
common-lisp
default
isoraqathedh
2018.11.21 11:00:03
(define-presentation test (1024 576) 1 1 (T (enter textbox :border (cons (vec 3 3 3 3) (->colour 240 0 0)) :location (vec (rx 1/5) (ry 1/5)) :text "Test" :font-color *text-colour* :font-size 20 :size (vec 150 40) :name :box) (enter image-actor :image-file (asdf:system-relative-pathname 'mkvid "sprite-test" :type "png") :size (vec 100 100) :location (vec (rx 1/2) (ry 1/2)) :name :coin) ;; station label, contents defined later. (enter group-actor :location (vec 0 0) :locations (list (vec (rx 1/4) (ry 4/10)) (vec (+ (rx 1/8) (* 30 1/2)) (ry 1/2))) :name :station-label) (enter textbox :border (cons (vec 1 1 1 1) *text-colour*) :location (vec (rx 1/20) (ry 1/20)) :size (vec (rx 9/10) (ry 1/10)) :align (cons :left :center) :text "East Coast Main Line" :font-size 30 :background *background-colour* :name :line-box) (enter textbox :border (cons (vec 1 1 1 1) *text-colour*) :location (vec (rx 1/20) (ry 17/20)) :size (vec (rx 9/10) (ry 1/10)) :align (cons :left :center) :text "LKX" :font-size 30 :background *background-colour* :name :station-code-box) (enter box :location (vec (rx 1/8) 0) :size (vec 30 (ry 1)) :name :band :background (->colour 60 120 15))) 1 1 (:station-label (enter textbox :border (cons (vec 0 0 0 0) (->colour 0 0 0 0)) :location (vec (rx 1/4) (ry 4/10)) :size (vec (rx 5/8) (ry 2/10)) :align (cons :left :center) :text "London King's Cross" :font-size 50 :background *background-colour* :name :station-code-box) (enter oval :location (vec (+ (rx 1/8) (* 30 1/2)) (ry 1/2)) :size (vec 80 80) :border (cons 15 *background-colour*) :background *text-colour* :name :station-oval)) 0 T (:box (calc location :to (let ((clk clock)) (vec (+ 400 (* 200 (sin clk))) (+ 300 (* 200 (sin (* 3/5 clk))))))) (calc text :to (format nil "~,2,,'#,'0f s" clock))) 0 40 (:coin (calc sprite-location :to (vec (floor (mod (* clock 30) 10)) 0))) 5 5.5 (:station-label (set location :to (vec 0 -100) :ease flare:quad-out)) 10 10.5 (:station-label (set location :to (vec 0 -200) :ease flare:quad-out)) 40 40 (:coin (leave))) #| Scene: + #<SCENE 7 items {10076606C3}> + #<BOX BAND => #<SCENE 7 items {10076606C3}>> + #<TEXTBOX STATION-CODE-BOX => #<SCENE 7 items {10076606C3}>> + #<TEXTBOX LINE-BOX => #<SCENE 7 items {10076606C3}>> + #<GROUP-ACTOR STATION-LABEL => #<SCENE 7 items {10076606C3}>> + #<OVAL STATION-OVAL => #<SCENE 7 items {10076606C3}>> + #<TEXTBOX STATION-CODE-BOX => #<SCENE 7 items {10076606C3}>> + #<IMAGE-ACTOR COIN => #<SCENE 7 items {10076606C3}>> + #<TEXTBOX BOX => #<SCENE 7 items {10076606C3}>> |#
Raw
Repaste