SizeEffect.by constructor

SizeEffect.by(
  1. Vector2 offset,
  2. EffectController controller, {
  3. SizeProvider? target,
  4. void onComplete()?,
})

This constructor will create an effect that sets the size in relation to the PositionComponent's current size, for example if the offset is set to Vector2(10, -10) and the size of the affected component is Vector2(100, 100) at the start of the affected the effect will peak when the size is Vector2(110, 90), if there is nothing else affecting the size at the same time.

Implementation

SizeEffect.by(
  Vector2 offset,
  super.controller, {
  SizeProvider? target,
  super.onComplete,
}) : _offset = offset.clone() {
  this.target = target;
}