NAME
Acme::Curses::Marquee - Animated Figlet!
VERSION
Version 1.0
SYNOPSIS
Acme::Curses::Marquee implements a scrolling messageboard widget, using figlet
to render the text.
use Curses;
use Acme::Curses::Marquee;
initscr;
# curses halfdelay mode is what actually drives the display
# and its argument is what determines the rate of the crawl
halfdelay(1);
# spawn subwindow to hold marquee and create marquee object
my $mw = subwin(9,80,0,0);
my $m = Acme::Curses::Marquee->new( window => $mw,
height => 9,
width => 80,
font => larry3d,
text => 'hello, world' );
# then, in the event loop
while (1) {
my $ch = getch;
do_input_processing_and_other_crud();
$m->scroll;
}
METHODS
new
Creates a new A::C::M object. Three arguments are required:
* window
* height
* width
window
should be a curses window that the marquee can write to. height
and width
should be the height and width of that window, in characters.
There are also two optional arguments: font
, which sets the figlet font of the marquee (defaults to the figlet default, 'standard'), and text
which will set an initial string to be displayed and cause the marquee to start display as soon as it is created.
scroll
Scroll the marquee one position to the right.
text
Take a new line of text for the marquee...
$m->text("New line of text");
...render it via figlet, split it into an array, and perform width adjustments as neccessary. Store the new text, figleted text, length of figleted text lines, and set marquee state to active.
font
Sets the font of the marquee object and then calls text
to make the display change.
$m->font('univers')
This method should not be called before the marquee object is active. No checking is done to ensure the spacified font exists.
is_active
Returns the marquee object's status (whether text has been set or not)
TODO
A couple of nice transitions when changing the message would be good.
Left-to-right scrolling?
AUTHOR
Shawn Boyette, <mdxi@cpan.org>
BUGS
Please report any bugs or feature requests to bug-acme-curses-marquee@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-Curses-Marquee. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2005 Shawn Boyette, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.