C# Класс FlatRedBall.Sprite

Наследование: FlatRedBall.PositionedObject
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
mCursorSelectable bool

Private Properties

Свойство Тип Описание
CollideAgainst bool
CollideAgainst bool
CollideAgainst bool
CollideAgainst bool
CollideAgainstMove bool
CollideAgainstMove bool
CopyCustomBehaviorFrom void
IMouseOver bool
OnCustomBehavior void
OnRemove void
PlatformSpecificInitialization void
SetAnimationChain void
SetCollision void
SetCollision void
SetCollision void
SetCollision void
UpdateColorsAccordingToAlpha void
UpdateFrameBasedOffOfTimeIntoAnimation void
UpdateScale void
UpdateTimeBasedOffOfAnimationFrame void
UpdateVertices void

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

Метод Описание
AnimateSelf ( double currentTime ) : void

Performs the every-frame logic for updating the current AnimationFrame index. If the Sprite is part of the SpriteManager then this is automatically called.

ClearAnimationChains ( ) : void

Clears all references to AnimationChains and sets the Animate property to false.

ClearCollision ( ) : void
Clone ( ) : Sprite

Returns a clone of this instance.

Attachments are not cloned. The new clone will not have any parents or children.

CloneForRig ( ) : Sprite
ForceUpdateDependenciesDeep ( ) : void
GetAnimationInformation ( ) : string
Initialize ( ) : void
Initialize ( bool initializeListsBelongingTo ) : void
IsMouseOver ( Cursor cursor, Layer layer ) : bool
Pause ( FlatRedBall instructions ) : void
RemoveAnimationChain ( AnimationChain chainToRemove ) : void

Removes the AnimationChain from the Sprite's internal AnimationChain List.

If the chainToRemove is also the CurrentChain, the animate field is set to false.

SetAnimationChain ( AnimationChain chainToSet ) : void

Sets the argument chainToSet as the animationChain. If the argument chainToSet is not part of the Sprite's internal list of AnimationChains, it is added.

This differs from FlatRedBall MDX - this method on FlatRedBall MDX does not add the argument AnimationChain to the Sprite's internal list.

This does not set any animation-related properties, but it does set the current texture to the current frame's texture. Therefore, it is still necessary to set Animate to true.

SetAnimationChain ( AnimationChain chainToSet, double timeIntoAnimation ) : void
SetScaleXRatioToY ( ) : void

Sets the ScaleY so that the ScaleX/ScaleY ratio is the same as the source image used for the Sprite's texture.

SetScaleYRatioToX ( ) : void

Sets the ScaleY so that the ScaleX/ScaleY ratio is the same as the source image used for the Sprite's texture.

Sprite ( ) : System
TimedActivity ( float secondDifference, double secondDifferenceSquaredDividedByTwo, float secondsPassedLastFrame ) : void

Applies all velocities, rates, accelerations for real and relative values. If the Sprite is part of the SpriteManager (which is common) then this is automatically called.

ToString ( ) : string
UpdateToCurrentAnimationFrame ( ) : void

Приватные методы

Метод Описание
CollideAgainst ( AxisAlignedRectangle axisAlignedRectangle ) : bool
CollideAgainst ( System.Line line ) : bool
CollideAgainst ( Polygon polygon ) : bool
CollideAgainst ( Sprite sprite ) : bool
CollideAgainstMove ( Polygon polygon, float thisMass, float otherMass ) : bool
CollideAgainstMove ( Sprite sprite, float thisMass, float otherMass ) : bool
CopyCustomBehaviorFrom ( Sprite spriteToCopyFrom ) : void
IMouseOver ( Cursor cursor ) : bool
OnCustomBehavior ( ) : void
OnRemove ( ) : void
PlatformSpecificInitialization ( ) : void
SetAnimationChain ( string chainToSet ) : void
SetCollision ( AxisAlignedRectangle rectangle ) : void
SetCollision ( Circle circle ) : void
SetCollision ( System.Line line ) : void
SetCollision ( Polygon polygon ) : void
UpdateColorsAccordingToAlpha ( ) : void
UpdateFrameBasedOffOfTimeIntoAnimation ( ) : void
UpdateScale ( ) : void
UpdateTimeBasedOffOfAnimationFrame ( ) : void
UpdateVertices ( Camera camera ) : void

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

