opt <- options(cores = getOption("Ncpus"))
cfg <- game_systems("sans", border = FALSE)$piecepack
should_run_piece_example <- piecepackr:::donttest() &&
requireNamespace("rayrender", quietly = TRUE) &&
all(capabilities(c("cairo", "png")))
if (should_run_piece_example) {
scene <- piece("tile_face", suit = 3, rank = 3, cfg = cfg)
rayrender::render_scene(scene)
}
if (should_run_piece_example) {
scene <- piece("coin_back", suit = 4, rank = 2, cfg = cfg)
rayrender::render_scene(scene)
}
if (should_run_piece_example) {
scene <- piece("pawn_face", suit = 2, cfg = cfg)
rayrender::render_scene(scene)
}
options(opt)
Run the code above in your browser using DataLab