/lib/pods/SDLx/Controller/State.pod

http://github.com/PerlGameDev/SDL · Unknown · 72 lines · 41 code · 31 blank · 0 comment · 0 complexity · eea46dbb6cf59d6a11452837a0ee68f6 MD5 · raw file

  1. =pod
  2. =head1 NAME
  3. SDLx::Controller::State - the state of a SDLx::Controller::Interface
  4. =head1 CATEGORY
  5. Extension, Controller
  6. =head1 SYNOPSIS
  7. # you'll most likely get a State object from a SDLx::Controller::Interface
  8. # object. Just in case, here's how you would construct one by hand:
  9. my $state1 = SDLx::Controller::State->new;
  10. my $state2 = SDLx::Controller::State->new( $x, $y, $v_x, $v_y, $rotation, $ang_v );
  11. # attributes are just simple accessors:
  12. $state->x(10);
  13. $state->x; # 10
  14. # same goes for the rest:
  15. $state->y;
  16. $state->ang_v;
  17. # etc.
  18. =head1 DESCRIPTION
  19. A state object is a simple container for any given state inside a running
  20. L<SDLx::Controller::Interface> instance.
  21. =head1 METHODS
  22. =head2 new()
  23. =head2 new( $x, $y, $v_x, $v_y, $rotation, $ang_v )
  24. Creates a new state container object. Can optionally set the initial value
  25. of all its attributes (see below).
  26. =head1 ACCESSORS
  27. =head2 x
  28. Accessor to get/set the x value, usually used to position the item or check for collisions.
  29. =head2 y
  30. Accessor to get/set the y value, usually used to position the item or check for collisions.
  31. =head2 v_x
  32. Accessor to get/set the x velocity of the instance, for moving objects dynamically.
  33. =head2 v_y
  34. Accessor to get/set the y velocity of the instance, for moving objects dynamically.
  35. =head2 rotation
  36. Accessor to get/set the rotation of the object, in degrees (0..360).
  37. =head2 ang_v
  38. Accessor to get/set the angular velocity, for rotating objects dynamically.
  39. =head2 AUTHORS
  40. See L<SDL/AUTHORS>
  41. =cut