Otter  0.9.8.91
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Lerper Class Reference

Component that will slowly interpolate a value toward a target using a speed and acceleration. This component can move the value and does not know about time at all. More...

Inherits Otter.Component.

Public Member Functions

 Lerper (float value, float accel, float maxSpeed)
 Create a new Lerper. More...
 
void SetTarget (float value)
 Set the target. More...
 
void SetValue (float value)
 Force the current value. More...
 
override void Update ()
 Update the Lerper. More...
 
- Public Member Functions inherited from Otter.Component
GetEntity< T > ()
 Get the Entity as a specific Type. More...
 
virtual void Added ()
 Called when the Component is added to the Entity. More...
 
virtual void Removed ()
 Called when the Component is removed from the Entity. More...
 
void RemoveSelf ()
 Removes the Component from its parent Entity. More...
 
virtual void UpdateFirst ()
 Called during the UpdateFirst on the parent Entity. More...
 
virtual void Render ()
 Called during the Render on the parent Entity. More...
 
virtual void UpdateLast ()
 Called during the UpdateLast on the parent Entity. More...
 
GetComponent< T > ()
 Gets the first Component of type T from this Component's Entity. More...
 
List< T > GetComponents< T > ()
 Gets a list of Components of type T from this Component's Entity. More...
 

Static Public Member Functions

static implicit operator float (Lerper lerper)
 
static implicit operator int (Lerper lerper)
 

Public Attributes

float Acceleration
 The acceleration for moving toward the target. More...
 
float MaxSpeed
 The maximum speed for moving toward the target. More...
 
- Public Attributes inherited from Otter.Component
Entity Entity
 The parent Entity of the Component. More...
 
bool RenderAfterEntity = true
 Determines if the Component should render after the Entity has rendered. More...
 
bool Visible = true
 Determines if the Component will render. More...
 
float Timer = 0
 How long the Component has been alive (added to an Entity and updated.) More...
 

Properties

bool Completed [get, set]
 If the Lerper has completed its movement. More...
 
float Target [get, set]
 The current target to move toward. More...
 
float Value [get, set]
 The current value. More...
 
- Properties inherited from Otter.Component
int InstanceId [get, set]
 The Component's id for the Entity its attached to. More...
 
Scene Scene [get]
 The Scene that the parent Entity is in. More...
 
Collider Collider [get]
 The first Collider of the parent Entity. More...
 
Graphic Graphic [get]
 The first Graphic of the parent Entity. More...
 
List< GraphicGraphics [get]
 The list of Graphics from the parent Entity. More...
 
List< ColliderColliders [get]
 The list of Colliders from the parent Entity. More...
 

Detailed Description

Component that will slowly interpolate a value toward a target using a speed and acceleration. This component can move the value and does not know about time at all.

Constructor & Destructor Documentation

Otter.Lerper.Lerper ( float  value,
float  accel,
float  maxSpeed 
)

Create a new Lerper.

Parameters
valueThe initial value.
accelThe acceleration for moving toward the target.
maxSpeedThe max speed for moving toward the target.

Member Function Documentation

void Otter.Lerper.SetTarget ( float  value)

Set the target.

Parameters
value
void Otter.Lerper.SetValue ( float  value)

Force the current value.

Parameters
value
override void Otter.Lerper.Update ( )
virtual

Update the Lerper.

Reimplemented from Otter.Component.

Member Data Documentation

float Otter.Lerper.Acceleration

The acceleration for moving toward the target.

float Otter.Lerper.MaxSpeed

The maximum speed for moving toward the target.

Property Documentation

bool Otter.Lerper.Completed
getset

If the Lerper has completed its movement.

float Otter.Lerper.Target
getset

The current target to move toward.

float Otter.Lerper.Value
getset

The current value.


The documentation for this class was generated from the following file: