SDLx::Controller::State(3pm)

SDLx::Controller::State3pm

The state of a sdlx::controller::interface

Usage

  # 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.

Category

Extension, Controller

Overview

A state object is a simple container for any given state inside a running SDLx::Controller::Interface instance.

Methods

new()

new( $x, $y, $v_x, $v_y, $rotation, $ang_v )

Creates a new state container object. Can optionally set the initial value of all its attributes (see below).

Accessors

x

Accessor to get/set the x value, usually used to position the item or check for collisions.

y

Accessor to get/set the y value, usually used to position the item or check for collisions.

v_x

Accessor to get/set the x velocity of the instance, for moving objects dynamically.

v_y

Accessor to get/set the y velocity of the instance, for moving objects dynamically.

rotation

Accessor to get/set the rotation of the object, in degrees (0..360).

ang_v

Accessor to get/set the angular velocity, for rotating objects dynamically.

Authors

See "AUTHORS" in SDL

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

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