Acme::Curses::Marquee - Animated Figlet!
Version 1.0
Acme::Curses::Marquee implements a scrolling messageboard widget, using figlet to render the text.
figlet
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; }
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.
window
height
width
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.
font
text
Scroll the marquee one position to the right.
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.
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.
Returns the marquee object's status (whether text has been set or not)
A couple of nice transitions when changing the message would be good.
Left-to-right scrolling?
Shawn Boyette, <mdxi@cpan.org>
<mdxi@cpan.org>
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.
bug-acme-curses-marquee@rt.cpan.org
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.
To install Acme::Curses::Marquee, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Acme::Curses::Marquee
CPAN shell
perl -MCPAN -e shell install Acme::Curses::Marquee
For more information on module installation, please visit the detailed CPAN module installation guide.