Show / Hide Table of Contents

Interface IDistortionCollection

Namespace: Yak2D
Assembly: Yak2D.Api.dll
Syntax
public interface IDistortionCollection

Methods

Add(LifeCycle, CoordinateSpace, Single, ITexture, Vector2, Vector2, Vector2, Vector2, Single, Single, Single, Single)

Create a new distortion object (textured quad) and add to the collection

Declaration
void Add(LifeCycle cycle, CoordinateSpace coordinateSpace, float durationInSeconds, ITexture texture, Vector2 initPosition, Vector2 finalPosition, Vector2 initSize, Vector2 finalSize, float initIntensity, float finalIntensity, float initialRotation, float finalRotation)
Parameters
Type Name Description
LifeCycle cycle

The distortion object can be looped

CoordinateSpace coordinateSpace

The coordinate space (world or screen) that the distortion object should be drawn in

System.Single durationInSeconds

The length of a single cycle

ITexture texture

The texture reference

Vector2 initPosition

Location the textured quad is positioned at the start of a cycle

Vector2 finalPosition

The textured quad's final position, position is interpolated from init to final over the cycle

Vector2 initSize

Quad (square) dimensions at the start of a cycle

Vector2 finalSize

Quad (square) dimensions at the end of a cycle, the size is interpolated over the cycle

System.Single initIntensity

Drawn intensity of texture at the start of a cycle

System.Single finalIntensity

Drawn intensity of texture at the end of a cycle, the intensity is interpolated over the cycle

System.Single initialRotation

Rotation in degress at the start of a cycle

System.Single finalRotation

Rotation in degress at the end of a cycle, angle is interpolated during a cycle

ClearCollection()

Removes all current distortion drawing objects from the collection

Declaration
void ClearCollection()

Draw(IDrawing, IDistortionStage)

The user should call this to draw the distortion collection each frame

Declaration
void Draw(IDrawing drawing, IDistortionStage stage)
Parameters
Type Name Description
IDrawing drawing

The framework drawing service

IDistortionStage stage

The distortion drawing stage the collection is to be drawn too

Update(Single)

The user should call this during any update that it is wished the distortion objects should be advanced

Declaration
void Update(float timeStep)
Parameters
Type Name Description
System.Single timeStep
In This Article
Back to top yak2D - Alex Paterson