Presentation Big Bang
1 An Example
2 Customizing the animation
3 Metadata
3.1 Information available
3.2 Customizing the metadata
3.3 All recognized options
8.12

Presentation Big Bang🔗ℹ

The presentation big-bang system provides a magnified image and visual indications showing the location of the mouse, the last key or mouse event, and the passing of time. It is designed to be used in presentations or recordings to make it clear what actions are triggering the visual responses.

1 An Example🔗ℹ

(require 2htdp/universe)
(require presentation-big-bang)
(define (dr n)
  (overlay (text (number->string n) 48 "black")
           (empty-scene 300 200)))
(presentation-big-bang 10
                       (to-draw dr)
                       (on-tick add1 1.0)
                       (meta (magnification 3)
                             (reset-tick 30)
                             (reset-key "r")))

An example frame from a presentation big-bang:

.

2 Customizing the animation🔗ℹ

The new "meta" block in the "presentation-big-bang" sets parameters used in the animation.

The "magnification" parameter controls the scale factor applied to the draw handler. The default magnification factor is 2.

The "reset-tick" parameter sets a value at which the entire model resets to its original state. By default this is 300.

The "reset-key" is a key (string) which resets the model to its original state when pressed. By default this key is "escape".

3 Metadata🔗ℹ

Metadata tracks the time passing as well as the last event (keypress or mouse event). The default metadata display shows this information in the upper left and right of the screen.

3.1 Information available🔗ℹ

The meta struct holds information about the animation. The fields are the x and y coordinates of the mouse, the last event (key press or mouse event), and the number of ticks since the animation started.

struct

(struct meta (x y event ticks)
    #:extra-constructor-name make-meta)
  x : number?
  y : number?
  event : string?
  ticks : number?
A structure that holds the metadata for an animation. Not currently exported.

3.2 Customizing the metadata🔗ℹ

Originally there was a "meta-draw" argument. That is no longer exposed, but it would be easy to add.

procedure

(meta-draw-h md img)  image?

  md : meta?
  img : image?
Returns an image with the desired metadata rendered on it. The "img" is the result returned from the plain draw handler. Providing the "#:initial-metadata" argument allows a different starting value. The values are propagated with "struct-copy" so changing the type of structure probably will not work well.

3.3 All recognized options🔗ℹ

Unrecognized options are passed directly to big-bang.

syntax

(presentation-big-bang INITIAL-MODEL
  (to-draw draw-handler [width height])
  (on-tick tick-handler [delay [tick-count]])
  (on-mouse mouse-handler)
  (on-key key-handler)
  (on-release key-handler)
  (on-pad pad-handler)
  (on-receive receive-handler)
  (check-with good-struct?)
  (stop-when should-stop? [last-scene-draw-handler])
  (meta (magnification 3)
        (reset-tick 40)
        (reset-key "r")))
Produces a big-bang animation that tracks metadata.