AnimateSelf() публичный метод

Performs the every-frame logic for updating the current AnimationFrame index. If the Sprite is part of the SpriteManager then this is automatically called.
public AnimateSelf ( double currentTime ) : void
currentTime double The number of seconds that have passed since the game has started running.
Результат void

ClearAnimationChains() публичный метод

Clears all references to AnimationChains and sets the Animate property to false.
public ClearAnimationChains ( ) : void
Результат void

ClearCollision() публичный метод

public ClearCollision ( ) : void
Результат void

Clone() публичный метод

Returns a clone of this instance.
Attachments are not cloned. The new clone will not have any parents or children.
public Clone ( ) : Sprite
Результат Sprite

CloneForRig() публичный метод

public CloneForRig ( ) : Sprite
Результат Sprite

ForceUpdateDependenciesDeep() публичный метод

public ForceUpdateDependenciesDeep ( ) : void
Результат void

GetAnimationInformation() публичный метод

public GetAnimationInformation ( ) : string
Результат string

Initialize() публичный метод

public Initialize ( ) : void
Результат void

Initialize() публичный метод

public Initialize ( bool initializeListsBelongingTo ) : void
initializeListsBelongingTo bool
Результат void

IsMouseOver() публичный метод

public IsMouseOver ( Cursor cursor, Layer layer ) : bool
cursor Cursor
layer Layer
Результат bool

Pause() публичный метод

public Pause ( FlatRedBall instructions ) : void
instructions FlatRedBall
Результат void

RemoveAnimationChain() публичный метод

Removes the AnimationChain from the Sprite's internal AnimationChain List.
If the chainToRemove is also the CurrentChain, the animate field is set to false.
public RemoveAnimationChain ( AnimationChain chainToRemove ) : void
chainToRemove AnimationChain The AnimationChain to remove.
Результат void

SetAnimationChain() публичный метод

Sets the argument chainToSet as the animationChain. If the argument chainToSet is not part of the Sprite's internal list of AnimationChains, it is added.
This differs from FlatRedBall MDX - this method on FlatRedBall MDX does not add the argument AnimationChain to the Sprite's internal list.

This does not set any animation-related properties, but it does set the current texture to the current frame's texture. Therefore, it is still necessary to set Animate to true.

public SetAnimationChain ( AnimationChain chainToSet ) : void
chainToSet AnimationChain The AnimationChain to set as the current AnimationChain. This is /// added to the internal AnimationChains property if it is not already there.
Результат void

SetAnimationChain() публичный метод

public SetAnimationChain ( AnimationChain chainToSet, double timeIntoAnimation ) : void
chainToSet AnimationChain
timeIntoAnimation double
Результат void

SetScaleXRatioToY() публичный метод

Sets the ScaleY so that the ScaleX/ScaleY ratio is the same as the source image used for the Sprite's texture.
public SetScaleXRatioToY ( ) : void
Результат void

SetScaleYRatioToX() публичный метод

Sets the ScaleY so that the ScaleX/ScaleY ratio is the same as the source image used for the Sprite's texture.
public SetScaleYRatioToX ( ) : void
Результат void

Sprite() публичный метод

public Sprite ( ) : System
Результат System

TimedActivity() публичный метод

Applies all velocities, rates, accelerations for real and relative values. If the Sprite is part of the SpriteManager (which is common) then this is automatically called.
public TimedActivity ( float secondDifference, double secondDifferenceSquaredDividedByTwo, float secondsPassedLastFrame ) : void
secondDifference float The number of seocnds that have passed since last frame.
secondDifferenceSquaredDividedByTwo double Precalculated (secondDifference * secondDifference)/2.0f for applying acceleration.
secondsPassedLastFrame float The number of seconds that passed last frame for calculating "real" values.
Результат void

ToString() публичный метод

public ToString ( ) : string
Результат string

UpdateToCurrentAnimationFrame() публичный метод

public UpdateToCurrentAnimationFrame ( ) : void
Результат void

Описание свойств

mCursorSelectable защищенное свойство

protected bool mCursorSelectable
Результат bool