save_piece_images: Save piecepack images

Description Usage Arguments Examples

View source: R/save_piece_images.R

Description

Saves images of all individual piecepack pieces.

Usage

1
2
3
4
5
6
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

1
2
3
4
5
6
7
8
  
    is_mac <- tolower(Sys.info()[["sysname"]]) == "darwin"
    if (all(capabilities(c("cairo", "png"))) && !is_mac) {
        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)
    }
  

trevorld/piecepack documentation built on July 22, 2021, 3:26 a.m.