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
Afficher le fichier Open project: ErraticUnicorn/MOSH

Méthodes publiques

Méthode 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 méthode

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

SmoothMovingSprite() public méthode

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
Résultat System

SmoothMovingSprite() public méthode

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
Résultat System

getFractionTraveled() public méthode

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
Résultat float

getSmoothMoveType() public méthode

public getSmoothMoveType ( ) : SmoothMoveType
Résultat SmoothMoveType

isSmoothMoving() public méthode

public isSmoothMoving ( ) : bool
Résultat bool

setSmoothMoveType() public méthode

public setSmoothMoveType ( SmoothMoveType type ) : void
type SmoothMoveType
Résultat void

smoothMove() public méthode

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)
Résultat void

smoothMove() public méthode

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
Résultat void

smoothMoveCameraAdjust() public méthode

public smoothMoveCameraAdjust ( int delta_x, int delta_y ) : void
delta_x int
delta_y int
Résultat void

smoothMoveCenter() public méthode

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)
Résultat void

smoothMoveCenter() public méthode

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
Résultat void

update() public méthode

public update ( float elapsed ) : void
elapsed float
Résultat void