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 is pods::SDL::Rect(3pm) from perl v5.42.3, dated 2026-08-19. love that for us. bye bestie, go draw some rectangles πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from