X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDLx-Surface.html-inc;h=873310b64c05ae944fb7a036fa531bcf1fa23e48;hb=505f308d8b092747da8b2f5e9781475a1f06dfe8;hp=195a24dc6d7b31bf6c1aad5d1982392a25bceb53;hpb=30fd24c26cb4e59a5937d49aa4810269ace3a8b0;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDLx-Surface.html-inc b/pages/SDLx-Surface.html-inc index 195a24d..873310b 100644 --- a/pages/SDLx-Surface.html-inc +++ b/pages/SDLx-Surface.html-inc @@ -6,16 +6,25 @@
An SDLx::Surface
allows matrix read and write to a surface, safely.
If a SDL::Surface is passed it is attached to the matrix. Returns the SDL::Surface that is currently attached to this SDLx::Surface
- -If SDLx::App::new or SDL::Video::get_video_mode called before then:
-my $appx = SDLx::Surface::get_display(); +my $appx = SDLx::Surface::display();gets the display if it is already made. Passed options are ignored. Otherwise you can quickly make the display with :
-SDLx::Surface::get_display( width => 20, height => 20) #depth => 32 and SDL_ANYFORMAT used +SDLx::Surface::display( width => 20, height => 20) #depth => 32 and SDL_ANYFORMAT usedor you can also pass flags and depth.
-SDLx::Surface::get_display( width => 20, height => 20, flags=> SDL_HWSURFACE, depth=>24) +SDLx::Surface::display( width => 20, height => 20, flags=> SDL_HWSURFACE, depth=>24)+You can also use the keys
w
andh
in place ofwidth
andheight
, as withnew
.Get or create the main display surface and attach to a SDLx::Surface.
Does a attributes only, no pixel, copy of another SDLx::Surface.
+ +If a SDL::Surface is passed it is attached to the matrix. Returns the SDL::Surface that is currently attached to this SDLx::Surface
+ +Returns the inner SDL::Surface's respective attribute. See SDL::Surface
.
Sets the passed SDL::Rect
as the new clip_rect for the surface. Returns the SDL::Surface's clip_rect. See SDL::Video::get_clip_rect
and SDL::Video::set_clip_rect
.
Blits SDLx::Surface onto $dest surface. -$src_rect or $dest_rect are optional. $src_rect or $dest_rect can be array refs or SDL::Rect. $dest can be SDLx::Surface or SDL::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(0, 0)
. $src_rect or $dest_rect can be array refs or SDL::Rect. $dest can be SDLx::Surface or SDL::Surface.
Returns $self
$sdlx_surface->blit_by( $src, $src_rect, $dest_rect ); + ++
Does the same as blit
but the SDLx::Surface
is the one being blitted to.
+This is useful when the surface you have isn't an SDLx::Surface
, but the surface it is being blitted to is.
Applies SDL::Video::flip to the Surface, with error checking.
@@ -134,13 +175,34 @@ $src_rect or $dest_rect are optional. $src_rect or $dest_rect can be array refsApplies SDL::Video::update_rect for no rect or 1 array ref. Applies SDL::Video::update_rects for array of SDL::Rects.
Returns $self
+ + + +kthakore +draw_rect
+++$sdlx_surface->draw_rect( [$x,$y,$w,$h], 0xFFFF00FF ); + $sdlx_surface->draw_rect( SDL::Rect->new($x,$y,$w,$h), 0xFFFF00FF ); ++Draws a rect on the surface with the given color. If the rect is ommited, the colored rect will be drawn to the entire surface.
+Returns $self
+draw_line
+++$sdlx_surface->draw_line( [$x1, $y1], [$x2, $y2], $color, $antialias); # $color is a number + $sdlx_surface->draw_line( [$x1, $y1], [$x2, $y2], \@color, $antialias); # + ++Draws a line on the surface. Antialias is turned on if $antialias is true.
+Returns $self
+AUTHOR
++kthakore