Skip to content

AnimationContext

interludesoftware.tick

Interlude.Tick

AnimationContext Class

public class AnimationContext

Inheritance System.Object → AnimationContext

Constructors

AnimationContext(UI, IClock) Constructor

Initializes an animation context bound to ui, using the supplied clock for timing.

public AnimationContext(Interlude.Tick.UI ui, Interlude.Tick.IClock clock=null);

Parameters

ui UI

The UI instance associated with this animation context.

clock IClock

Clock source for animation timing. Defaults to Interlude.Tick.RealClock.

Fields

AnimationContext.LastUsedFrame Field

Frame index on which this context was last retrieved via PushAnimate(string) or an animated-color lookup. The owning Interlude.Tick.AnimationContext.UI evicts whole contexts that have gone unused, so that a UI synthesising ids dynamically (per-row list ids, ephemeral panels) doesn't accumulate a permanent context per unique id.

public int LastUsedFrame;

Field Value

System.Int32

Methods

AnimationContext.Apply() Method

Applies the current animation properties to the UI if enabled.

public Interlude.Tick.AnimationContext Apply();

Returns

AnimationContext
This animation context for method chaining.

AnimationContext.BoolBecomesFalse(string, bool) Method

Gets or creates an animation event that triggers when a boolean value becomes false.

public Interlude.Tick.AnimationContextEvent BoolBecomesFalse(string id, bool value);

Parameters

id System.String

Unique identifier for this event.

value System.Boolean

The boolean value to track.

Returns

AnimationContextEvent
The animation event.

AnimationContext.BoolBecomesTrue(string, bool) Method

Gets or creates an animation event that triggers when a boolean value becomes true.

public Interlude.Tick.AnimationContextEvent BoolBecomesTrue(string id, bool value);

Parameters

id System.String

Unique identifier for this event.

value System.Boolean

The boolean value to track.

Returns

AnimationContextEvent
The animation event.

AnimationContext.BoolWhileFalse(string, bool) Method

Gets or creates an animation event that triggers while a boolean value is false.

public Interlude.Tick.AnimationContextEvent BoolWhileFalse(string id, bool value);

Parameters

id System.String

Unique identifier for this event.

value System.Boolean

The boolean value to track.

Returns

AnimationContextEvent
The animation event.

AnimationContext.BoolWhileTrue(string, bool) Method

Gets or creates an animation event that triggers while a boolean value is true.

public Interlude.Tick.AnimationContextEvent BoolWhileTrue(string id, bool value);

Parameters

id System.String

Unique identifier for this event.

value System.Boolean

The boolean value to track.

Returns

AnimationContextEvent
The animation event.

AnimationContext.CleanUp() Method

Pops the color, scale, and rotate states pushed by Apply(). No-op when disabled.

public void CleanUp();

AnimationContext.Enabled(bool) Method

Enables or disables the animation context.

public Interlude.Tick.AnimationContext Enabled(bool enabled);

Parameters

enabled System.Boolean

Whether the animation context should be enabled.

Returns

AnimationContext
This animation context for method chaining.

AnimationContext.Enter() Method

Gets or creates the enter/hover animation event.

public Interlude.Tick.AnimationContextEnter Enter();

Returns

AnimationContextEnter
The enter animation event.

AnimationContext.GetColor() Method

Gets the primary color property value.

public Color GetColor();

Returns

UnityEngine.Color

AnimationContext.GetColor(string) Method

Gets a color property by ID.

public Color GetColor(string id);

Parameters

id System.String

The property ID.

Returns

UnityEngine.Color
The color value.

AnimationContext.GetFloat() Method

Gets the primary float property value.

public float GetFloat();

Returns

System.Single

AnimationContext.GetFloat(string) Method

Gets a float property by ID.

public float GetFloat(string id);

Parameters

id System.String

The property ID.

Returns

System.Single
The float value.

AnimationContext.GetInt() Method

Gets the primary int property value.

public int GetInt();

Returns

System.Int32

AnimationContext.GetInt(string) Method

Gets an int property by ID.

public int GetInt(string id);

Parameters

id System.String

Returns

System.Int32

AnimationContext.GetRect() Method

Gets the primary rect property value.

public Rect GetRect();

Returns

UnityEngine.Rect

AnimationContext.GetRect(string) Method

Gets a rect property by ID.

public Rect GetRect(string id);

Parameters

id System.String

The property ID.

Returns

UnityEngine.Rect
The rect value.

AnimationContext.GetRotate() Method

Gets the primary rotate property value, in degrees.

public float GetRotate();

Returns

System.Single

AnimationContext.GetScale() Method

Gets the primary scale property value.

public float GetScale();

Returns

System.Single

AnimationContext.Init() Method

Gets or creates the initialization animation event.

public Interlude.Tick.AnimationContextEventBase Init();

Returns

AnimationContextEventBase
The initialization animation event.

AnimationContext.Leave() Method

Gets or creates the leave animation event.

public Interlude.Tick.AnimationContextLeave Leave();

Returns

AnimationContextLeave
The leave animation event.

AnimationContext.TryGetColor(string, Color) Method

Attempts to retrieve a color property by ID.

public bool TryGetColor(string id, out Color color);

Parameters

id System.String

The property ID.

color UnityEngine.Color

The color value if found.

Returns

System.Boolean
True if the property exists, false otherwise.

AnimationContext.TryGetFloat(string, float) Method

Attempts to retrieve a float property by ID.

public bool TryGetFloat(string id, out float value);

Parameters

id System.String

The property ID.

value System.Single

The float value if found.

Returns

System.Boolean
True if the property exists, false otherwise.

AnimationContext.TryGetInt(string, int) Method

Attempts to retrieve an int property by ID.

public bool TryGetInt(string id, out int value);

Parameters

id System.String

The property ID.

value System.Int32

The int value if found.

Returns

System.Boolean
True if the property exists, false otherwise.

AnimationContext.TryGetRect(string, Rect) Method

Attempts to retrieve a rect property by ID.

public bool TryGetRect(string id, out Rect rect);

Parameters

id System.String

The property ID.

rect UnityEngine.Rect

The rect value if found.

Returns

System.Boolean
True if the property exists, false otherwise.