Jerrad Pierce

NAME

Acme::Curses::Marquee::Extensions - Extensions for Acme::Curses::Marquee

SYNOPSIS

  use Package::Alias ACME => 'Acme::Curses::Marquee::Extensions';
  use Acme::Curses::Marquee::Extensions;
  use Term::ReadKey 'GetTerminalSize';
  use Time::HiRes 'usleep';

  my ($x, $y) = GetTerminalSize;
  my $m = ACME->new(winw => $x, winh => $y,
                    font => [qw/doh caligraphy fraktur/],
                    text => 'Hello World!' );
  while( 1 ){
    $m->scroll( usleep 75_000 );
  }

DESCRIPTION

Inherits all methods of Acme::Curses::Marquee, except for new, which is among those outlined below.

This module also performs a little slight of hand to remove the parent class's dependency on a figlet binary (in your path).

new( %params )

winw

The width of the window. Defaults to 80.

winh

The height of the window. Defaults to 25.

winx

Location of the origin's abscissa. Defaults to 0.

winy

Location of the origin's ordinate. Defaults to (winh - fontHeight)/2 i.e; vertically centered.

font

Figfont to use, defaults to standard.

This also accepts an arrayref, which can be a list of fonts to rotate through. If cycling fonts, the last element of the arrayref may be a number indicating the number of seconds between transitions. Otherwise, this occurs every 45 sec.

For the time being, you probably want to use fonts of the similar heights, and list the tallest first.

text

The text to render.

colors(delay=>seconds, colors=>[colors])

delay

The number of seconds between color changes. Defaults to 5.

colors

An arrayref of colors to cycle through. Defaults to a rainbow i.e; 'red', 'yellow', 'bold yellow', 'green', 'cyan', 'blue', 'magenta' See Term::ANSIColor for legal values.

sweep( toggle )

True values enable a left-to-right sweep-in of the message before scrolling. Set once, and left enabled, sweeping will result in a sort of "Knight Rider" effect. A toggle of -1 will use this effect only once, as a fade-in.

Note that you can change your sweep state at any time, though the interval should exceed the time it takes for the message to scroll e.g;

  use Every;
  ...
  $m->sweep(1);
  while( 1 ){
    do{exists$m->{_sweep}?$m->sweep(0):$m->sweep(1)} if every seconds=>60;
    ...
  }

ENVIRONMENT

See Text::FIGlet.

FILES

See Text::FIGlet.

CAVEATS

Unfortunately many curses don't implement color, so we use Term::ANSIColor.

AUTHOR

Jerrad Pierce <jpierce@cpan.org>

LICENSE

  • Thou shalt not claim ownership of unmodified materials.

  • Thou shalt not claim whole ownership of modified materials.

  • Thou shalt grant the indemnity of the provider of materials.

  • Thou shalt use and dispense freely without other restrictions.

Or if you truly insist, you may use and distribute this under ther terms of Perl itself (GPL and/or Artistic License).




Hosting generously
sponsored by Bytemark