C# Class FlatRedBall.Sprite

Inheritance: FlatRedBall.PositionedObject
Afficher le fichier Open project: vchelaru/FlatRedBall Class Usage Examples

Protected Properties

Свойство Type Description
mCursorSelectable bool

Private Properties

Свойство Type Description
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

Méthodes publiques

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

Private Methods

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

Method Details

AnimateSelf() public méthode

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

ClearAnimationChains() public méthode

Clears all references to AnimationChains and sets the Animate property to false.
public ClearAnimationChains ( ) : void
Résultat void

ClearCollision() public méthode

public ClearCollision ( ) : void
Résultat void

Clone() public méthode

Returns a clone of this instance.
Attachments are not cloned. The new clone will not have any parents or children.
public Clone ( ) : Sprite
Résultat Sprite

CloneForRig() public méthode

public CloneForRig ( ) : Sprite
Résultat Sprite

ForceUpdateDependenciesDeep() public méthode

public ForceUpdateDependenciesDeep ( ) : void
Résultat void

GetAnimationInformation() public méthode

public GetAnimationInformation ( ) : string
Résultat string

Initialize() public méthode

public Initialize ( ) : void
Résultat void

Initialize() public méthode

public Initialize ( bool initializeListsBelongingTo ) : void
initializeListsBelongingTo bool
Résultat void

IsMouseOver() public méthode

public IsMouseOver ( Cursor cursor, Layer layer ) : bool
cursor Cursor
layer Layer
Résultat bool

Pause() public méthode

public Pause ( FlatRedBall instructions ) : void
instructions FlatRedBall
Résultat void

RemoveAnimationChain() public méthode

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

SetAnimationChain() public méthode

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

SetAnimationChain() public méthode

public SetAnimationChain ( AnimationChain chainToSet, double timeIntoAnimation ) : void
chainToSet AnimationChain
timeIntoAnimation double
Résultat void

SetScaleXRatioToY() public méthode

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

SetScaleYRatioToX() public méthode

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

Sprite() public méthode

public Sprite ( ) : System
Résultat System

TimedActivity() public méthode

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

ToString() public méthode

public ToString ( ) : string
Résultat string

UpdateToCurrentAnimationFrame() public méthode

public UpdateToCurrentAnimationFrame ( ) : void
Résultat void

Property Details

mCursorSelectable protected_oe property

protected bool mCursorSelectable
Résultat bool