Title: | Plaintext Board Game Visualizations |
---|---|
Description: | Functions to visualize board games in plaintext. Provides colorization support for the terminal and HTML. |
Authors: | Trevor L Davis [aut, cre] |
Maintainer: | Trevor L Davis <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0-4 |
Built: | 2024-11-03 05:42:41 UTC |
Source: | https://github.com/piecepackr/ppcli |
cat_piece()
generates plaintext piecepack diagrams and
outputs them using base::cat()
. cat_move()
generates
a plaintext diagram for a move within a game. cat_game()
renders an animation of a game in the terminal.
cat_piece( df, color = NULL, reorient = "none", annotate = FALSE, ..., file = "", annotation_scale = NULL, style = c("Unicode", "Game Bit Mono", "Game Bit Duo") )
cat_piece( df, color = NULL, reorient = "none", annotate = FALSE, ..., file = "", annotation_scale = NULL, style = c("Unicode", "Game Bit Mono", "Game Bit Duo") )
df |
Data frame containing piece info. |
color |
How should the text be colorized.
If |
reorient |
Determines whether and how we should reorient (the angle) of pieces or symbols:
|
annotate |
If |
... |
Passed to |
file |
|
annotation_scale |
Multiplicative factor that scales (stretches) any annotation coordinates.
By default uses |
style |
If "Unicode" (default) only use glyphs in Unicode proper. If "Game Bit Duo" use glyphs in Private Use Area of "Game Bit Duo" font. If "Game Bit Mono" use glyphs in Private Use Area of "Game Bit Mono" font. |
String of text diagram (returned invisibly).
As a side effect prints out the text diagram using cat()
.
str_piece()
for just the character vector. See https://github.com/trevorld/game-bit-font for more information about the “Game Bit” family of fonts.
str_piece()
generates plaintext piecepack diagrams.
str_piece( df, color = NULL, reorient = "none", annotate = FALSE, ..., annotation_scale = NULL, style = c("Unicode", "Game Bit Mono", "Game Bit Duo") )
str_piece( df, color = NULL, reorient = "none", annotate = FALSE, ..., annotation_scale = NULL, style = c("Unicode", "Game Bit Mono", "Game Bit Duo") )
df |
Data frame containing piece info. |
color |
How should the text be colorized.
If |
reorient |
Determines whether and how we should reorient (the angle) of pieces or symbols:
|
annotate |
If |
... |
Mainly ignored except for a couple of undocumented features. |
annotation_scale |
Multiplicative factor that scales (stretches) any annotation coordinates.
By default uses |
style |
If "Unicode" (default) only use glyphs in Unicode proper. If "Game Bit Duo" use glyphs in Private Use Area of "Game Bit Duo" font. If "Game Bit Mono" use glyphs in Private Use Area of "Game Bit Mono" font. |
Character vector for text diagram.
cat_piece()
for printing to the terminal.
See https://github.com/trevorld/game-bit-font for more information about the “Game Bit” family of fonts.