Updated the site
[sdlgit/SDL-Site.git] / pages / SDLx-Surface.html-inc
index e2b5196..c492fc6 100644 (file)
 <ul><li><a href="#surface">surface</a></li>
 <li><a href="#w_h_format_pitch_flags">w, h, format, pitch, flags</a></li>
 <li><a href="#clip_rect">clip_rect</a></li>
-</ul>
-</li>
-<li><a href="#EXTENSIONS">EXTENSIONS</a>
-<ul><li><a href="#load">load</a></li>
+<li><a href="#load">load</a></li>
 <li><a href="#blit">blit </a></li>
 <li><a href="#blit_by">blit_by</a></li>
 <li><a href="#flip">flip</a></li>
 <li><a href="#update">update</a></li>
 <li><a href="#draw_rect">draw_rect</a></li>
 <li><a href="#draw_line">draw_line</a></li>
+<li><a href="#draw_circle">draw_circle</a></li>
+<li><a href="#draw_circle_filled">draw_circle_filled</a></li>
+<li><a href="#draw_gfx_text">draw_gfx_text</a></li>
 </ul>
 </li>
-<li><a href="#AUTHOR">AUTHOR</a>
+<li><a href="#AUTHORS">AUTHORS</a>
 </li>
 </ul><hr />
 <!-- INDEX END -->
@@ -96,7 +96,7 @@
 </div>
 <h2 id="display">display</h2>
 <div id="display_CONTENT">
-<p>If <a href="http://search.cpan.org/perldoc?SDLx::App::new">SDLx::App::new</a> or <a href="/SDL-Video.html#get_video_mode">SDL::Video::get_video_mode</a> called before then:</p>
+<p>If <a href="/SDLx-App.html#new">SDLx::App::new</a> or <a href="/SDL-Video.html#get_video_mode">SDL::Video::get_video_mode</a> called before then:</p>
 <pre> my $appx = SDLx::Surface::display(); 
 
 </pre>
 
 </pre>
 <p>You can also use the keys <code>w</code> and <code>h</code> in place of <code>width</code> and <code>height</code>, as with <code>new</code>.</p>
-<p>Get or create the main display surface and attach to a SDLx::Surface.</p>
+<p>Get or create the main display surface and attach to a <code>SDLx::Surface</code>.</p>
 
 </div>
 <h2 id="duplicate">duplicate</h2>
 </div>
 <h2 id="clip_rect">clip_rect</h2>
 <div id="clip_rect_CONTENT">
-<p>Sets the passed <code>SDL::Rect</code> as the new clip_rect for the surface. Returns the SDL::Surface's clip_rect. See <code>SDL::Video::get_clip_rect</code> and <code>SDL::Video::set_clip_rect</code>.</p>
-
-</div>
-<h1 id="EXTENSIONS">EXTENSIONS</h1><p><a href="#TOP" class="toplink">Top</a></p>
-<div id="EXTENSIONS_CONTENT">
+<p>Sets the passed <code>SDL::Rect</code> as the new clip_rect for the surface. Returns the SDL::Surface's clip_rect. See 
+<a href="/SDL-Video.html#get_clip_rect">SDL::Video::get_clip_rect</a> and <a href="/SDL-Video.html#set_clip_rect">SDL::Video::set_clip_rect</a>.
+=head1 EXTENSIONS</p>
 
 </div>
 <h2 id="load">load</h2>
@@ -169,8 +167,9 @@ supported.</p>
 <pre> $sdlx_surface-&gt;blit( $dest, $src_rect, $dest_rect );
 
 </pre>
