pods::...tozoom(3pm)
π¦ NAME π¦
okay bestie, welcome to pods::...tozoom(3pm) β the manual page for SDL::GFX::Rotozoom, aka the rotation and zooming functions for surfaces. itβs giving surface glow-up, no cap. β¨
πΈ CATEGORY πΈ
GFX β yes queen, thatβs the category. π
π CONSTANTS π
The constants are exported by default. You can avoid this by doing:
use SDL::GFX::Rotozoom ();
and access them directly:
SDL::GFX::Rotozoom::SMOOTHING_OFF;
or by choosing the export tags below:
π Export tag: ':smoothing' π
SMOOTHING_OFFSMOOTHING_ON
β¨ METHODS β¨
π« surface π«
my $new_surface = SDL::GFX::Rotozoom::surface( $surface, $angle, $zoom, $smooth );
With SDL::GFX::Rotozoom::surface you have the opportunity to rotate and zoom a given surface. The surface will be rotated counter clockwise (in degrees). Pass SMOOTHING_ON or SMOOTHING_OFF in order to turn it on or off. π₯
Note: The new surface (with$"zoom == 1") will usually be bigger than the source$surface. π
Note: Note: new surface should be less than 16384 in width and height. important!! π
Example:
use SDL;
use SDL::Video;
use SDL::Rect;
use SDL::Surface;
use SDL::GFX::Rotozoom;
my $screen_width = 640;
my $screen_height = 480;
SDL::init(SDL_INIT_VIDEO);
my $screen = SDL::Video::set_video_mode(800, 600, 32, SDL_SWSURFACE);
my $picture = SDL::Video::load_BMP('test.bmp');
my $rotated = SDL::GFX::Rotozoom::surface( $picture, 45, 0.8, SMOOTHING_ON );
SDL::Video::blit_surface( $rotated, SDL::Rect->new(0, 0, $rotated->w, $rotated->h),
$screen, SDL::Rect->new(0, 0, 0, 0) );
SDL::Video::update_rect( $screen, 0, 0, 0, 0 );
sleep(2);
π surface_xy π
my $new_surface = SDL::GFX::Rotozoom::surface_xy( $surface, $angle, $zoom_x, $zoom_y, $smooth );
Same as SDL::GFX::Rotozoom::surface but you can specify the zoomlevel for x and y separately. slay, separate zoom energy. π
π§ surface_size π§
my ($new_width, $new_height) = @{ SDL::GFX::Rotozoom::surface_size( $width, $height, $angle, $zoom ) };
surface_size will give you the width and height of a rotating/zoom operation for the given $width and $height. Helpful for knowing the surface size before you actually do the rotating/zoom operation. π«Ά
π surface_size_xy π
my ($new_width, $new_height) = @{ SDL::GFX::Rotozoom::surface_size_xy( $width, $height, $angle, $zoom_x, $zoom_y ) };
Same as SDL::GFX::Rotozoom::surface_size but you can specify the zoomlevel for x and y separately. π
π₯ zoom_surface π₯
my $new_surface = SDL::GFX::Rotozoom::zoom_surface( $surface, $zoom_x, $zoom_y, $smooth );
Same as SDL::GFX::Rotozoom::surface_xy except you can zoom only. no rotation, just zoom zoom. π
β zoom_surface_size β
my ($new_width, $new_height) = SDL::GFX::Rotozoom::zoom_surface_size( $width, $height, $zoom_x, $zoom_y );
Same as SDL::GFX::Rotozoom::surface_size_xy except you can specify zoom only. iconic, honestly. β¨
π shrink_surface π
my $new_surface = SDL::GFX::Rotozoom::shrink_surface( $surface, $factor_x, $factor_y );
Specialized function for shrinking a surface. tiny vibes. π
π rotate_surface_90_degrees π
my $new_surface = SDL::GFX::Rotozoom::rotate_surface_90_degrees( $surface, $num_clockwise_turns );
Rotating a surface $num_clockwise_turns-times. spin it, bestie. π
π AUTHORS π
See "AUTHORS" in SDL. π
mwah π this page was served by perl v5.42.3, dated 2026-08-19, from the User Contributed Perl Documentation corner of the internet. bye bestie, go rotate something iconic π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: libsdl-perl 2.548-6build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms