Skip to contents

Adds a text element to the scene. Text is rendered using the system font.

Usage

add_text(
  scene,
  text,
  position = c(0, 0, 0),
  size = 48,
  color = "#FFFFFF",
  font = "sans",
  weight = "normal",
  opacity = 1
)

Arguments

scene

A Scene object

text

The text to display

position

Position as c(x, y) or c(x, y, z)

size

Font size in points

color

Text color

font

Font family

weight

Font weight ("normal", "bold")

opacity

Opacity (0 to 1)

Value

The Scene object (invisibly) for piping

Examples

if (FALSE) { # \dontrun{
scene("text_demo") %>%
  add_text("Hello, World!", size = 72, color = "yellow") %>%
  write_in() %>%
  render()
} # }