Skip to contents

tarot_cards() returns tarot cards.

Usage

tarot_cards(
  ...,
  side = "face",
  piece_side = paste0("card_", side),
  suit = rep(1:4, each = 13L),
  rank = rep.int(c(1:11, 13:14), 4L),
  x = 2.5 * rep.int(1:13, 4L),
  y = 3.5 * rep(4:1, each = 13L),
  angle = 0,
  length.out = NA_integer_
)

Arguments

...

Should be left empty.

side

Either "face" or "back".

piece_side

Either "tile_face" or "tile_back".

suit

Suit value of cards. 1L is "hearts", 2L is "spades", 3L is "clubs", 4L is "diamonds", and 5L is "trumps". Will be coerced by tarot_suit().

rank

Rank value of cards. Normal suits are from 1L (ace) to 14L (king) plus a 15L joker. Trump suits are from 1L to 21L plus a 22L fool/excuse. Will be coerced by tarot_rank().

x, y

Cartesian coordinates (numeric vectors)

angle

Rotation of piece (numeric vector of degrees, counter-clockwise). Will be coerced by piece_angle().

length.out

The number of pieces. Not needed if all the arguments are the same length (or of length one) and this length is the same as the number of desired pieces.

Value

A tibble::tibble() data frame with the following columns:

  • "piece_side"

  • "suit"

  • "rank"

  • "cfg" (optional, defaults to "piecepack")

  • "x"

  • "y"

  • "angle" (optional, defaults to 0).

This data frame is compatible with piecepackr::render_piece() and likely ppcli::cat_piece().

Examples

df <- tarot_cards(suit = "clubs", rank = "nine", x = 1.5, y = 2)
if (require("piecepackr", quietly = TRUE) &&
    packageVersion("piecepackr") >= "1.15.0-1" &&
    piecepackr:::device_supports_unicode()) {
  grid::grid.newpage()
  envir = game_systems()
  pmap_piece(df, envir = envir, default.units = "in")
}