Index


NAME

Top

SDLx::LayerManager - Extension for managing layers in a 2D world

CATEGORY

Top

Extension

SYNOPSIS

Top

  use SDLx::Layer;
  use SDLx::LayerManager;

  use SDL::Image;
  use SDL::Surface;
  use SDL::Video;

  # creating layers
  my $layer1 = SDLx::Layer->new( SDL::Image::load('image1.png'), {userdata => '7'} );
  my $layer2 = SDLx::Layer->new( SDL::Image::load('image2.png'), 100, 200, {userdata => '42'} );

  # creating the manager that holds the layers
  my $layermanager = SDLx::LayerManager->new();
  $layermanager->add( $layer1 );
  $layermanager->add( $layer2 );

  my $display = # create your video surface here

  $layermanager->blit( $display );

  # accessing the layer at point(x,y)
  print( $layermanager->by_position( 150, 200 )->data->{userdata} ); # should print '42'

DESCRIPTION

Top

The LayerManager ...

METHODS

Top

new

add

layers

layer

length

blit

by_position

  my $layer = $layermanager->by_position( $x, $y );

ahead

behind

attach

detach_xy

detach_back

foreground

BUGS

Top

Report at sdlperl.ath.cx

SUPPORT

Top

#sdl irc.perl.org

AUTHOR

Top

    Tobias Leich
    CPAN ID: FROGGS
    ---
    froggs@cpan.org
    http://sdl.perl.org

COPYRIGHT

Top

SEE ALSO

Top

perl(1), SDL(2).