-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The SpriteView implementation provides convenient setters for the PositionWorld etc. properties as:
set PositionWorld(value: (number[] | {x?: number; y?: number;})) { /* ...some logic... */ }I would like the same convenience setters for Scene.scale and Scene.offset as follows.
set scale(value: (number | number[] | {x?: number; y?: number;})) {
if (typeof value === 'number') {
this.scale.x = this.scale.y = value;
} else if (Array.isArray(value)) {
// setter logic similar to SpriteView
} else if (typeof value === 'object') {
// setter logic similar to SpriteView
} else {
throw new TypeError('Argument must be a number, number array, or object.');
}
}It seems like this isn't happening now because Scene.scale and Scene.offset are instances of DrawTriggerPoint, but it shouldn't be hard to move these to an internal private variable and convert the public interfaces to getters and setters. What might be more difficult to overcome is the philosophical desire to always be setting the x and y components of a DrawTriggerPoint directly.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request