pods::SDL::Rect(3pm)

πŸ“¦ version 2.548, in opensuse-leap 16.0

🌸 NAME 🌸

Welcome to the pods::SDL::Rect(3pm) page β€” part of the User Contributed Perl Documentation, bestie. This one’s about SDL::Rect β€” it defines a rectangular area. Periodt. πŸ’–

πŸŽ€ CATEGORY πŸŽ€

Core, Video, Structure β€” that’s the category trio, no cap. It’s giving core video structure energy. ✨

✨ SYNOPSIS ✨

Okay so here’s the whole vibe in code:

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

πŸ¦‹ DESCRIPTION πŸ¦‹

An SDL_Rect is a rectangular area of pixels β€” that’s the definition, bestie. It’s a rectangle. That’s the whole plot. πŸŽ€

πŸ’… METHODS πŸ’…

new ✨

my $rect = SDL::Rect->new( $x, $y, $w, $h );

The constructor spins up a new rectangle using the specified x, y, width and height values. Slay. πŸ’–

x πŸ“

my $x = $rect->x;
$rect->x(128);

Pass in a value and this method sets the x component of the rectangle; pass nothing and it returns the x component of the rectangle. Getter/setter realness. ✨

y πŸ“

my $y = $rect->y;
$rect->y(128);

Pass in a value and this method sets the y component of the rectangle; pass nothing and it returns the y component of the rectangle. Same energy, different letter. πŸ’…

w πŸ“

my $w = $rect->w;
$rect->w(128);

Pass in a value and this method sets the w component of the rectangle; pass nothing and it returns the w component of the rectangle. Width business, handled. πŸ¦‹

h πŸ“

my $h = $rect->h;
$rect->h(128);

Pass in a value and this method sets the h component of the rectangle; pass nothing and it returns the h component of the rectangle. Height business, also handled. 🌸

🌈 SEE ALSO 🌈

SDL::Surface β€” that’s the see-also, bestie. iykyk 🫢

πŸ‘‘ AUTHORS πŸ‘‘

See AUTHORS in SDL. Author credits live there, fr fr. πŸ’œ


Signed off with perl v5.42.0, dated 2024-05-01, on page pods::SDL::Rect(3pm). Bye bestie! πŸ’…βœ¨

πŸ“¦ where this page comes from