</li>
<li><a href="#BUGS">BUGS</a></li>
<li><a href="#SUPPORT">SUPPORT</a></li>
-<li><a href="#AUTHOR">AUTHOR</a></li>
+<li><a href="#AUTHORS">AUTHORS</a></li>
<li><a href="#COPYRIGHT">COPYRIGHT</a></li>
<li><a href="#SEE_ALSO">SEE ALSO</a>
</li>
</div>
<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
<div id="DESCRIPTION_CONTENT">
-<p>The LayerManager ...</p>
+<p>SDLx::LayerManager is a package to handle a bunch of layers. A layer (see SDLx::Layer) is an SDL::Surface, the position of the surface on screen and some additional information.</p>
+<p>The layermanager gives you the opportunity to obtain the layer at a given point on screen and get the layers that are ahead or behind a layer.</p>
+<p>You will even be able to attach one or more layers to the mouse, e.g. for simulation some drag&drop functionality.</p>
</div>
<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
</div>
<h2 id="new">new</h2>
<div id="new_CONTENT">
+<pre> my $layermanager = SDLx::LayerManager->new();
+
+</pre>
+<p>This creates your layermanager object. It doesn't take any parameters.</p>
</div>
<h2 id="add">add</h2>
<div id="add_CONTENT">
+<pre> $layermanager->add( $layer );
+ $layermanager->add( SDLx::Layer->new( $surface, $x, $y, $options ) );
+
+</pre>
+<p>Call <code>add</code> to push an SDLx::Layer object to the layermanager.</p>
</div>
<h2 id="layers">layers</h2>
<div id="layers_CONTENT">
+<pre> my @layers = @{ $layermanager->layers };
+ my $first_layer = $layermanager->layers->[0];
+
+</pre>
+<p>The method <code>layers</code> returns all layers that were added before.</p>
</div>
<h2 id="layer">layer</h2>
<div id="layer_CONTENT">
+<pre> my $layer = $layermanager->layer( $index );
+
+</pre>
+<p>To obtain only one layer at index <code>$index</code> use this function. <code>$index</code> ranges from <code>0</code> to <code>lenght - 1</code>.</p>
</div>
<h2 id="length">length</h2>
<div id="length_CONTENT">
+<pre> my $length = $layermanager->length();
+
+</pre>
+<p>This method returns the count of the added layers.</p>
</div>
<h2 id="blit">blit</h2>
<div id="blit_CONTENT">
+<pre> $layermanager->blit( $surface );
+
+</pre>
+<p>This method blits all layers to the surface (e.g. your video surface).</p>
</div>
<h2 id="by_position">by_position</h2>
<pre> my $layer = $layermanager->by_position( $x, $y );
</pre>
+<p><code>by_position</code> returns the <code>SDLx::Layer</code> object at point <code>$x $y</code>, which is not fully transparent at this pixel.</p>
</div>
<h2 id="ahead">ahead</h2>
<div id="ahead_CONTENT">
+<pre> my @layers = @{ $layermanager->ahead( $index ) };
+
+</pre>
+<p>This method returns all layers that are ahead of the given layer indicated by <code>$index</code>.
+Ahead means that a layer has a higher z-index and is blitted over the given layer.</p>
+<p><strong>Note</strong>: This method doesn't check for transparency. This will change in future versions.</p>
</div>
<h2 id="behind">behind</h2>
<div id="behind_CONTENT">
+<pre> my @layers = @{ $layermanager->behind( $index ) };
+
+</pre>
+<p>This method returns all layers that are behind of the given layer indicated by <code>$index</code>.
+Behind means that a layer has a lower z-index and is blitted before the given layer.</p>
+<p><strong>Note</strong>: This method doesn't check for transparency. This will change in future versions.</p>
</div>
<h2 id="attach">attach</h2>
<div id="attach_CONTENT">
+<pre> $layermanager->attach( $layer, $x, $y );
+ $layermanager->attach( @layers, $x, $y );
+
+</pre>
+<p>This function makes the given layer(s) sticky to the mouse. If you move the mouse the layer(s) will follow.
+The layermanager blits these layers at last, so they will appear on top of all layers.</p>
+<p><code>$x</code> and <code>$y</code> should be set to the coords of the mouse, e.g. the coords of the mouse click.
+If you omit <code>$x</code> and <code>$y</code> the layermanager obtains them via SDL::Events::get_mouse_state.</p>
+<p><strong>Note</strong>: The z-index is not changed for the given layers.</p>
</div>
<h2 id="detach_xy">detach_xy</h2>
<div id="detach_xy_CONTENT">
+<pre> $layermanager->detach_xy( $x, $y );
+
+</pre>
+<p><code>detach_xy</code> detaches the prevously attached layers to the given coords. The upper left corner of the backmost layer will be at <code>$x</code> and <code>$y</code>.
+The other layers are positioned relative to the backmost layer just like before.</p>
</div>
<h2 id="detach_back">detach_back</h2>
<div id="detach_back_CONTENT">
+<pre> $layermanager->detach_back( );
+
+</pre>
+<p><code>detach_back</code> detaches the prevously attached layers back to the position where they were attached.</p>
</div>
<h2 id="foreground">foreground</h2>
<div id="foreground_CONTENT">
+<pre> $layermanager->foreground( $layer );
+ $layermanager->foreground( @layers );
+
+</pre>
+<p>This method moves the given layer(s) to the foreground so that they are blittet on top of the other layers.</p>
</div>
<h1 id="BUGS">BUGS</h1><p><a href="#TOP" class="toplink">Top</a></p>
<p>#sdl irc.perl.org</p>
</div>
-<h1 id="AUTHOR">AUTHOR</h1><p><a href="#TOP" class="toplink">Top</a></p>
-<div id="AUTHOR_CONTENT">
-<pre> Tobias Leich
- CPAN ID: FROGGS
- ---
- froggs@cpan.org
- http://sdl.perl.org
-
-</pre>
+<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="AUTHORS_CONTENT">
+<p>See <b>AUTHORS</b> in <cite>SDL</cite>.</p>
</div>
<h1 id="COPYRIGHT">COPYRIGHT</h1><p><a href="#TOP" class="toplink">Top</a></p>