/** * @author Richard Davey * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ declare var MATH_CONST: any; declare var TransformMatrix: any; declare var WrapAngle: any; declare var WrapAngleDegrees: any; declare var _FLAG: number; /** * Provides methods used for getting and setting the position, scale and rotation of a Game Object. * * @name Phaser.GameObjects.Components.Transform * @since 3.0.0 */ declare var Transform: { /** * Private internal value. Holds the horizontal scale value. * * @name Phaser.GameObjects.Components.Transform#_scaleX * @type {number} * @private * @default 1 * @since 3.0.0 */ _scaleX: number; /** * Private internal value. Holds the vertical scale value. * * @name Phaser.GameObjects.Components.Transform#_scaleY * @type {number} * @private * @default 1 * @since 3.0.0 */ _scaleY: number; /** * Private internal value. Holds the rotation value in radians. * * @name Phaser.GameObjects.Components.Transform#_rotation * @type {number} * @private * @default 0 * @since 3.0.0 */ _rotation: number; /** * The x position of this Game Object. * * @name Phaser.GameObjects.Components.Transform#x * @type {number} * @default 0 * @since 3.0.0 */ x: number; /** * The y position of this Game Object. * * @name Phaser.GameObjects.Components.Transform#y * @type {number} * @default 0 * @since 3.0.0 */ y: number; /** * The z position of this Game Object. * Note: Do not use this value to set the z-index, instead see the `depth` property. * * @name Phaser.GameObjects.Components.Transform#z * @type {number} * @default 0 * @since 3.0.0 */ z: number; /** * The w position of this Game Object. * * @name Phaser.GameObjects.Components.Transform#w * @type {number} * @default 0 * @since 3.0.0 */ w: number; /** * The horizontal scale of this Game Object. * * @name Phaser.GameObjects.Components.Transform#scaleX * @type {number} * @default 1 * @since 3.0.0 */ scaleX: { get: () => any; set: (value: any) => void; }; /** * The vertical scale of this Game Object. * * @name Phaser.GameObjects.Components.Transform#scaleY * @type {number} * @default 1 * @since 3.0.0 */ scaleY: { get: () => any; set: (value: any) => void; }; /** * The angle of this Game Object as expressed in degrees. * * Where 0 is to the right, 90 is down, 180 is left. * * If you prefer to work in radians, see the `rotation` property instead. * * @name Phaser.GameObjects.Components.Transform#angle * @type {integer} * @default 0 * @since 3.0.0 */ angle: { get: () => any; set: (value: any) => void; }; /** * The angle of this Game Object in radians. * * If you prefer to work in degrees, see the `angle` property instead. * * @name Phaser.GameObjects.Components.Transform#rotation * @type {number} * @default 1 * @since 3.0.0 */ rotation: { get: () => any; set: (value: any) => void; }; /** * Sets the position of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setPosition * @since 3.0.0 * * @param {number} [x=0] - The x position of this Game Object. * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. * @param {number} [z=0] - The z position of this Game Object. * @param {number} [w=0] - The w position of this Game Object. * * @return {this} This Game Object instance. */ setPosition: (x: any, y: any, z: any, w: any) => any; /** * Sets the position of this Game Object to be a random position within the confines of * the given area. * * If no area is specified a random position between 0 x 0 and the game width x height is used instead. * * The position does not factor in the size of this Game Object, meaning that only the origin is * guaranteed to be within the area. * * @method Phaser.GameObjects.Components.Transform#setRandomPosition * @since 3.8.0 * * @param {number} [x=0] - The x position of the top-left of the random area. * @param {number} [y=0] - The y position of the top-left of the random area. * @param {number} [width] - The width of the random area. * @param {number} [height] - The height of the random area. * * @return {this} This Game Object instance. */ setRandomPosition: (x: any, y: any, width: any, height: any) => any; /** * Sets the rotation of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setRotation * @since 3.0.0 * * @param {number} [radians=0] - The rotation of this Game Object, in radians. * * @return {this} This Game Object instance. */ setRotation: (radians: any) => any; /** * Sets the angle of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setAngle * @since 3.0.0 * * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. * * @return {this} This Game Object instance. */ setAngle: (degrees: any) => any; /** * Sets the scale of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setScale * @since 3.0.0 * * @param {number} x - The horizontal scale of this Game Object. * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. * * @return {this} This Game Object instance. */ setScale: (x: any, y: any) => any; /** * Sets the x position of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setX * @since 3.0.0 * * @param {number} [value=0] - The x position of this Game Object. * * @return {this} This Game Object instance. */ setX: (value: any) => any; /** * Sets the y position of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setY * @since 3.0.0 * * @param {number} [value=0] - The y position of this Game Object. * * @return {this} This Game Object instance. */ setY: (value: any) => any; /** * Sets the z position of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setZ * @since 3.0.0 * * @param {number} [value=0] - The z position of this Game Object. * * @return {this} This Game Object instance. */ setZ: (value: any) => any; /** * Sets the w position of this Game Object. * * @method Phaser.GameObjects.Components.Transform#setW * @since 3.0.0 * * @param {number} [value=0] - The w position of this Game Object. * * @return {this} This Game Object instance. */ setW: (value: any) => any; /** * Gets the local transform matrix for this Game Object. * * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix * @since 3.4.0 * * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. * * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. */ getLocalTransformMatrix: (tempMatrix: any) => any; /** * Gets the world transform matrix for this Game Object, factoring in any parent Containers. * * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix * @since 3.4.0 * * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. * * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. */ getWorldTransformMatrix: (tempMatrix: any) => any; };