twn property

Returns a GTweenableRect object that wraps this GRect instance, allowing it to be used with GTween animations. Use this to animate the properties of the rectangle, such as its position, size, and anchor point. For example:

final myRect = GRect(0, 0, 100, 100);
myRect.twn.tween(
  duration: 1.0,
  x: 200,
  y: 200,
  width: 50,
  height: 50,
  pivotX: 0.5,
  pivotY: 0.5,
  ease: GEase.elasticOut,
  onComplete: () => print('Animation completed!'),
);

This will animate the rectangle from its initial position and size to a new position of (200, 200), a size of (50, 50), and a pivot point located at its center. The animation will use an elastic-out easing function and will print a message to the console when it completes.

Implementation

GTweenableRect get twn {
  return GTweenableRect(this);
}