Class TweenOptions
Options for tweens or groups.
Inheritance
Inherited Members
Namespace: Sttz.Tweener
Assembly: cs.temp.dll.dll
Syntax
public class TweenOptions
Remarks
Most options related to tweens are located in this separate class. Using ParentOptions, this allows options to be stacked:
- Global (Options)
- Template (optional, Template())
- Group (
group.Options
via Options) - Tween (
tween.Options
via Options)
This stacking allows options to be set globally, per group or per tween. It also allows options set on a higher level to be overwritten.
This class allows options to be read and set. For most use cases, the fluid interface defined by TweenOptionsFluid is intended to be used to set options.
Properties
DefaultPluginRequired
Wether plugins loaded by EnablePlugin(PluginLoader, Nullable<Boolean>, Nullable<Boolean>) are required by default.
Declaration
public bool DefaultPluginRequired { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This gets enabled automatically for tween options instances.
Duration
Duration of the tween in seconds.
Declaration
public float Duration { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Easing
Declaration
public EasingMethod Easing { get; set; }
Property Value
Type | Description |
---|---|
EasingMethod |
LogLevel
Log level of the current scope. Only messages with equal or higher level will be logged to the console.
Declaration
public TweenLogLevel LogLevel { get; set; }
Property Value
Type | Description |
---|---|
TweenLogLevel |
Remarks
Since the log level is also part of the options stack, it's possible to raise the log level for only a single group or tween.
OverwriteSettings
How conflicting tweens are resolved. See TweenOverwrite for all available options.
Declaration
public TweenOverwrite OverwriteSettings { get; set; }
Property Value
Type | Description |
---|---|
TweenOverwrite |
ParentOptions
The parent options instance, used when an option is not set in this instance.
Declaration
public TweenOptions ParentOptions { get; }
Property Value
Type | Description |
---|---|
TweenOptions |
Recycle
Wether groups and tweens are recycled.
Declaration
public TweenRecycle Recycle { get; set; }
Property Value
Type | Description |
---|---|
TweenRecycle |
See Also
StartDelay
Delay before the tween starts (in seconds).
Declaration
public float StartDelay { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
TweenTiming
Timing options of the tween. This sets if the tween is
updated during Update
, FixedUpdate
or LateUpdate
and which game time it's based on.
Declaration
public TweenTiming TweenTiming { get; set; }
Property Value
Type | Description |
---|---|
TweenTiming |
See Also
Methods
EnablePlugin(PluginLoader, Nullable<Boolean>, Nullable<Boolean>)
Enable a plugin for automatic loading.
Declaration
public void EnablePlugin(PluginLoader loader, bool? enabled, bool? required = default(bool? ))
Parameters
Type | Name | Description |
---|---|---|
PluginLoader | loader | Plugin's loader callback |
System.Nullable<System.Boolean> | enabled | Wether to enable or disable the plugin (null = use parent's state) |
System.Nullable<System.Boolean> | required | Wether the tween fails if the plugin cannot be loaded |
Remarks
The order in which plugins are enabled matters. Plugins that are enabled later can override plugins enabled earlier.
Also, the options level they are defined in matters. Plugins that are loaded in child levels can override plugins in parent levels.
Finally, plugins can be re-enabled or re-disabled on lower levels, e.g. a plugin enabled at the global options level can be disabled in a group's options and then re-enabled in a tween's options.
See Also
Log(TweenLogLevel, LazyFormatString)
Declaration
public void Log(TweenLogLevel level, LazyFormatString message)
Parameters
Type | Name | Description |
---|---|---|
TweenLogLevel | level | |
LazyFormatString | message |
Log(TweenLogLevel, String)
Log a message on the current option instance, taking its log level into account.
Declaration
public void Log(TweenLogLevel level, string message)
Parameters
Type | Name | Description |
---|---|---|
TweenLogLevel | level | |
System.String | message |
Reset()
Reset the options instance, so it can be reused.
Declaration
public void Reset()
Events
CompleteEvent
Event triggered when the tween completes (either normally, by being stopped or overwritten, check CompletedBy if you need to know what completed the tween.
Declaration
public event EventHandler<TweenEventArgs> CompleteEvent
Event Type
Type | Description |
---|---|
System.EventHandler<TweenEventArgs> |
Remarks
Events bubble up the options instances, i.e. registering for a group's complete event will trigger for each tween in the group.
Listeners don't need to be removed. Once a tween completes or a group is recycled, all of its listeners will be removed.
ErrorEvent
Declaration
public event EventHandler<TweenEventArgs> ErrorEvent
Event Type
Type | Description |
---|---|
System.EventHandler<TweenEventArgs> |
Remarks
Events bubble up the options instances, i.e. registering for a group's error event will trigger for each tween in the group.
Listeners don't need to be removed. Once a tween completes or a group is recycled, all of its listeners will be removed.
InitializeEvent
Event triggered when the tween initializes (usually in the frame after it was created or when calling Validate(Boolean).)
Declaration
public event EventHandler<TweenEventArgs> InitializeEvent
Event Type
Type | Description |
---|---|
System.EventHandler<TweenEventArgs> |
Remarks
Events bubble up the options instances, i.e. registering for a group's initialize event will trigger for each tween in the group.
Listeners don't need to be removed. Once a tween completes or a group is recycled, all of its listeners will be removed.
StartEvent
Event triggered when the tween starts (after the start delay).
Declaration
public event EventHandler<TweenEventArgs> StartEvent
Event Type
Type | Description |
---|---|
System.EventHandler<TweenEventArgs> |
Remarks
Events bubble up the options instances, i.e. registering for a group's start event will trigger for each tween in the group.
Listeners don't need to be removed. Once a tween completes or a group is recycled, all of its listeners will be removed.
UpdateEvent
Event triggered every time the tween has been updated.
Declaration
public event EventHandler<TweenEventArgs> UpdateEvent
Event Type
Type | Description |
---|---|
System.EventHandler<TweenEventArgs> |
Remarks
Events bubble up the options instances, i.e. registering for a group's update event will trigger for each tween in the group.
Listeners don't need to be removed. Once a tween completes or a group is recycled, all of its listeners will be removed.
Note that the Update event is only triggered if there are listeners registered when the tween starts. If you register a listener after the tween has started, it might not get called.