C# Class geek.GameEngine.Visuals.DynamicObject

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

Public Properties

Property 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

Public Methods

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

Protected Methods

Method Description
DynamicObject ( ) : System

Private Methods

Method Description
findAnimator ( AnimatableProperty pty ) : IPropertyAnimator

Find an animator for a property;

updateAnimatedProperties ( ) : void

Update all animated properties for the object.

Method Details

AnimateProperty() public method

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

AnimateProperty() public method

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

AnimateProperty() public method

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

AnimateProperty() public method

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

Blink() public method

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

Draw() public method

public Draw ( SpriteBatch batch ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch
return void

DynamicObject() protected method

protected DynamicObject ( ) : System
return System

IsAnimatingProperty() public method

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

Move() public method

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

MoveAlongCurve() public method

Move an object along a bezier curve.
public MoveAlongCurve ( ) : void
return void

MoveAlongCurve() public method

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

MoveToPoint() public method

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

MoveToPoint() public method

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

MoveTowards() public method

Move the object towards a point.
public MoveTowards ( Vector2 point ) : void
point Vector2 Desired point.
return void

MoveTowards() public method

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

PauseAnimatingAllProperties() public method

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

PauseAnimatingProperty() public method

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

Remove() public method

Remove the object by applying fadeout effects.
public Remove ( ) : void
return void

Remove() public method

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

Stop() public method

Stop the object.
public Stop ( ) : void
return void

StopAnimatingAllProperties() public method

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

StopAnimatingProperty() public method

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

Update() public method

Applies value derivatives to values.
public Update ( ) : void
return void

Property Details

Acceleration public_oe property

Speed derivative.
public float Acceleration
return float

Angle public_oe property

Sprite angle in radians.
public float Angle
return float

AngleShift public_oe property

Angle derivative. Sprite is rotated by this value each second.
public float AngleShift
return float

AngularAcceleration public_oe property

Direction derivative.
public float AngularAcceleration
return float

BlendState public_oe property

Blending mode.
public BlendState,Microsoft.Xna.Framework.Graphics BlendState
return Microsoft.Xna.Framework.Graphics.BlendState

Momentum public_oe property

Sprite momentum. Sprite is moved by this value each second.
public Vector2 Momentum
return Vector2

Pause public_oe property

public PauseTarget Pause
return PauseTarget

Scale public_oe property

Sprite scale. 1 = normal size.
public float Scale
return float

ScaleShift public_oe property

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

ScaleVector public_oe property

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

TintColor public_oe property

Sprite tint color. Default is White (No tint).
public Color TintColor
return Color

TransparencyShift public_oe property

Transparency derivative. The transparency is altered by this value each second.
public float TransparencyShift
return float