pods::...::State(3pm)
π NAME
SDLx::Controller::State β the state of a SDLx::Controller::Interface. It's literally just a little container that holds "where stuff is right now," bestie. That's the whole vibe.
π CATEGORY
Extension, Controller β iykyk.
β¨ SYNOPSIS
# you'll most likely get a State object from a SDLx::Controller::Interface
# object. Just in case, here's how you would construct one by hand:
my $state1 = SDLx::Controller::State->new;
my $state2 = SDLx::Controller::State->new( $x, $y, $v_x, $v_y, $rotation, $ang_v );
# attributes are just simple accessors:
$state->x(10);
$state->x; # 10
# same goes for the rest:
$state->y;
$state->ang_v;
# etc.
So yeah β pass an argument, it sets the thing. Pass nothing, it hands the thing back to you. Iconic behavior, no notes. π
π¦ DESCRIPTION
Okay so picture this: a SDLx::Controller::Interface instance is out here living its life, running, doing its controller thing. And a state object? It's just a simple container for any given state inside that running instance. That's it. That's the whole job. Lowkey the easiest gig in the whole SDLx ecosystem. π«Ά
π METHODS
πΈ new()
πΈ new( $x, $y, $v_x, $v_y, $rotation, $ang_v )
Creates a new state container object, periodt. And because it's generous like that, it can optionally set the initial value of all its attributes right at birth (peep the accessors below for the full lineup π).
β ACCESSORS
Every single one of these is a get/set accessor β call it with a value to set, call it with nothing to get. Chef's kiss symmetry. π
- ### π
xAccessor to get/set thexvalue. Usually you're using this to position the item, or to check for collisions. Yes bestie, collisions. π - ### π
yAccessor to get/set theyvalue. Same deal β usually for positioning the item or checking for collisions. - ### π
v_xAccessor to get/set thexvelocity of the instance. This is the one that makes objects move dynamically, fr fr. π₯ - ### π
v_yAccessor to get/set theyvelocity of the instance. Also for moving objects dynamically. Your object is gonna be moving, your honor. - ### π
rotationAccessor to get/set the rotation of the object, in degrees (0..360). Note the range, bestie β degrees, not radians, so don't come at it with your math-class radians, it will not understand you. π - ### π
ang_vAccessor to get/set the angular velocity, for rotating objects dynamically. Spin city. π
π AUTHORS
See "AUTHORS" in SDL β they're the ones to thank for this whole situation. π
And that's the page, bestie β go forth and container-ize your state. Run that vibe check. β¨
Source/version tea: this is pods::...::State(3pm) from the User Contributed Perl Documentation, sitting pretty at perl v5.42.0, dated 2024-05-01. π¦π
perl v5.42.0 Β· 2024-05-01 Β· pods::...::State(3pm) β mwah, see u in the docs π
π¦ where this page comes from
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: perl-SDL 2.548-bp160.1.13 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms