C# Class FlatRedBall.Sprite

Inheritance: FlatRedBall.PositionedObject
Mostrar archivo Open project: vchelaru/FlatRedBall Class Usage Examples

Protected Properties

Property Type Description
mCursorSelectable bool

Private Properties

Property 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

Public Methods

Method 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

Method 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 method

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.
return void

ClearAnimationChains() public method

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

ClearCollision() public method

public ClearCollision ( ) : void
return void

Clone() public method

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

CloneForRig() public method

public CloneForRig ( ) : Sprite
return Sprite

ForceUpdateDependenciesDeep() public method

public ForceUpdateDependenciesDeep ( ) : void
return void

GetAnimationInformation() public method

public GetAnimationInformation ( ) : string
return string

Initialize() public method

public Initialize ( ) : void
return void

Initialize() public method

public Initialize ( bool initializeListsBelongingTo ) : void
initializeListsBelongingTo bool
return void

IsMouseOver() public method

public IsMouseOver ( Cursor cursor, Layer layer ) : bool
cursor Cursor
layer Layer
return bool

Pause() public method

public Pause ( FlatRedBall instructions ) : void
instructions FlatRedBall
return void

RemoveAnimationChain() public method

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.
return void

SetAnimationChain() public method

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.
return void

SetAnimationChain() public method

public SetAnimationChain ( AnimationChain chainToSet, double timeIntoAnimation ) : void
chainToSet AnimationChain
timeIntoAnimation double
return void

SetScaleXRatioToY() public method

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
return void

SetScaleYRatioToX() public method

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
return void

Sprite() public method

public Sprite ( ) : System
return System

TimedActivity() public method

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.
return void

ToString() public method

public ToString ( ) : string
return string

UpdateToCurrentAnimationFrame() public method

public UpdateToCurrentAnimationFrame ( ) : void
return void

Property Details

mCursorSelectable protected_oe property

protected bool mCursorSelectable
return bool