C# Class SunsetHigh.SmoothMovingSprite

An extension of Sprite that is designed to move automatically to any given location. Different types of movement (specified in the SmoothMoveType enum) can be used for different effects.
Inheritance: Sprite
Mostrar archivo Open project: ErraticUnicorn/MOSH

Public Methods

Method Description
SmoothMovingSprite ( ) : System

Initializes a SmoothMovingSprite at the origin which will match the dimensions of its texture when the texture is loaded

SmoothMovingSprite ( int x, int y ) : System

Initializes a SmoothMovingSprite at the given position. It will match the dimensions of its texture when the texture is loaded.

SmoothMovingSprite ( int x, int y, int width, int height ) : System

Initializes a SmoothMovingSprite at the given position with the given dimensions

getFractionTraveled ( ) : float

Returns a number between 0.0 and 1.0 representing the distance between the start and end points of this object's current travel.

getSmoothMoveType ( ) : SmoothMoveType
isSmoothMoving ( ) : bool
setSmoothMoveType ( SmoothMoveType type ) : void
smoothMove ( int x, int y ) : void

Queues the Sprite to begin smoothly moving to a specified point within a default amount of time.

smoothMove ( int x, int y, float time ) : void

Requests that the Sprite begin smoothly moving to a specified point within the given amount of time.

smoothMoveCameraAdjust ( int delta_x, int delta_y ) : void
smoothMoveCenter ( int x, int y ) : void

Requests that the Sprite begin smoothly moving its center to a specified point within the default amount of time

smoothMoveCenter ( int x, int y, float time ) : void

Requests that the Sprite begin smoothly moving its center to a specified point within the given amount of time

update ( float elapsed ) : void

Method Details

SmoothMovingSprite() public method

Initializes a SmoothMovingSprite at the origin which will match the dimensions of its texture when the texture is loaded
public SmoothMovingSprite ( ) : System
return System

SmoothMovingSprite() public method

Initializes a SmoothMovingSprite at the given position. It will match the dimensions of its texture when the texture is loaded.
public SmoothMovingSprite ( int x, int y ) : System
x int X coordinate of top-left corner
y int Y coordinate of top-left corner
return System

SmoothMovingSprite() public method

Initializes a SmoothMovingSprite at the given position with the given dimensions
public SmoothMovingSprite ( int x, int y, int width, int height ) : System
x int X coordinate of top-left corner
y int Y coordinate of top-left corner
width int Width in pixels
height int Height in pixels
return System

getFractionTraveled() public method

Returns a number between 0.0 and 1.0 representing the distance between the start and end points of this object's current travel.
public getFractionTraveled ( ) : float
return float

getSmoothMoveType() public method

public getSmoothMoveType ( ) : SmoothMoveType
return SmoothMoveType

isSmoothMoving() public method

public isSmoothMoving ( ) : bool
return bool

setSmoothMoveType() public method

public setSmoothMoveType ( SmoothMoveType type ) : void
type SmoothMoveType
return void

smoothMove() public method

Queues the Sprite to begin smoothly moving to a specified point within a default amount of time.
public smoothMove ( int x, int y ) : void
x int X coordinate of the new location (upper-left corner)
y int Y coordinate of the new location (upper-left corner)
return void

smoothMove() public method

Requests that the Sprite begin smoothly moving to a specified point within the given amount of time.
public smoothMove ( int x, int y, float time ) : void
x int X coordinate of the new location (upper-left corner)
y int Y coordinate of the new location (upper-left corner)
time float Time taken to move in seconds
return void

smoothMoveCameraAdjust() public method

public smoothMoveCameraAdjust ( int delta_x, int delta_y ) : void
delta_x int
delta_y int
return void

smoothMoveCenter() public method

Requests that the Sprite begin smoothly moving its center to a specified point within the default amount of time
public smoothMoveCenter ( int x, int y ) : void
x int X coordinate of the new location (center)
y int Y coordinate of the new location (center)
return void

smoothMoveCenter() public method

Requests that the Sprite begin smoothly moving its center to a specified point within the given amount of time
public smoothMoveCenter ( int x, int y, float time ) : void
x int X coordinate of the new location (center)
y int Y coordinate of the new location (center)
time float Time taken to move in seconds
return void

update() public method

public update ( float elapsed ) : void
elapsed float
return void