Interpolators
Inherits: Object
Properties
| Type | Name | Default |
|---|---|---|
| Interpolators.Interpolator | DEFAULT_INTERPOLATOR | make(...) |
| Interpolators.Interpolator[] | interpolators | |
| Callable | default_apply | <unknown> |
Methods
| Return Type | Name |
|---|---|
| void | register(Callable is_applicable, Callable apply) static |
| Callable | find_for(Variant value) static |
| Variant | interpolate(Variant a, Variant b, float f) static |
Property Descriptions
Interpolators.Interpolator DEFAULT_INTERPOLATOR = make(...)
No description provided.
Interpolators.Interpolator[] interpolators
No description provided.
Callable default_apply = <unknown>
No description provided.
Method Descriptions
void register ( Callable is_applicable, Callable apply ) static
Register an interpolator. New interpolators are pushed to the front of the list, making them have precedence over existing ones. This can be useful in case you want to override the built-in interpolators.
Callable find_for ( Variant value ) static
Find the appropriate interpolator for the given value. If none was found, the default interpolator is returned.
Variant interpolate ( Variant a, Variant b, float f ) static
Interpolate between two values. Note, that it is usually faster to just cache the Callable returned by find_for and call that, instead of calling interpolate repeatedly. The latter will have to lookup the appropriate interpolator on every call.