-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Currently, sprites are always aligned with the coordinate axes. Instead, sprites should have one or more rotation attributes. This would enable downstream features such as line segments and slanted labels.
Design question: When should the rotation(s) be applied relative to other operations, specifically scaling? To support line segments, the rotation must be applied after scaling. But other use cases (such as rotating a polygon) may be desirable before scaling. The name of each rotation attribute should imply when it is applied relative to these other operations.
API Proposal:
/**
* Rotation in radians to apply to the sprite before and after scaling.
*/
{
attributeName: 'Rotation',
isInterpolable: true,
components: ['BeforeScaling', 'AfterScaling'],
},Example:
const sprite = scene.createSprite();
sprite.enter(s => {
s.RotationAfterScaling = Math.PI / 2; // Rotate 90 degrees counter-clockwise.
});Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request