C# Класс 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.
Наследование: Sprite
Показать файл Открыть проект

Открытые методы

Метод Описание
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

Описание методов

SmoothMovingSprite() публичный Метод

Initializes a SmoothMovingSprite at the origin which will match the dimensions of its texture when the texture is loaded
public SmoothMovingSprite ( ) : System
Результат System

SmoothMovingSprite() публичный Метод

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
Результат System

SmoothMovingSprite() публичный Метод

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
Результат System

getFractionTraveled() публичный Метод

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
Результат float

getSmoothMoveType() публичный Метод

public getSmoothMoveType ( ) : SmoothMoveType
Результат SmoothMoveType

isSmoothMoving() публичный Метод

public isSmoothMoving ( ) : bool
Результат bool

setSmoothMoveType() публичный Метод

public setSmoothMoveType ( SmoothMoveType type ) : void
type SmoothMoveType
Результат void

smoothMove() публичный Метод

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)
Результат void

smoothMove() публичный Метод

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
Результат void

smoothMoveCameraAdjust() публичный Метод

public smoothMoveCameraAdjust ( int delta_x, int delta_y ) : void
delta_x int
delta_y int
Результат void

smoothMoveCenter() публичный Метод

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)
Результат void

smoothMoveCenter() публичный Метод

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
Результат void

update() публичный Метод

public update ( float elapsed ) : void
elapsed float
Результат void