save_piece_images: Save piecepack images

View source: R/save_piece_images.R

save_piece_imagesR Documentation

Save piecepack images

Description

Saves images of all individual piecepack pieces.

Usage

save_piece_images(
  cfg = getOption("piecepackr.cfg", pp_cfg()),
  directory = tempdir(),
  format = "svg",
  angle = 0
)

Arguments

cfg

Piecepack configuration list

directory

Directory where to place images

format

Character vector of formats to save images in

angle

Numeric vector of angles to rotate images (in degrees)

Examples

  # May take more than 5 seconds on CRAN server
  if (all(capabilities(c("cairo", "png")))) {
      cfg <- pp_cfg(list(suit_color="darkred,black,darkgreen,darkblue,grey"))
      save_piece_images(cfg, directory=tempdir(), format="svg", angle=0)
      save_piece_images(cfg, directory=tempdir(), format="png", angle=90)
  }
  

piecepackr documentation built on Sept. 11, 2024, 9:09 p.m.