Documentation
¶
Index ¶
- Constants
- func RegisterFont(name string, font []byte)
- func Write(w io.Writer, fig Figure)
- type Figure
- func (fig Figure) Blink(duration, timeOn, timeOff time.Duration)
- func (fig Figure) ColorString() string
- func (fig Figure) Dance(duration, freeze time.Duration)
- func (fig Figure) Print()
- func (fig Figure) Scroll(duration, stillness time.Duration, direction string)
- func (figure Figure) Slicify() (rows []string)
- func (fig Figure) String() string
Constants ¶
const ( Black = "black" Red = "red" Green = "green" Yellow = "yellow" Blue = "blue" Purple = "purple" Cyan = "cyan" Gray = "gray" White = "white" )
Variables ¶
This section is empty.
Functions ¶
func RegisterFont ¶
RegisterFont registers a new font. Builtin fonts can be blank imported from the fonts sub-package individually or en masse.
Types ¶
type Figure ¶
type Figure struct {
// contains filtered or unexported fields
}
func NewColorFigure ¶
NewColorFigure converts a phrase to a Figure that can then be printed to an io.Writer (such as io.Stdout).
font must be loaded beforehand. The default is "standard" (provided it is already loaded).
color can be Red, Green, Yellow, Blue, Purple, Cyan, Gray or White.
If strict mode is enabled, then any unprintable ASCII characters will produce a panic. Otherwise, it will be replaced by a '?'.
func NewFigure ¶
NewFigure converts a phrase to a Figure that can then be printed to an io.Writer (such as io.Stdout).
font must be loaded beforehand. The default is "standard" (provided it is already loaded).
If strict mode is enabled, then any unprintable ASCII characters will produce a panic. Otherwise, it will be replaced by a '?'.
func (Figure) Blink ¶
Blink animates the figure with blinking. duration: total time the banner will display.
timeOn: duration of time the text will blink on.
timeOff: duration of time the text will blink off.
For an even blink, set `timeOff` to -1 (same as setting `timeOff` to the value of `timeOn`).
func (Figure) ColorString ¶
Returns the figure as a colored string.
func (Figure) Dance ¶
Dance writes the figure and animates it with "dancing".
duration: total time the banner will display.
freeze: duration of time between dance moves.
NOTE: The lower the freeze the faster the dancing.
func (Figure) Scroll ¶
Scrolls writes the figure and then animates it with scrolling. duration: total time the banner will display.
stillness: duration of time the text will not move; the lower the stillness the faster the scroll speed.
direction: can be either "right" or "left".