/lib/pods/SDLx/Controller/State.pod
Unknown | 72 lines | 41 code | 31 blank | 0 comment | 0 complexity | eea46dbb6cf59d6a11452837a0ee68f6 MD5 | raw file
1=pod 2 3=head1 NAME 4 5SDLx::Controller::State - the state of a SDLx::Controller::Interface 6 7=head1 CATEGORY 8 9Extension, Controller 10 11=head1 SYNOPSIS 12 13 # you'll most likely get a State object from a SDLx::Controller::Interface 14 # object. Just in case, here's how you would construct one by hand: 15 my $state1 = SDLx::Controller::State->new; 16 my $state2 = SDLx::Controller::State->new( $x, $y, $v_x, $v_y, $rotation, $ang_v ); 17 18 # attributes are just simple accessors: 19 $state->x(10); 20 $state->x; # 10 21 22 # same goes for the rest: 23 $state->y; 24 $state->ang_v; 25 26 # etc. 27 28=head1 DESCRIPTION 29 30A state object is a simple container for any given state inside a running 31L<SDLx::Controller::Interface> instance. 32 33=head1 METHODS 34 35=head2 new() 36 37=head2 new( $x, $y, $v_x, $v_y, $rotation, $ang_v ) 38 39Creates a new state container object. Can optionally set the initial value 40of all its attributes (see below). 41 42=head1 ACCESSORS 43 44=head2 x 45 46Accessor to get/set the x value, usually used to position the item or check for collisions. 47 48=head2 y 49 50Accessor to get/set the y value, usually used to position the item or check for collisions. 51 52=head2 v_x 53 54Accessor to get/set the x velocity of the instance, for moving objects dynamically. 55 56=head2 v_y 57 58Accessor to get/set the y velocity of the instance, for moving objects dynamically. 59 60=head2 rotation 61 62Accessor to get/set the rotation of the object, in degrees (0..360). 63 64=head2 ang_v 65 66Accessor to get/set the angular velocity, for rotating objects dynamically. 67 68=head2 AUTHORS 69 70See L<SDL/AUTHORS> 71 72=cut