Limiter for a Dynamics class. During the animation cycle a Sprite calls the limit method to modify the current dynamics if necessary. The function of a limiter can be replicated by using an object which extends the BaseSpriteAdjuster class; however, there are some subtle differences in use case.
- Limiters normally exist for the lifetime of an object.
- Limiters typically only alter the dynamics or position of a sprite.
- Adjusters are often transient and can call a function to provide notice of its completion.
- Adjusters are typically used to make more comprehensive modifications to a sprite.
- Source:
Methods
limit(target, dynamics)
Function to limit the Dynamics instance. The limiter might be adjusting the dynamics to apply constraints such as boundarys within which to bounce, or even more complex dynamics adjustments beyond just simple velocity and acceleration. Note that the limit method is called after the standard application of velocity and acceleration.
Parameters:
| Name | Type | Description |
|---|---|---|
target |
module:hcje/sprites.Sprite | The target object to limit. |
dynamics |
module:hcje/sprites.Dynamics | The associated dynamics. |
- Source: