create_creature: Create an interactive animation in canvas

Description Usage Arguments Value Examples

View source: R/create_creature.R

Description

Create an interactive animation in canvas

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
create_creature(
  mouse = FALSE,
  pulse = TRUE,
  color = "darkviolet",
  headradius = 60,
  tickness = 18,
  tentacles = 40,
  friction = 0.02,
  gravity = 0.5,
  wind = -0.5
)

Arguments

mouse

logical. If TRUE, the animation can be moved by the user. Defaults to FALSE

pulse

logical, whether the head of the animation should pulsate. Defaults to FALSE

color

the color of the animation. Defaults to "darkviolet"

headradius

the radius of the head of the animation. Defaults to 60

tickness

the thickness of the tentacles of the animation. Defaults to 18

tentacles

the animation's number of tentacles. Defaults to 40

friction

the value of the friction assigned to the movement of the animation. Defaults to 0.02

gravity

the value of gravity assigned to the movement of the animation. Defaults to 0.5

wind

A value related to the direction of movement of the animation. Defaults to -0.5.

Value

an animated form within a canvas

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
if (interactive()) {
  ui <- fluidPage(
    create_creature(
      color = "#324C63",
      tentacles = 100,
      tickness = 20,
      friction = 0.3,
      gravity = 0,
      wind = 2
    )
  )

  server <- function(input, output) {

  }


  shinyApp(ui = ui, server = server)
}

feddelegrand7/creature documentation built on Oct. 12, 2020, 12:15 a.m.