pods::SDL::Rect(3pm)
π SDL::Rect β the manual page, but make it make sense π
okay so bestie, you found your way to pods::SDL::Rect from the User Contributed Perl Documentation, and honestly? you're gonna slay this one. it's a little rectangle module. that's the whole vibe. let's get into it π«Ά
πΈ NAME πΈ
SDL::Rect β literally just defines a rectangular area. that's it. that's the whole thing. and honestly? iconic for that π
π CATEGORY π
Core, Video, Structure β so it's core, it's video-adjacent, and it's a structure. noted. moving on β¨
π¦ SYNOPSIS π¦
here's the whole flex, in code, exactly as it is:
my $rect = SDL::Rect->new(0, 0, 50, 4);
$rect->x(1);
$rect->y(2);
$rect->w(3);
my $x = $rect->x; # 1
my $y = $rect->y; # 2
my $w = $rect->w; # 3
my $h = $rect->h; # 4
see how it works? you make one, you poke the values, you read them back. lowkey satisfying ngl π
π DESCRIPTION π
so an SDL_Rect defines a rectangular area of pixels. pixels, bestie. that's the whole assignment. a little pixel rectangle doing its little pixel rectangle thing β¨
π METHODS π
π new
my $rect = SDL::Rect->new( $x, $y, $w, $h );
the constructor, aka the glow-up moment where your rectangle is born π« it creates a brand new rectangle with the x, y, width and height values you hand it. that's it, that's the birth certificate.
π x
my $x = $rect->x;
$rect->x(128);
dual-purpose queen π if you pass it a value, this method sets the x component of the rectangle. if you don't? it just returns the x component. same deal, no notes.
π y
my $y = $rect->y;
$rect->y(128);
exact same energy as x but vertical, bestie. pass a value β it sets the y component. don't pass one β it returns the y component. truly the y to your x fr fr π
π w
my $w = $rect->w;
$rect->w(128);
okay so w is width, obviously π pass a value and it sets the w component of the rectangle; keep your hands to yourself and it returns the w component. easy.
π h
my $h = $rect->h;
$rect->h(128);
and h is height, closing out the set π pass a value β it sets the h component; pass nothing β it returns the h component. periodt.
π§ SEE ALSO π§
SDL::Surfaceβ the other one you're gonna want in your life, iykyk π¦
π AUTHORS π
see "AUTHORS" in SDL β that's where the credit lives, not here. go give them their flowers π
and that's the tea β this whole page ispods::SDL::Rect(3pm)fromperl v5.42.3, dated2026-08-19. love that for us. bye bestie, go draw some rectangles πβ¨π
π¦ 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