Puzzle animation utility class.
More...
#include <PuzzleAnimation.h>
Puzzle animation utility class.
◆ PuzzleAnimation() [1/2]
PuzzleAnimation::PuzzleAnimation |
( |
std::vector< PuzzleState > const & |
transitions | ) |
|
|
inline |
Constructs an animated puzzle with numeric board.
- Parameters
-
transitions | same as the results from solveAstar/solveBFS |
◆ PuzzleAnimation() [2/2]
PuzzleAnimation::PuzzleAnimation |
( |
std::string const & |
img_path, |
|
|
std::vector< PuzzleState > const & |
transitions |
|
) |
| |
|
inline |
Constructs an animated puzzle with an image board.
- Parameters
-
img_path | path the image used for animation |
transitions | same as the results from solveAstar/solveBFS |
◆ writeToFile()
void PuzzleAnimation::writeToFile |
( |
std::string |
fname | ) |
|
Writes the animation to an SVG or GIF file based on the file extension (.svg/.gif).
You can use any modern browser, or the SVG VSCode extension to view the SVG. If you want to build a GIF of a puzzle where the base image itself is an animated GIF, you must use the SVG construction. (writeToGifFile() cannot handle GIFs as input)
- Parameters
-
◆ bgc
std::string PuzzleAnimation::bgc = "#808080" |
◆ fps
double PuzzleAnimation::fps = 12 |
◆ height
double PuzzleAnimation::height = 200 |
◆ stepDuration
double PuzzleAnimation::stepDuration = 0.3 |
duration of each animation step in seconds
◆ tileSize
double PuzzleAnimation::tileSize = std::min(width, height) / 4 |
◆ width
double PuzzleAnimation::width = 200 |
The documentation for this class was generated from the following files: