UAV::Pilot::SDL::Window
my $window = UAV::Pilot::SDL::Window->new; $window->add_child( $window_event_handler ); # In the child's draw method $window->clear_screen; $window->draw_line( [0, 0], [128, 128], $color ); $window->draw_circle( [ 512, 512 ], 10, $color );
A basic windowing system for drawing widgets. Currently only supports adding new widgets on top or below an existing widget.
Does the UAV::Pilot::EventHandler role.
UAV::Pilot::EventHandler
add_child( $handler, $float ).
Pass a child that does the UAV::Pilot::SDL::WindowEventHandler role. Float should be <$window-TOP>> or <$window-BOTTOM>> for the location to draw this child. The window will be expanded to fit the child's width/height.
UAV::Pilot::SDL::WindowEventHandler
<$window-
add_child_with_yuv_overlay( $handle, $overlay_flag, $float )
Pass a child that does the UAV::Pilot::SDL::WindowEventHandler role. The $overlay_flag will be the flag passed to SDL::Overlay (see that module's docs for details). The $float param is the same as add_child().
$overlay_flag
SDL::Overlay
$float
add_child()
Returns the SDLx::App object for the given SDL window.
SDLx::App
If a child was added with add_child_with_yuv_overlay(), returns the SDL::Overlay object.
add_child_with_yuv_overlay()
If a child was added with add_child_with_yuv_overlay(), returns an SDL::Rect object that covers the overlay area.
SDL::Rect
The should only be used by widgets when their draw() method is called.
draw()
All $x, $y coordinates are relative to the widgets's drawing area.
$x, $y
Blanks the area that the current widget is being drawn in.
draw_txt( $string, $x, $y, $sdl_text )
Draws text to the screen. Params:
$string: The string to write
$string
$x, $y: The coords to draw at
$sdl_text: An SDLx::Text object
$sdl_text
SDLx::Text
draw_line( [$x0,$y0], [$x1,$y1], $color )
Draws a line. The $color param is an SDL::Color object.
$color
SDL::Color
draw_circle( [$x,$y], $radius, $color )
Draws a circle. The $color param is an SDL::Color object.
draw_rect( [$x, $y, $width, $height], $color )
Draws a rect. the $color param is an SDL::Color object.
To install UAV::Pilot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UAV::Pilot
CPAN shell
perl -MCPAN -e shell install UAV::Pilot
For more information on module installation, please visit the detailed CPAN module installation guide.