Skip to content

Latest commit

 

History

History
33 lines (29 loc) · 908 Bytes

README.md

File metadata and controls

33 lines (29 loc) · 908 Bytes

animatedHershey.js

Animated version of Lingdong's p5.hershey.js for p5.js

Online demo here

Basic usage

Before writing, reset timing variables and initialize the speed (ranging from 0 to 1)

P5.animatedHershey.reset([speed]);

General format for creating text

P5.animatedHershey.putText([animationStartTime], [textIsAnimated], [text], {
  cmap: [hersheyFontcmap],
  align: [alignment]
});

Immediately animate "Hello, world!" centered in the 'plain' hershey font

P5.animatedHershey.putText(millis(), true, "Hello, world!", {
  cmap: FONT_HERSHEY.PLAIN,
  align: "center"
});

Write "Hello, world!" as Lingdong's program would

P5.animatedHershey.putText(null, false, "Hello, world!", {
  cmap: FONT_HERSHEY.PLAIN,
  align: "center"
});