-<p>Blits SDLx::Surface onto $dest surface. 
-$src_rect or $dest_rect are optional. If $src_rect is ommited, it will be the size of the entire surface. If $dest_rect is ommited, it will be blitted at <code>(0, 0)</code>. $src_rect or $dest_rect can be array refs or SDL::Rect. $dest can be SDLx::Surface or SDL::Surface.</p>
+<p>Blits <code>SDLx::Surface</code> onto $dest surface. 
+$src_rect or $dest_rect are optional. If $src_rect is ommited, it will be the size of the entire surface. If $dest_rect is ommited, 
+it will be blitted at <code>(0, 0)</code>. $src_rect or $dest_rect can be array refs or <code>SDL::Rect</code>. $dest can be <code>SDLx::Surface</code> or <code>SDL::Surface</code>.</p>
 <p>Returns $self</p>
 
 </div>
@@ -197,7 +196,8 @@ This is useful when the surface you have isn't an <code>SDLx::Surface</code>, bu
  $sdlx_surface-&gt;update( [ SDL::Rect-&gt;new(0,0,1,2) ... ]); # defined rects are updated
 
 </pre>
-<p>Applies <a href="/SDL-Video.html#update_rect">SDL::Video::update_rect</a> for no rect or 1 array ref. Applies <a href="/SDL-Video.html#update_rects">SDL::Video::update_rects</a> for array of <a href="SDL-Rect.html">SDL::Rect</a>s. </p>
+<p>Applies <a href="/SDL-Video.html#update_rect">SDL::Video::update_rect</a> for no rect or 1 array ref. Applies 
+<a href="/SDL-Video.html#update_rects">SDL::Video::update_rects</a> for array of <a href="SDL-Rect.html">SDL::Rect</a>s. </p>
 <p>Returns $self</p>
 
 
@@ -225,11 +225,57 @@ This is useful when the surface you have isn't an <code>SDLx::Surface</code>, bu
 <p>Returns $self</p>
 
 </div>
-<h1 id="AUTHOR">AUTHOR</h1><p><a href="#TOP" class="toplink">Top</a></p>
-<div id="AUTHOR_CONTENT">
-<pre> kthakore 
+<h2 id="draw_circle">draw_circle</h2>
+<div id="draw_circle_CONTENT">
+<pre> $sdlx_surface-&gt;draw_circle( [$x1, $y1], $radius, \@color, $antialias ); 
 
 </pre>
+<p>Draws an unfilled circle at <code>($x1,$y1)</code> of size $radius and $color.
+Antialias is turned on if $antialias is true. 
+Returns $self</p>
+
+</div>
+<h2 id="draw_circle_filled">draw_circle_filled</h2>
+<div id="draw_circle_filled_CONTENT">
+<pre> $sdlx_surface-&gt;draw_filled_circle( [$x1, $y1], $radius, \@color ); 
+
+</pre>
+<p>Draws an <strong>filled</strong> circle at <code>($x1,$y1)</code> of size $radius and $color.
+Antialias is turned on automatically. 
+Returns $self</p>
+
+
+
+
+
+
+
+
+</div>
+<h2 id="draw_gfx_text">draw_gfx_text</h2>
+<div id="draw_gfx_text_CONTENT">
+<p>Draw text using gfx (not pretty but fast) at give vector, color.</p>
+<pre> $surf-&gt;draw_gfx_text( [0,0], 0xffffffff, &quot;fooo&quot;);
+ $surf-&gt;draw_gfx_text( [10,10], [20,20,20,20], &quot;fooo&quot;);
+
+</pre>
+<p>You can also set the gfx font but passing a hash reference as shown below.</p>
+<pre> my $f = '';
+ open( my $FH, '&lt;', 'test/data/5x7.fnt');
+ binmode ($FH);
+ read($FH, $f, 4096);
+ close ($FH);
+
+ my $font =  {data=&gt;$f, cw =&gt; 5, ch =&gt; 7};
+ $surf-&gt;draw_gfx_text( [0,0], 0xffffffff, &quot;fooo&quot;, $font );
+
+</pre>
+<p>Returns $self</p>
+
+</div>
+<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
+<div id="AUTHORS_CONTENT">
+<p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a>.</p>
 
 </div>
 </div>
\ No newline at end of file