NAME
Graphics::Raylib::Text - Output text to window
VERSION
version 0.025
SYNOPSIS
use strict;
use warnings;
use Graphics::Raylib;
use Graphics::Raylib::Color;
use Graphics::Raylib::Text;
my $i = 0;
my $text = Graphics::Raylib::Text->new(
color => Graphics::Raylib::Color::DARKGRAY,
size => 20,
);
while (!$g->exiting)
{
$text->text = "Generation " . ($i++);
Graphics::Raylib::draw {
$g->clear(Graphics::Raylib::Color::BLACK);
$text->draw;
};
}
METHODS AND ARGUMENTS
- new( text => $text, color => $color, position => [$x, $y], size => [$width, $height] )
-
Constructs a new Graphics::Raylib::Text instance. Position defaults to
[0,0]
and size to10
. - draw
-
Constructs a new Graphics::Raylib::Text instance. Position defaults to
[0,0]
and size to10
. - ->text = "Text";
-
L-value subroutine to change text.
PREDEFINED OBJECTS
- FPS
-
An already constructed
Graphics::Raylib::Text
, that draws FPS to the top left corner.
GIT REPOSITORY
http://github.com/athreef/Graphics-Raylib
SEE ALSO
Graphics::Raylib Graphics::Raylib::Color
AUTHOR
Ahmad Fatoum <athreef@cpan.org>
, http://a3f.at
COPYRIGHT AND LICENSE
Copyright (C) 2017 Ahmad Fatoum
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.