You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduces `copy` and `clone` methods to Sprite, Circle, Ellipse, and RoundedRectangle classes for easier duplication and property transfer. Updates type definitions to reflect these additions and improves object serialization for Sprite. Also adds support for deserializing sprites in Group.fromObject.
* @description A convenient package to display still or animated images through a tiled image source. For more information on the principals of animated imagery through tiling see [Texture Atlas](https://en.wikipedia.org/wiki/Texture_atlas) on Wikipedia.
3440
3440
*/
3441
3441
exportclassSpriteextendsRectangle{
3442
+
/**
3443
+
* @name Two.Sprite.Properties
3444
+
* @property {String[]} - A list of properties that are on every {@link Two.Sprite}.
3445
+
*/
3446
+
staticProperties: (
3447
+
|'texture'
3448
+
|'columns'
3449
+
|'rows'
3450
+
|'frameRate'
3451
+
|'index'
3452
+
|'firstFrame'
3453
+
|'lastFrame'
3454
+
|'loop'
3455
+
|string
3456
+
)[];
3457
+
/**
3458
+
* @name Two.Sprite.fromObject
3459
+
* @function
3460
+
* @param {Object} obj - Object notation of a {@link Two.Sprite} to create a new instance
3461
+
* @returns {Two.Sprite}
3462
+
* @description Create a new {@link Two.Sprite} from an object notation of a {@link Two.Sprite}.
3463
+
* @nota-bene Works in conjunction with {@link Two.Sprite#toObject}
* @property {String} - Alignment of text in relation to {@link Two.Text#translation}'s coordinates. Possible values include `'left'`, `'center'`, `'right'`. Defaults to `'center'`.
3998
4143
*/
3999
-
alignment: 'left'|'center'|'right';
4144
+
alignment: AlignmentProperties;
4000
4145
/**
4001
4146
* @name Two.Text#baseline
4002
4147
* @property {String} - The vertical aligment of the text in relation to {@link Two.Text#translation}'s coordinates. Possible values include `'top'`, `'middle'`, `'bottom'`, and `'baseline'`. Defaults to `'baseline'`.
4003
4148
*/
4004
-
baseline: 'top'|'middle'|'bottom'|'baseline';
4149
+
baseline: BaselineProperties;
4005
4150
/**
4006
4151
* @name Two.Text#style
4007
4152
* @property {String} - The font's style. Possible values include '`normal`', `'italic'`. Defaults to `'normal'`.
4008
4153
*/
4009
-
style: 'normal'|'italic';
4154
+
style: StyleProperties;
4010
4155
/**
4011
4156
* @name Two.Text#weight
4012
4157
* @property {Number} - A number at intervals of 100 to describe the font's weight. This compatibility varies with the typeface's variant weights. Larger values are bolder. Smaller values are thinner. Defaults to `500`.
* @property {String} - String to delineate whether text should be decorated with for instance an `'underline'`. Defaults to `'none'`.
4018
4163
*/
4019
-
decoration: 'underline'|'strikethrough'|'none';
4164
+
decoration: DecorationProperties;
4020
4165
/**
4021
4166
* @name Two.Text#direction
4022
4167
* @property {String} - String to determine what direction the text should run. Possibly values are `'ltr'` for left-to-right and `'rtl'` for right-to-left. Defaults to `'ltr'`.
4023
4168
*/
4024
-
direction: 'ltr'|'rtl';
4169
+
direction: DirectionProperties;
4025
4170
/**
4026
4171
* @name Two.Text#fill
4027
4172
* @property {(String|Gradient|Texture)} - The value of what the text object should be filled in with.
0 commit comments