Skip to contents

This helper plays nothing; use mascot_gesture() to play a movement. After the mascot appears or changes (a new mood, a gesture or a swap), it breathes and blinks for up to five seconds, then rests. The visitor's reduced-motion setting always wins over any TRUE. Switches you do not set, including any added in later versions, follow others; switches you set always win.

Usage

mascot_motion_settings(
  ...,
  idle = NULL,
  mood_change = NULL,
  gestures = NULL,
  swap = NULL,
  minimising = NULL,
  restoring = NULL,
  messages = NULL,
  others = TRUE
)

Arguments

...

Must be empty; all settings must be named.

idle

Logical flag or NULL (default): breathing and blinking. NULL follows others.

mood_change

Logical flag or NULL (default): the wiggle or hop on a mood change. NULL follows others.

gestures

Logical flag or NULL (default): nods, waves and other gestures. NULL follows others. Skipping a gesture leaves the mood, bubble and status of the same update intact.

swap

Logical flag or NULL (default): character-change transitions. NULL follows others.

minimising

Logical flag or NULL (default): movement to the round restore button. NULL follows others.

restoring

Logical flag or NULL (default): movement back from the restore button. NULL follows others.

messages

TRUE for all panels, FALSE for none, or a character vector of names from c("bubble", "tooltip", "menu") for only those panels. NULL (default) follows others. Panels still appear and work.

others

Logical flag, default TRUE, for every switch you do not set. With others = FALSE and no switch you set allowing movement, this is the same as motion = FALSE, including the reduced-motion poses and instant drag moves.

Value

A mascot_motion_settings object. Its fields are internal; pass the object on rather than reading its fields.

Examples

mascot_motion_settings()
#> mascot_motion_settings()
mascot_motion_settings(idle = FALSE)
#> mascot_motion_settings(idle = FALSE)
mascot_motion_settings(messages = "menu", others = FALSE)
#> mascot_motion_settings(messages = "menu", others = FALSE)
ui <- mascot("still", motion = FALSE)
if (FALSE) { # interactive()
shiny::shinyApp(
  shiny::fluidPage(
    shiny::checkboxInput("idle", "Allow idle movement", TRUE),
    shiny::actionButton("nod", "Nod"),
    mascot("helper")
  ),
  function(input, output, session) {
    shiny::observeEvent(input$idle, {
      update_mascot("helper", motion = mascot_motion_settings(idle = input$idle))
    })
    shiny::observeEvent(input$nod, {
      update_mascot("helper", gesture = "nod")
    })
  }
)
}