C# Class geek.GameEngine.Visuals.DynamicObject

A class representing an object that can move, rotate, scale and change transparency.
Inheritance: VisualObjectBase
Afficher le fichier Open project: impworks/xna.geek.engine Class Usage Examples

Méthodes publiques

Свойство Type Description
Acceleration float
Angle float
AngleShift float
AngularAcceleration float
BlendState Microsoft.Xna.Framework.Graphics.BlendState
Momentum Vector2
Pause PauseTarget
Scale float
ScaleShift float
ScaleVector Vector2?
TintColor Color
TransparencyShift float

Méthodes publiques

Méthode Description
AnimateProperty ( float>.Action setter, float initial, float value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void

Animate a custom float property.

AnimateProperty ( AnimatableProperty pty, Vector2 value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void

Animate a standard vector property.

AnimateProperty ( AnimatableProperty pty, float value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void

Animate a standard float property.

AnimateProperty ( Color value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void

Animate a standard color property.

Blink ( int times, float duration ) : void

Make the object blink.

Draw ( SpriteBatch batch ) : void
IsAnimatingProperty ( AnimatableProperty pty ) : bool

Check if a property is currently being animated.

Move ( float speed, float angle ) : void

Make the object move in a given direction at a given speed.

MoveAlongCurve ( ) : void

Move an object along a bezier curve.

MoveAlongCurve ( IEnumerable points ) : void

Move an object along a bezier curve.

MoveToPoint ( Vector2 point, float time, InterpolationMode mode = InterpolationMode.Linear ) : void

Move to a specified point in a given amount of time.

MoveToPoint ( float x, float y, float time, InterpolationMode mode = InterpolationMode.Linear ) : void

Move to a specified point in a given amount of time.

MoveTowards ( Vector2 point ) : void

Move the object towards a point.

MoveTowards ( VisualObjectBase obj ) : void

Move the object towards another object.

PauseAnimatingAllProperties ( bool pause = true ) : void

Suspend all property animation until further notice.

PauseAnimatingProperty ( AnimatableProperty pty, bool pause = true ) : void

Suspend property animation until further notice.

Remove ( ) : void

Remove the object by applying fadeout effects.

Remove ( bool instantly ) : void

Remove the object.

Stop ( ) : void

Stop the object.

StopAnimatingAllProperties ( bool finish = true ) : void

Stop animating all properties at once.

StopAnimatingProperty ( AnimatableProperty pty, bool finish = true ) : void

Stop animating a property.

Update ( ) : void

Applies value derivatives to values.

Méthodes protégées

Méthode Description
DynamicObject ( ) : System

Private Methods

Méthode Description
findAnimator ( AnimatableProperty pty ) : IPropertyAnimator

Find an animator for a property;

updateAnimatedProperties ( ) : void

Update all animated properties for the object.

Method Details

AnimateProperty() public méthode

Animate a custom float property.
public AnimateProperty ( float>.Action setter, float initial, float value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void
setter float>.Action The function that sets the object's property.
initial float Initial value.
value float Desired value.
time float Effect duration.
interpolationMode InterpolationMode Interpolation mode.
animateBack bool Flag that animates the property back when the effect has finished.
Résultat void

AnimateProperty() public méthode

Animate a standard vector property.
public AnimateProperty ( AnimatableProperty pty, Vector2 value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void
pty AnimatableProperty Property to animate. Can be Position and ScaleVector.
value Vector2 Desired value.
time float Effect duration.
interpolationMode InterpolationMode Interpolation mode.
animateBack bool Flag that animates the property back when the effect has finished.
Résultat void

AnimateProperty() public méthode

Animate a standard float property.
public AnimateProperty ( AnimatableProperty pty, float value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void
pty AnimatableProperty Property type to animate. Can be Angle, Scale and Transparency.
value float Desired value.
time float Effect duration.
interpolationMode InterpolationMode Interpolation mode.
animateBack bool Flag that animates the property back when the effect has finished.
Résultat void

AnimateProperty() public méthode

Animate a standard color property.
public AnimateProperty ( Color value, float time, InterpolationMode interpolationMode = InterpolationMode.Linear, bool animateBack = false ) : void
value Color Desired value.
time float Effect duration.
interpolationMode InterpolationMode Interpolation mode.
animateBack bool Flag that animates the property back when the effect has finished.
Résultat void

Blink() public méthode

Make the object blink.
public Blink ( int times, float duration ) : void
times int Number of times to blink.
duration float Length of the blinking effect duration.
Résultat void

Draw() public méthode

public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
Résultat void

DynamicObject() protected méthode

protected DynamicObject ( ) : System
Résultat System

IsAnimatingProperty() public méthode

Check if a property is currently being animated.
public IsAnimatingProperty ( AnimatableProperty pty ) : bool
pty AnimatableProperty Property type.
Résultat bool

Move() public méthode

Make the object move in a given direction at a given speed.
public Move ( float speed, float angle ) : void
speed float Speed.
angle float Direction.
Résultat void

MoveAlongCurve() public méthode

Move an object along a bezier curve.
public MoveAlongCurve ( ) : void
Résultat void

MoveAlongCurve() public méthode

Move an object along a bezier curve.
public MoveAlongCurve ( IEnumerable points ) : void
points IEnumerable Point array.
Résultat void

MoveToPoint() public méthode

Move to a specified point in a given amount of time.
public MoveToPoint ( Vector2 point, float time, InterpolationMode mode = InterpolationMode.Linear ) : void
point Vector2 Destination point.
time float Movement duration.
mode InterpolationMode Interpolation mode.
Résultat void

MoveToPoint() public méthode

Move to a specified point in a given amount of time.
public MoveToPoint ( float x, float y, float time, InterpolationMode mode = InterpolationMode.Linear ) : void
x float Destination point's X coordinate.
y float Destination point's Y coordinate.
time float Movement duration.
mode InterpolationMode Interpolation mode.
Résultat void

MoveTowards() public méthode

Move the object towards a point.
public MoveTowards ( Vector2 point ) : void
point Vector2 Desired point.
Résultat void

MoveTowards() public méthode

Move the object towards another object.
public MoveTowards ( VisualObjectBase obj ) : void
obj VisualObjectBase Object to move towards.
Résultat void

PauseAnimatingAllProperties() public méthode

Suspend all property animation until further notice.
public PauseAnimatingAllProperties ( bool pause = true ) : void
pause bool Pause flag.
Résultat void

PauseAnimatingProperty() public méthode

Suspend property animation until further notice.
public PauseAnimatingProperty ( AnimatableProperty pty, bool pause = true ) : void
pty AnimatableProperty
pause bool Pause flag.
Résultat void

Remove() public méthode

Remove the object by applying fadeout effects.
public Remove ( ) : void
Résultat void

Remove() public méthode

Remove the object.
public Remove ( bool instantly ) : void
instantly bool Apply fadeout effects or not?
Résultat void

Stop() public méthode

Stop the object.
public Stop ( ) : void
Résultat void

StopAnimatingAllProperties() public méthode

Stop animating all properties at once.
public StopAnimatingAllProperties ( bool finish = true ) : void
finish bool Set the property to desired value or leave it as it is?
Résultat void

StopAnimatingProperty() public méthode

Stop animating a property.
public StopAnimatingProperty ( AnimatableProperty pty, bool finish = true ) : void
pty AnimatableProperty Property.
finish bool Set the property to desired value or leave as it is?
Résultat void

Update() public méthode

Applies value derivatives to values.
public Update ( ) : void
Résultat void

Property Details

Acceleration public_oe property

Speed derivative.
public float Acceleration
Résultat float

Angle public_oe property

Sprite angle in radians.
public float Angle
Résultat float

AngleShift public_oe property

Angle derivative. Sprite is rotated by this value each second.
public float AngleShift
Résultat float

AngularAcceleration public_oe property

Direction derivative.
public float AngularAcceleration
Résultat float

BlendState public_oe property

Blending mode.
public BlendState,Microsoft.Xna.Framework.Graphics BlendState
Résultat Microsoft.Xna.Framework.Graphics.BlendState

Momentum public_oe property

Sprite momentum. Sprite is moved by this value each second.
public Vector2 Momentum
Résultat Vector2

Pause public_oe property

public PauseTarget Pause
Résultat PauseTarget

Scale public_oe property

Sprite scale. 1 = normal size.
public float Scale
Résultat float

ScaleShift public_oe property

Scale derivative: Scale is incremented or decremented by this value each second.
public float ScaleShift
Résultat float

ScaleVector public_oe property

Sprite scale that can be different for X and Y axis.
public Vector2? ScaleVector
Résultat Vector2?

TintColor public_oe property

Sprite tint color. Default is White (No tint).
public Color TintColor
Résultat Color

TransparencyShift public_oe property

Transparency derivative. The transparency is altered by this value each second.
public float TransparencyShift
Résultat float