SDL::Rect(3pm)

SDL::Rect3pm

Defines a rectangular area

Usage

 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

Overview

An "SDL_Rect" defines a rectangular area of pixels.

Methods

new

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

The constructor creates a new rectangle with the specified x, y, width and height values.

x

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

If passed a value, this method sets the x component of the rectangle; if not, it returns the x component of the rectangle.

y

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

If passed a value, this method sets the y component of the rectangle; if not, it returns the y component of the rectangle.

w

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

If passed a value, this method sets the w component of the rectangle; if not, it returns the w component of the rectangle.

h

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

If passed a value, this method sets the h component of the rectangle; if not, it returns the h component of the rectangle.

Releases

12 releases since Debian 3.0 (Woody); the text changed 11 times.

  1. 3.0
  2. 3.1
  3. 4.0
  4. 5.0
  5. 6.0
  6. 7
  7. 8
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13

Authors

See "AUTHORS" in SDL.

From libsdl-perl 2.548-5+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.