On this page:
pin
spike_  to_  dx
spike_  to_  dy
current_  color
current_  horiz_  margin
current_  vert_  margin
Compass  Direction
8.12

8 Pict Speech Balloons🔗ℹ

 import: pict/balloon package: rhombus-prototype

function

fun pin(

  content :: Pict,

  ~on: base :: Pict,

  ~at: finder :: Find,

  ~spike: spike :: CompassDirection,

  ~margin: margin :: maybe(Real) = #false,

  ~horiz_margin: hmargin :: Real = margin || current_horiz_margin(),

  ~vert_margin: vmargin :: Real = margin || current_vert_margin(),

  ~corner_radius: corner_radius :: Real = 10,

  ~spike_radius: spike_radius :: Real = corner_radius,

  ~dx: dx :: Real = spike_to_dx(spike),

  ~dy: dy :: Real = spike_to_dy(spike),

  ~sprout: sprout :: Real = 0.5,

  ~thought: thought = #false,

  ~fill: fill :: maybe(ColorMode) = current_color(),

  ~line: line :: maybe(ColorMode) = #false,

  ~line_width: line_width :: LineWidth = #'inherit,

  ~epoch: epoch :: EpochAlignment = #'center,

  ~duration: duration :: DurationAlignment = #'sustain

) :: Pict

The pin function (intended to be used as balloon.pin) wraps a cartoon speech balloon around content, extends a pointer from the balloon in the direction indicated by spike, and pins the balloon onto base so that the point is at the location specified by finder.

When content is nothing, then base is returned as-is. When base is nothing, then the result is nothing.

The sprout argument applies only when spike is #'n, #'s, #'e, or #'w. In that case, sprout determines a position along the corresponding endge of the balloon as a fraction of the edge running left-to-right or top-to-bottom.

function

fun spike_to_dx(spike :: CompassDirection) :: Real

 

function

fun spike_to_dy(spike :: CompassDirection) :: Real

Reports the default spike offset for a given direction. The offset is relative to the point on the boundary of a balloon where the spike emerges.

Context parameters for argument defaults in pin.

Matches a symbol for a compass direction, one of #'n, #'ne, #'e, #'se, #'s, #'sw, #'w, or #'nw. The north direction, #'n, corersponds to a negative y-offset.