From 524eaf47fb1741dd6f9361c29f5c15b10c8d39e2 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Tue, 24 Feb 2026 00:59:28 -0500 Subject: [PATCH 1/3] Update types of event constants to match their runtime values Regex used: `@type \{string\}((?:.|\n)+)module\.exports = '(\w*)';$` => `@type {'$2'}$1module.exports = '$2';` --- src/animations/events/ADD_ANIMATION_EVENT.js | 2 +- .../events/ANIMATION_COMPLETE_EVENT.js | 2 +- .../events/ANIMATION_REPEAT_EVENT.js | 2 +- .../events/ANIMATION_RESTART_EVENT.js | 2 +- .../events/ANIMATION_START_EVENT.js | 2 +- src/animations/events/ANIMATION_STOP_EVENT.js | 2 +- .../events/ANIMATION_UPDATE_EVENT.js | 2 +- src/animations/events/PAUSE_ALL_EVENT.js | 2 +- .../events/REMOVE_ANIMATION_EVENT.js | 2 +- src/animations/events/RESUME_ALL_EVENT.js | 2 +- src/cache/events/ADD_EVENT.js | 2 +- src/cache/events/REMOVE_EVENT.js | 2 +- src/cameras/2d/events/DESTROY_EVENT.js | 2 +- .../2d/events/FADE_IN_COMPLETE_EVENT.js | 2 +- src/cameras/2d/events/FADE_IN_START_EVENT.js | 2 +- .../2d/events/FADE_OUT_COMPLETE_EVENT.js | 2 +- src/cameras/2d/events/FADE_OUT_START_EVENT.js | 2 +- src/cameras/2d/events/FLASH_COMPLETE_EVENT.js | 2 +- src/cameras/2d/events/FLASH_START_EVENT.js | 2 +- src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js | 2 +- src/cameras/2d/events/PAN_COMPLETE_EVENT.js | 2 +- src/cameras/2d/events/PAN_START_EVENT.js | 2 +- src/cameras/2d/events/POST_RENDER_EVENT.js | 2 +- src/cameras/2d/events/PRE_RENDER_EVENT.js | 2 +- .../2d/events/ROTATE_COMPLETE_EVENT.js | 2 +- src/cameras/2d/events/ROTATE_START_EVENT.js | 2 +- src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js | 2 +- src/cameras/2d/events/SHAKE_START_EVENT.js | 2 +- src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js | 2 +- src/cameras/2d/events/ZOOM_START_EVENT.js | 2 +- src/core/events/BLUR_EVENT.js | 2 +- src/core/events/BOOT_EVENT.js | 2 +- src/core/events/CONTEXT_LOST_EVENT.js | 2 +- src/core/events/DESTROY_EVENT.js | 2 +- src/core/events/FOCUS_EVENT.js | 2 +- src/core/events/HIDDEN_EVENT.js | 2 +- src/core/events/PAUSE_EVENT.js | 2 +- src/core/events/POST_RENDER_EVENT.js | 2 +- src/core/events/POST_STEP_EVENT.js | 2 +- src/core/events/PRE_RENDER_EVENT.js | 2 +- src/core/events/PRE_STEP_EVENT.js | 2 +- src/core/events/READY_EVENT.js | 2 +- src/core/events/RESUME_EVENT.js | 2 +- src/core/events/STEP_EVENT.js | 2 +- src/core/events/SYSTEM_READY_EVENT.js | 2 +- src/core/events/VISIBLE_EVENT.js | 2 +- src/data/events/CHANGE_DATA_EVENT.js | 2 +- src/data/events/DESTROY_EVENT.js | 2 +- src/data/events/REMOVE_DATA_EVENT.js | 2 +- src/data/events/SET_DATA_EVENT.js | 2 +- .../events/ADDED_TO_SCENE_EVENT.js | 2 +- src/gameobjects/events/DESTROY_EVENT.js | 2 +- .../events/REMOVED_FROM_SCENE_EVENT.js | 2 +- .../events/VIDEO_COMPLETE_EVENT.js | 2 +- src/gameobjects/events/VIDEO_CREATED_EVENT.js | 2 +- src/gameobjects/events/VIDEO_ERROR_EVENT.js | 2 +- src/gameobjects/events/VIDEO_LOCKED_EVENT.js | 2 +- src/gameobjects/events/VIDEO_LOOP_EVENT.js | 2 +- .../events/VIDEO_METADATA_EVENT.js | 2 +- src/gameobjects/events/VIDEO_PLAYING_EVENT.js | 2 +- src/gameobjects/events/VIDEO_PLAY_EVENT.js | 2 +- src/gameobjects/events/VIDEO_SEEKED_EVENT.js | 2 +- src/gameobjects/events/VIDEO_SEEKING_EVENT.js | 2 +- src/gameobjects/events/VIDEO_STALLED_EVENT.js | 2 +- src/gameobjects/events/VIDEO_STOP_EVENT.js | 2 +- src/gameobjects/events/VIDEO_TEXTURE_EVENT.js | 2 +- .../events/VIDEO_UNLOCKED_EVENT.js | 2 +- .../events/VIDEO_UNSUPPORTED_EVENT.js | 2 +- .../particles/events/COMPLETE_EVENT.js | 2 +- .../particles/events/DEATH_ZONE_EVENT.js | 2 +- .../particles/events/EXPLODE_EVENT.js | 2 +- .../particles/events/START_EVENT.js | 2 +- .../particles/events/STOP_EVENT.js | 2 +- src/input/events/BOOT_EVENT.js | 2 +- src/input/events/DESTROY_EVENT.js | 2 +- src/input/events/DRAG_END_EVENT.js | 2 +- src/input/events/DRAG_ENTER_EVENT.js | 2 +- src/input/events/DRAG_EVENT.js | 2 +- src/input/events/DRAG_LEAVE_EVENT.js | 2 +- src/input/events/DRAG_OVER_EVENT.js | 2 +- src/input/events/DRAG_START_EVENT.js | 2 +- src/input/events/DROP_EVENT.js | 2 +- src/input/events/GAMEOBJECT_DOWN_EVENT.js | 2 +- src/input/events/GAMEOBJECT_DRAG_END_EVENT.js | 2 +- .../events/GAMEOBJECT_DRAG_ENTER_EVENT.js | 2 +- src/input/events/GAMEOBJECT_DRAG_EVENT.js | 2 +- .../events/GAMEOBJECT_DRAG_LEAVE_EVENT.js | 2 +- .../events/GAMEOBJECT_DRAG_OVER_EVENT.js | 2 +- .../events/GAMEOBJECT_DRAG_START_EVENT.js | 2 +- src/input/events/GAMEOBJECT_DROP_EVENT.js | 2 +- src/input/events/GAMEOBJECT_MOVE_EVENT.js | 2 +- src/input/events/GAMEOBJECT_OUT_EVENT.js | 2 +- src/input/events/GAMEOBJECT_OVER_EVENT.js | 2 +- .../events/GAMEOBJECT_POINTER_DOWN_EVENT.js | 2 +- .../events/GAMEOBJECT_POINTER_MOVE_EVENT.js | 2 +- .../events/GAMEOBJECT_POINTER_OUT_EVENT.js | 2 +- .../events/GAMEOBJECT_POINTER_OVER_EVENT.js | 2 +- .../events/GAMEOBJECT_POINTER_UP_EVENT.js | 2 +- .../events/GAMEOBJECT_POINTER_WHEEL_EVENT.js | 2 +- src/input/events/GAMEOBJECT_UP_EVENT.js | 2 +- src/input/events/GAMEOBJECT_WHEEL_EVENT.js | 2 +- src/input/events/GAME_OUT_EVENT.js | 2 +- src/input/events/GAME_OVER_EVENT.js | 2 +- src/input/events/MANAGER_BOOT_EVENT.js | 2 +- src/input/events/MANAGER_PROCESS_EVENT.js | 2 +- src/input/events/MANAGER_UPDATE_EVENT.js | 2 +- src/input/events/POINTERLOCK_CHANGE_EVENT.js | 2 +- src/input/events/POINTER_DOWN_EVENT.js | 2 +- .../events/POINTER_DOWN_OUTSIDE_EVENT.js | 2 +- src/input/events/POINTER_MOVE_EVENT.js | 2 +- src/input/events/POINTER_OUT_EVENT.js | 2 +- src/input/events/POINTER_OVER_EVENT.js | 2 +- src/input/events/POINTER_UP_EVENT.js | 2 +- src/input/events/POINTER_UP_OUTSIDE_EVENT.js | 2 +- src/input/events/POINTER_WHEEL_EVENT.js | 2 +- src/input/events/PRE_UPDATE_EVENT.js | 2 +- src/input/events/SHUTDOWN_EVENT.js | 2 +- src/input/events/START_EVENT.js | 2 +- src/input/events/UPDATE_EVENT.js | 2 +- src/input/gamepad/events/BUTTON_DOWN_EVENT.js | 2 +- src/input/gamepad/events/BUTTON_UP_EVENT.js | 2 +- src/input/gamepad/events/CONNECTED_EVENT.js | 2 +- .../gamepad/events/DISCONNECTED_EVENT.js | 2 +- .../events/GAMEPAD_BUTTON_DOWN_EVENT.js | 2 +- .../gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js | 2 +- .../keyboard/events/ANY_KEY_DOWN_EVENT.js | 2 +- src/input/keyboard/events/ANY_KEY_UP_EVENT.js | 2 +- .../keyboard/events/COMBO_MATCH_EVENT.js | 2 +- src/input/keyboard/events/DOWN_EVENT.js | 2 +- src/input/keyboard/events/UP_EVENT.js | 2 +- src/loader/events/ADD_EVENT.js | 2 +- src/loader/events/COMPLETE_EVENT.js | 2 +- src/loader/events/FILE_COMPLETE_EVENT.js | 2 +- src/loader/events/FILE_LOAD_ERROR_EVENT.js | 2 +- src/loader/events/FILE_LOAD_EVENT.js | 2 +- src/loader/events/FILE_PROGRESS_EVENT.js | 2 +- src/loader/events/POST_PROCESS_EVENT.js | 2 +- src/loader/events/PROGRESS_EVENT.js | 2 +- src/loader/events/START_EVENT.js | 2 +- src/physics/arcade/events/COLLIDE_EVENT.js | 2 +- src/physics/arcade/events/OVERLAP_EVENT.js | 2 +- src/physics/arcade/events/PAUSE_EVENT.js | 2 +- src/physics/arcade/events/RESUME_EVENT.js | 2 +- .../arcade/events/TILE_COLLIDE_EVENT.js | 2 +- .../arcade/events/TILE_OVERLAP_EVENT.js | 2 +- .../arcade/events/WORLD_BOUNDS_EVENT.js | 2 +- src/physics/arcade/events/WORLD_STEP_EVENT.js | 2 +- .../matter-js/events/AFTER_ADD_EVENT.js | 2 +- .../matter-js/events/AFTER_REMOVE_EVENT.js | 2 +- .../matter-js/events/AFTER_UPDATE_EVENT.js | 2 +- .../matter-js/events/BEFORE_ADD_EVENT.js | 2 +- .../matter-js/events/BEFORE_REMOVE_EVENT.js | 2 +- .../matter-js/events/BEFORE_UPDATE_EVENT.js | 2 +- .../events/COLLISION_ACTIVE_EVENT.js | 2 +- .../matter-js/events/COLLISION_END_EVENT.js | 2 +- .../matter-js/events/COLLISION_START_EVENT.js | 2 +- .../matter-js/events/DRAG_END_EVENT.js | 2 +- src/physics/matter-js/events/DRAG_EVENT.js | 2 +- .../matter-js/events/DRAG_START_EVENT.js | 2 +- src/physics/matter-js/events/PAUSE_EVENT.js | 2 +- src/physics/matter-js/events/RESUME_EVENT.js | 2 +- .../matter-js/events/SLEEP_END_EVENT.js | 2 +- .../matter-js/events/SLEEP_START_EVENT.js | 2 +- src/renderer/events/LOSE_WEBGL_EVENT.js | 2 +- src/renderer/events/POST_RENDER_EVENT.js | 2 +- src/renderer/events/PRE_RENDER_CLEAR_EVENT.js | 8 +- src/renderer/events/PRE_RENDER_EVENT.js | 2 +- src/renderer/events/RENDER_EVENT.js | 2 +- src/renderer/events/RESIZE_EVENT.js | 2 +- src/renderer/events/RESTORE_WEBGL_EVENT.js | 2 +- src/scale/events/ENTER_FULLSCREEN_EVENT.js | 2 +- src/scale/events/FULLSCREEN_FAILED_EVENT.js | 2 +- .../events/FULLSCREEN_UNSUPPORTED_EVENT.js | 2 +- src/scale/events/LEAVE_FULLSCREEN_EVENT.js | 2 +- src/scale/events/ORIENTATION_CHANGE_EVENT.js | 2 +- src/scale/events/RESIZE_EVENT.js | 2 +- src/scene/events/ADDED_TO_SCENE_EVENT.js | 2 +- src/scene/events/BOOT_EVENT.js | 2 +- src/scene/events/CREATE_EVENT.js | 2 +- src/scene/events/DESTROY_EVENT.js | 2 +- src/scene/events/PAUSE_EVENT.js | 2 +- src/scene/events/POST_UPDATE_EVENT.js | 2 +- src/scene/events/PRE_RENDER_EVENT.js | 2 +- src/scene/events/PRE_UPDATE_EVENT.js | 2 +- src/scene/events/READY_EVENT.js | 2 +- src/scene/events/REMOVED_FROM_SCENE_EVENT.js | 2 +- src/scene/events/RENDER_EVENT.js | 2 +- src/scene/events/RESUME_EVENT.js | 2 +- src/scene/events/SHUTDOWN_EVENT.js | 2 +- src/scene/events/SLEEP_EVENT.js | 2 +- src/scene/events/START_EVENT.js | 2 +- src/scene/events/TRANSITION_COMPLETE_EVENT.js | 2 +- src/scene/events/TRANSITION_INIT_EVENT.js | 2 +- src/scene/events/TRANSITION_OUT_EVENT.js | 2 +- src/scene/events/TRANSITION_START_EVENT.js | 2 +- src/scene/events/TRANSITION_WAKE_EVENT.js | 2 +- src/scene/events/UPDATE_EVENT.js | 2 +- src/scene/events/WAKE_EVENT.js | 2 +- src/sound/events/COMPLETE_EVENT.js | 2 +- src/sound/events/DECODED_ALL_EVENT.js | 2 +- src/sound/events/DECODED_EVENT.js | 2 +- src/sound/events/DESTROY_EVENT.js | 2 +- src/sound/events/DETUNE_EVENT.js | 2 +- src/sound/events/GLOBAL_DETUNE_EVENT.js | 2 +- src/sound/events/GLOBAL_MUTE_EVENT.js | 2 +- src/sound/events/GLOBAL_RATE_EVENT.js | 2 +- src/sound/events/GLOBAL_VOLUME_EVENT.js | 2 +- src/sound/events/LOOPED_EVENT.js | 2 +- src/sound/events/LOOP_EVENT.js | 2 +- src/sound/events/MUTE_EVENT.js | 2 +- src/sound/events/PAN_EVENT.js | 2 +- src/sound/events/PAUSE_ALL_EVENT.js | 2 +- src/sound/events/PAUSE_EVENT.js | 2 +- src/sound/events/PLAY_EVENT.js | 2 +- src/sound/events/RATE_EVENT.js | 2 +- src/sound/events/RESUME_ALL_EVENT.js | 2 +- src/sound/events/RESUME_EVENT.js | 2 +- src/sound/events/SEEK_EVENT.js | 2 +- src/sound/events/STOP_ALL_EVENT.js | 2 +- src/sound/events/STOP_EVENT.js | 2 +- src/sound/events/UNLOCKED_EVENT.js | 2 +- src/sound/events/VOLUME_EVENT.js | 2 +- src/structs/events/PROCESS_QUEUE_ADD_EVENT.js | 2 +- .../events/PROCESS_QUEUE_REMOVE_EVENT.js | 2 +- src/textures/events/ADD_EVENT.js | 2 +- src/textures/events/ERROR_EVENT.js | 2 +- src/textures/events/LOAD_EVENT.js | 2 +- src/textures/events/READY_EVENT.js | 2 +- src/textures/events/REMOVE_EVENT.js | 2 +- src/time/events/COMPLETE_EVENT.js | 2 +- src/tweens/events/TWEEN_ACTIVE_EVENT.js | 2 +- src/tweens/events/TWEEN_COMPLETE_EVENT.js | 2 +- src/tweens/events/TWEEN_LOOP_EVENT.js | 2 +- src/tweens/events/TWEEN_PAUSE_EVENT.js | 2 +- src/tweens/events/TWEEN_REPEAT_EVENT.js | 2 +- src/tweens/events/TWEEN_RESUME_EVENT.js | 2 +- src/tweens/events/TWEEN_START_EVENT.js | 2 +- src/tweens/events/TWEEN_STOP_EVENT.js | 2 +- src/tweens/events/TWEEN_UPDATE_EVENT.js | 2 +- src/tweens/events/TWEEN_YOYO_EVENT.js | 2 +- types/phaser.d.ts | 11203 +++++++++------- 241 files changed, 6528 insertions(+), 5161 deletions(-) diff --git a/src/animations/events/ADD_ANIMATION_EVENT.js b/src/animations/events/ADD_ANIMATION_EVENT.js index b9066ee1ab..55bd7f8afd 100644 --- a/src/animations/events/ADD_ANIMATION_EVENT.js +++ b/src/animations/events/ADD_ANIMATION_EVENT.js @@ -13,7 +13,7 @@ * or the Animation Manager creating a new animation directly. * * @event Phaser.Animations.Events#ADD_ANIMATION - * @type {string} + * @type {'add'} * @since 3.0.0 * * @param {string} key - The key of the Animation that was added to the global Animation Manager. diff --git a/src/animations/events/ANIMATION_COMPLETE_EVENT.js b/src/animations/events/ANIMATION_COMPLETE_EVENT.js index c22f8f489d..9e2c382512 100644 --- a/src/animations/events/ANIMATION_COMPLETE_EVENT.js +++ b/src/animations/events/ANIMATION_COMPLETE_EVENT.js @@ -30,7 +30,7 @@ * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. * * @event Phaser.Animations.Events#ANIMATION_COMPLETE - * @type {string} + * @type {'animationcomplete'} * @since 3.50.0 * * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. diff --git a/src/animations/events/ANIMATION_REPEAT_EVENT.js b/src/animations/events/ANIMATION_REPEAT_EVENT.js index 15ca2d9426..c6f0811af6 100644 --- a/src/animations/events/ANIMATION_REPEAT_EVENT.js +++ b/src/animations/events/ANIMATION_REPEAT_EVENT.js @@ -27,7 +27,7 @@ * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. * * @event Phaser.Animations.Events#ANIMATION_REPEAT - * @type {string} + * @type {'animationrepeat'} * @since 3.50.0 * * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has repeated. diff --git a/src/animations/events/ANIMATION_RESTART_EVENT.js b/src/animations/events/ANIMATION_RESTART_EVENT.js index d3872c5865..5cd52aaf1f 100644 --- a/src/animations/events/ANIMATION_RESTART_EVENT.js +++ b/src/animations/events/ANIMATION_RESTART_EVENT.js @@ -25,7 +25,7 @@ * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. * * @event Phaser.Animations.Events#ANIMATION_RESTART - * @type {string} + * @type {'animationrestart'} * @since 3.50.0 * * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has restarted. diff --git a/src/animations/events/ANIMATION_START_EVENT.js b/src/animations/events/ANIMATION_START_EVENT.js index e6a3241800..511566d1d8 100644 --- a/src/animations/events/ANIMATION_START_EVENT.js +++ b/src/animations/events/ANIMATION_START_EVENT.js @@ -26,7 +26,7 @@ * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. * * @event Phaser.Animations.Events#ANIMATION_START - * @type {string} + * @type {'animationstart'} * @since 3.50.0 * * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has started. diff --git a/src/animations/events/ANIMATION_STOP_EVENT.js b/src/animations/events/ANIMATION_STOP_EVENT.js index df55cf64e7..fa6766c684 100644 --- a/src/animations/events/ANIMATION_STOP_EVENT.js +++ b/src/animations/events/ANIMATION_STOP_EVENT.js @@ -26,7 +26,7 @@ * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. * * @event Phaser.Animations.Events#ANIMATION_STOP - * @type {string} + * @type {'animationstop'} * @since 3.50.0 * * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has stopped. diff --git a/src/animations/events/ANIMATION_UPDATE_EVENT.js b/src/animations/events/ANIMATION_UPDATE_EVENT.js index b975422db9..0b8795c57c 100644 --- a/src/animations/events/ANIMATION_UPDATE_EVENT.js +++ b/src/animations/events/ANIMATION_UPDATE_EVENT.js @@ -30,7 +30,7 @@ * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. * * @event Phaser.Animations.Events#ANIMATION_UPDATE - * @type {string} + * @type {'animationupdate'} * @since 3.50.0 * * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated. diff --git a/src/animations/events/PAUSE_ALL_EVENT.js b/src/animations/events/PAUSE_ALL_EVENT.js index 6ff794f34e..4e9da4ced8 100644 --- a/src/animations/events/PAUSE_ALL_EVENT.js +++ b/src/animations/events/PAUSE_ALL_EVENT.js @@ -13,7 +13,7 @@ * that the game has paused as well. * * @event Phaser.Animations.Events#PAUSE_ALL - * @type {string} + * @type {'pauseall'} * @since 3.0.0 */ module.exports = 'pauseall'; diff --git a/src/animations/events/REMOVE_ANIMATION_EVENT.js b/src/animations/events/REMOVE_ANIMATION_EVENT.js index 794b1e249e..96e5ffab44 100644 --- a/src/animations/events/REMOVE_ANIMATION_EVENT.js +++ b/src/animations/events/REMOVE_ANIMATION_EVENT.js @@ -10,7 +10,7 @@ * This event is dispatched when an animation is removed from the global Animation Manager. * * @event Phaser.Animations.Events#REMOVE_ANIMATION - * @type {string} + * @type {'remove'} * @since 3.0.0 * * @param {string} key - The key of the Animation that was removed from the global Animation Manager. diff --git a/src/animations/events/RESUME_ALL_EVENT.js b/src/animations/events/RESUME_ALL_EVENT.js index 9808775641..097f7db1f2 100644 --- a/src/animations/events/RESUME_ALL_EVENT.js +++ b/src/animations/events/RESUME_ALL_EVENT.js @@ -12,7 +12,7 @@ * When this happens all current animations will continue updating again. * * @event Phaser.Animations.Events#RESUME_ALL - * @type {string} + * @type {'resumeall'} * @since 3.0.0 */ module.exports = 'resumeall'; diff --git a/src/cache/events/ADD_EVENT.js b/src/cache/events/ADD_EVENT.js index e4ba537efa..eb3196772f 100644 --- a/src/cache/events/ADD_EVENT.js +++ b/src/cache/events/ADD_EVENT.js @@ -10,7 +10,7 @@ * This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it. * * @event Phaser.Cache.Events#ADD - * @type {string} + * @type {'add'} * @since 3.0.0 * * @param {Phaser.Cache.BaseCache} cache - The cache to which the object was added. diff --git a/src/cache/events/REMOVE_EVENT.js b/src/cache/events/REMOVE_EVENT.js index 9004a4d656..9eeb32b837 100644 --- a/src/cache/events/REMOVE_EVENT.js +++ b/src/cache/events/REMOVE_EVENT.js @@ -10,7 +10,7 @@ * This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it. * * @event Phaser.Cache.Events#REMOVE - * @type {string} + * @type {'remove'} * @since 3.0.0 * * @param {Phaser.Cache.BaseCache} cache - The cache from which the object was removed. diff --git a/src/cameras/2d/events/DESTROY_EVENT.js b/src/cameras/2d/events/DESTROY_EVENT.js index 02f265c128..befb3bde5b 100644 --- a/src/cameras/2d/events/DESTROY_EVENT.js +++ b/src/cameras/2d/events/DESTROY_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#DESTROY - * @type {string} + * @type {'cameradestroy'} * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that was destroyed. diff --git a/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js b/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js index 117bd02ee7..dc97277e9b 100644 --- a/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js +++ b/src/cameras/2d/events/FADE_IN_COMPLETE_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Camera instance using `Camera.on('camerafadeincomplete', listener)`. * * @event Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE - * @type {string} + * @type {'camerafadeincomplete'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/FADE_IN_START_EVENT.js b/src/cameras/2d/events/FADE_IN_START_EVENT.js index 50eada9ff2..6a13f15c74 100644 --- a/src/cameras/2d/events/FADE_IN_START_EVENT.js +++ b/src/cameras/2d/events/FADE_IN_START_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Camera instance using `Camera.on('camerafadeinstart', listener)`. * * @event Phaser.Cameras.Scene2D.Events#FADE_IN_START - * @type {string} + * @type {'camerafadeinstart'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js b/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js index 0d41ddd20c..4a2aad7d5d 100644 --- a/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js +++ b/src/cameras/2d/events/FADE_OUT_COMPLETE_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Camera instance using `Camera.on('camerafadeoutcomplete', listener)`. * * @event Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE - * @type {string} + * @type {'camerafadeoutcomplete'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/FADE_OUT_START_EVENT.js b/src/cameras/2d/events/FADE_OUT_START_EVENT.js index 910a5da7cd..0060eae098 100644 --- a/src/cameras/2d/events/FADE_OUT_START_EVENT.js +++ b/src/cameras/2d/events/FADE_OUT_START_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Camera instance using `Camera.on('camerafadeoutstart', listener)`. * * @event Phaser.Cameras.Scene2D.Events#FADE_OUT_START - * @type {string} + * @type {'camerafadeoutstart'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js b/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js index 542838867f..58b601aaea 100644 --- a/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js +++ b/src/cameras/2d/events/FLASH_COMPLETE_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE - * @type {string} + * @type {'cameraflashcomplete'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/FLASH_START_EVENT.js b/src/cameras/2d/events/FLASH_START_EVENT.js index 57967daac5..e97074530a 100644 --- a/src/cameras/2d/events/FLASH_START_EVENT.js +++ b/src/cameras/2d/events/FLASH_START_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#FLASH_START - * @type {string} + * @type {'cameraflashstart'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js b/src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js index cdf2cbcdcf..061663bef9 100644 --- a/src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js +++ b/src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Camera instance using: `camera.on('followupdate', listener)`. * * @event Phaser.Cameras.Scene2D.Events#FOLLOW_UPDATE - * @type {string} + * @type {'followupdate'} * @since 3.50.0 * * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that emitted the event. diff --git a/src/cameras/2d/events/PAN_COMPLETE_EVENT.js b/src/cameras/2d/events/PAN_COMPLETE_EVENT.js index b1336e24aa..f675bf4801 100644 --- a/src/cameras/2d/events/PAN_COMPLETE_EVENT.js +++ b/src/cameras/2d/events/PAN_COMPLETE_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#PAN_COMPLETE - * @type {string} + * @type {'camerapancomplete'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/PAN_START_EVENT.js b/src/cameras/2d/events/PAN_START_EVENT.js index 9e1ca81a62..47a94db08e 100644 --- a/src/cameras/2d/events/PAN_START_EVENT.js +++ b/src/cameras/2d/events/PAN_START_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#PAN_START - * @type {string} + * @type {'camerapanstart'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/POST_RENDER_EVENT.js b/src/cameras/2d/events/POST_RENDER_EVENT.js index c9d6e25def..ee4a60ae54 100644 --- a/src/cameras/2d/events/POST_RENDER_EVENT.js +++ b/src/cameras/2d/events/POST_RENDER_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Camera instance using: `camera.on('postrender', listener)`. * * @event Phaser.Cameras.Scene2D.Events#POST_RENDER - * @type {string} + * @type {'postrender'} * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that has finished rendering to a texture. diff --git a/src/cameras/2d/events/PRE_RENDER_EVENT.js b/src/cameras/2d/events/PRE_RENDER_EVENT.js index 215d3d78a0..91562a9bc0 100644 --- a/src/cameras/2d/events/PRE_RENDER_EVENT.js +++ b/src/cameras/2d/events/PRE_RENDER_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Camera instance using: `camera.on('prerender', listener)`. * * @event Phaser.Cameras.Scene2D.Events#PRE_RENDER - * @type {string} + * @type {'prerender'} * @since 3.0.0 * * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that is about to render to a texture. diff --git a/src/cameras/2d/events/ROTATE_COMPLETE_EVENT.js b/src/cameras/2d/events/ROTATE_COMPLETE_EVENT.js index 7ea622358e..f10098485d 100644 --- a/src/cameras/2d/events/ROTATE_COMPLETE_EVENT.js +++ b/src/cameras/2d/events/ROTATE_COMPLETE_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#ROTATE_COMPLETE - * @type {string} + * @type {'camerarotatecomplete'} * @since 3.23.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/ROTATE_START_EVENT.js b/src/cameras/2d/events/ROTATE_START_EVENT.js index 8c4ce38891..7e0992696f 100644 --- a/src/cameras/2d/events/ROTATE_START_EVENT.js +++ b/src/cameras/2d/events/ROTATE_START_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#ROTATE_START - * @type {string} + * @type {'camerarotatestart'} * @since 3.23.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js b/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js index a663f1e5ad..d50deb6b87 100644 --- a/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js +++ b/src/cameras/2d/events/SHAKE_COMPLETE_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE - * @type {string} + * @type {'camerashakecomplete'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/SHAKE_START_EVENT.js b/src/cameras/2d/events/SHAKE_START_EVENT.js index e701a8e5d5..6c14e01a0b 100644 --- a/src/cameras/2d/events/SHAKE_START_EVENT.js +++ b/src/cameras/2d/events/SHAKE_START_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#SHAKE_START - * @type {string} + * @type {'camerashakestart'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js b/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js index 044c3dad03..b71ffd5f53 100644 --- a/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js +++ b/src/cameras/2d/events/ZOOM_COMPLETE_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#ZOOM_COMPLETE - * @type {string} + * @type {'camerazoomcomplete'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/cameras/2d/events/ZOOM_START_EVENT.js b/src/cameras/2d/events/ZOOM_START_EVENT.js index 197343b3d8..460f6d7f9f 100644 --- a/src/cameras/2d/events/ZOOM_START_EVENT.js +++ b/src/cameras/2d/events/ZOOM_START_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Cameras.Scene2D.Events#ZOOM_START - * @type {string} + * @type {'camerazoomstart'} * @since 3.3.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. diff --git a/src/core/events/BLUR_EVENT.js b/src/core/events/BLUR_EVENT.js index f245ee27d2..4fba4311f4 100644 --- a/src/core/events/BLUR_EVENT.js +++ b/src/core/events/BLUR_EVENT.js @@ -12,7 +12,7 @@ * tab, or if they simply remove focus from the browser to another app. * * @event Phaser.Core.Events#BLUR - * @type {string} + * @type {'blur'} * @since 3.0.0 */ module.exports = 'blur'; diff --git a/src/core/events/BOOT_EVENT.js b/src/core/events/BOOT_EVENT.js index 35c6e52e8f..9f6abb5f48 100644 --- a/src/core/events/BOOT_EVENT.js +++ b/src/core/events/BOOT_EVENT.js @@ -11,7 +11,7 @@ * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. * * @event Phaser.Core.Events#BOOT - * @type {string} + * @type {'boot'} * @since 3.0.0 */ module.exports = 'boot'; diff --git a/src/core/events/CONTEXT_LOST_EVENT.js b/src/core/events/CONTEXT_LOST_EVENT.js index cd2ded3dd9..201d9a7289 100644 --- a/src/core/events/CONTEXT_LOST_EVENT.js +++ b/src/core/events/CONTEXT_LOST_EVENT.js @@ -12,7 +12,7 @@ * The renderer halts all rendering and cannot resume after this happens. * * @event Phaser.Core.Events#CONTEXT_LOST - * @type {string} + * @type {'contextlost'} * @since 3.19.0 */ module.exports = 'contextlost'; diff --git a/src/core/events/DESTROY_EVENT.js b/src/core/events/DESTROY_EVENT.js index 524e7cb76d..a73fcb009c 100644 --- a/src/core/events/DESTROY_EVENT.js +++ b/src/core/events/DESTROY_EVENT.js @@ -12,7 +12,7 @@ * Custom plugins and game code should also do the same. * * @event Phaser.Core.Events#DESTROY - * @type {string} + * @type {'destroy'} * @since 3.0.0 */ module.exports = 'destroy'; diff --git a/src/core/events/FOCUS_EVENT.js b/src/core/events/FOCUS_EVENT.js index 536b215aca..a195adb62e 100644 --- a/src/core/events/FOCUS_EVENT.js +++ b/src/core/events/FOCUS_EVENT.js @@ -11,7 +11,7 @@ * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. * * @event Phaser.Core.Events#FOCUS - * @type {string} + * @type {'focus'} * @since 3.0.0 */ module.exports = 'focus'; diff --git a/src/core/events/HIDDEN_EVENT.js b/src/core/events/HIDDEN_EVENT.js index 840b150609..d81ec16e51 100644 --- a/src/core/events/HIDDEN_EVENT.js +++ b/src/core/events/HIDDEN_EVENT.js @@ -15,7 +15,7 @@ * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) * * @event Phaser.Core.Events#HIDDEN - * @type {string} + * @type {'hidden'} * @since 3.0.0 */ module.exports = 'hidden'; diff --git a/src/core/events/PAUSE_EVENT.js b/src/core/events/PAUSE_EVENT.js index bfc85c275b..c0d53df1c6 100644 --- a/src/core/events/PAUSE_EVENT.js +++ b/src/core/events/PAUSE_EVENT.js @@ -10,7 +10,7 @@ * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. * * @event Phaser.Core.Events#PAUSE - * @type {string} + * @type {'pause'} * @since 3.0.0 */ module.exports = 'pause'; diff --git a/src/core/events/POST_RENDER_EVENT.js b/src/core/events/POST_RENDER_EVENT.js index 4b3067bd0c..1dbcce43a6 100644 --- a/src/core/events/POST_RENDER_EVENT.js +++ b/src/core/events/POST_RENDER_EVENT.js @@ -13,7 +13,7 @@ * Use it for any last minute post-processing before the next game step begins. * * @event Phaser.Core.Events#POST_RENDER - * @type {string} + * @type {'postrender'} * @since 3.0.0 * * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. diff --git a/src/core/events/POST_STEP_EVENT.js b/src/core/events/POST_STEP_EVENT.js index 93fe661ff8..a305d7546c 100644 --- a/src/core/events/POST_STEP_EVENT.js +++ b/src/core/events/POST_STEP_EVENT.js @@ -11,7 +11,7 @@ * Hook into it from plugins or systems that need to do things before the render starts. * * @event Phaser.Core.Events#POST_STEP - * @type {string} + * @type {'poststep'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/core/events/PRE_RENDER_EVENT.js b/src/core/events/PRE_RENDER_EVENT.js index 20a19217fa..0f010f1a10 100644 --- a/src/core/events/PRE_RENDER_EVENT.js +++ b/src/core/events/PRE_RENDER_EVENT.js @@ -12,7 +12,7 @@ * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. * * @event Phaser.Core.Events#PRE_RENDER - * @type {string} + * @type {'prerender'} * @since 3.0.0 * * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance. diff --git a/src/core/events/PRE_STEP_EVENT.js b/src/core/events/PRE_STEP_EVENT.js index 913da1f077..4fe0da7a0c 100644 --- a/src/core/events/PRE_STEP_EVENT.js +++ b/src/core/events/PRE_STEP_EVENT.js @@ -11,7 +11,7 @@ * Hook into it from plugins or systems that need to update before the Scene Manager does. * * @event Phaser.Core.Events#PRE_STEP - * @type {string} + * @type {'prestep'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/core/events/READY_EVENT.js b/src/core/events/READY_EVENT.js index c6517aae75..843463c615 100644 --- a/src/core/events/READY_EVENT.js +++ b/src/core/events/READY_EVENT.js @@ -11,7 +11,7 @@ * and all local systems are now able to start. * * @event Phaser.Core.Events#READY - * @type {string} + * @type {'ready'} * @since 3.0.0 */ module.exports = 'ready'; diff --git a/src/core/events/RESUME_EVENT.js b/src/core/events/RESUME_EVENT.js index 266ee6a6be..f52480b39a 100644 --- a/src/core/events/RESUME_EVENT.js +++ b/src/core/events/RESUME_EVENT.js @@ -10,7 +10,7 @@ * This event is dispatched when the game loop leaves a paused state and resumes running. * * @event Phaser.Core.Events#RESUME - * @type {string} + * @type {'resume'} * @since 3.0.0 * * @param {number} pauseDuration - The duration, in ms, that the game was paused for, or 0 if {@link Phaser.Game#resume} was called. diff --git a/src/core/events/STEP_EVENT.js b/src/core/events/STEP_EVENT.js index 793d211e42..5947e5d881 100644 --- a/src/core/events/STEP_EVENT.js +++ b/src/core/events/STEP_EVENT.js @@ -11,7 +11,7 @@ * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. * * @event Phaser.Core.Events#STEP - * @type {string} + * @type {'step'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/core/events/SYSTEM_READY_EVENT.js b/src/core/events/SYSTEM_READY_EVENT.js index b8effefe82..3c1bc2f5f2 100644 --- a/src/core/events/SYSTEM_READY_EVENT.js +++ b/src/core/events/SYSTEM_READY_EVENT.js @@ -11,7 +11,7 @@ * This event is dispatched just once by the Game instance. * * @event Phaser.Core.Events#SYSTEM_READY - * @type {string} + * @type {'systemready'} * @since 3.70.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/core/events/VISIBLE_EVENT.js b/src/core/events/VISIBLE_EVENT.js index 55031a959f..6d269ad21a 100644 --- a/src/core/events/VISIBLE_EVENT.js +++ b/src/core/events/VISIBLE_EVENT.js @@ -13,7 +13,7 @@ * Only browsers that support the Visibility API will cause this event to be emitted. * * @event Phaser.Core.Events#VISIBLE - * @type {string} + * @type {'visible'} * @since 3.0.0 */ module.exports = 'visible'; diff --git a/src/data/events/CHANGE_DATA_EVENT.js b/src/data/events/CHANGE_DATA_EVENT.js index db21b31fd2..585ac98bb7 100644 --- a/src/data/events/CHANGE_DATA_EVENT.js +++ b/src/data/events/CHANGE_DATA_EVENT.js @@ -16,7 +16,7 @@ * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. * * @event Phaser.Data.Events#CHANGE_DATA - * @type {string} + * @type {'changedata'} * @since 3.0.0 * * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to. diff --git a/src/data/events/DESTROY_EVENT.js b/src/data/events/DESTROY_EVENT.js index 31aee88dcf..e80cb502e6 100644 --- a/src/data/events/DESTROY_EVENT.js +++ b/src/data/events/DESTROY_EVENT.js @@ -10,7 +10,7 @@ * The Data Manager will listen for the destroy event from its parent, and then close itself down. * * @event Phaser.Data.Events#DESTROY - * @type {string} + * @type {'destroy'} * @since 3.50.0 */ module.exports = 'destroy'; diff --git a/src/data/events/REMOVE_DATA_EVENT.js b/src/data/events/REMOVE_DATA_EVENT.js index 31b33c9ed5..65b2fb887f 100644 --- a/src/data/events/REMOVE_DATA_EVENT.js +++ b/src/data/events/REMOVE_DATA_EVENT.js @@ -13,7 +13,7 @@ * the removal of a data item on a Game Object you would use: `sprite.on('removedata', listener)`. * * @event Phaser.Data.Events#REMOVE_DATA - * @type {string} + * @type {'removedata'} * @since 3.0.0 * * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. diff --git a/src/data/events/SET_DATA_EVENT.js b/src/data/events/SET_DATA_EVENT.js index 0319a4d20e..57127e7a55 100644 --- a/src/data/events/SET_DATA_EVENT.js +++ b/src/data/events/SET_DATA_EVENT.js @@ -13,7 +13,7 @@ * the addition of a new data item on a Game Object you would use: `sprite.on('setdata', listener)`. * * @event Phaser.Data.Events#SET_DATA - * @type {string} + * @type {'setdata'} * @since 3.0.0 * * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event. diff --git a/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js b/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js index dbf3fa221d..c5ddef12f1 100644 --- a/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js +++ b/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js @@ -12,7 +12,7 @@ * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. * * @event Phaser.GameObjects.Events#ADDED_TO_SCENE - * @type {string} + * @type {'addedtoscene'} * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. diff --git a/src/gameobjects/events/DESTROY_EVENT.js b/src/gameobjects/events/DESTROY_EVENT.js index 881f04a891..33d3514b7d 100644 --- a/src/gameobjects/events/DESTROY_EVENT.js +++ b/src/gameobjects/events/DESTROY_EVENT.js @@ -12,7 +12,7 @@ * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. * * @event Phaser.GameObjects.Events#DESTROY - * @type {string} + * @type {'destroy'} * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed. diff --git a/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js b/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js index bca1af67ce..197a985961 100644 --- a/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js +++ b/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js @@ -12,7 +12,7 @@ * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. * * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE - * @type {string} + * @type {'removedfromscene'} * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. diff --git a/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js b/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js index 163ab04d25..31dba71266 100644 --- a/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js +++ b/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js @@ -19,7 +19,7 @@ * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_COMPLETE - * @type {string} + * @type {'complete'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback. diff --git a/src/gameobjects/events/VIDEO_CREATED_EVENT.js b/src/gameobjects/events/VIDEO_CREATED_EVENT.js index 14740ded5f..4ac00d6762 100644 --- a/src/gameobjects/events/VIDEO_CREATED_EVENT.js +++ b/src/gameobjects/events/VIDEO_CREATED_EVENT.js @@ -14,7 +14,7 @@ * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_CREATED - * @type {string} + * @type {'created'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. diff --git a/src/gameobjects/events/VIDEO_ERROR_EVENT.js b/src/gameobjects/events/VIDEO_ERROR_EVENT.js index 3ae643b06c..1c1321df36 100644 --- a/src/gameobjects/events/VIDEO_ERROR_EVENT.js +++ b/src/gameobjects/events/VIDEO_ERROR_EVENT.js @@ -12,7 +12,7 @@ * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_ERROR - * @type {string} + * @type {'error'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. diff --git a/src/gameobjects/events/VIDEO_LOCKED_EVENT.js b/src/gameobjects/events/VIDEO_LOCKED_EVENT.js index cf7142219d..3ca7bb5d81 100644 --- a/src/gameobjects/events/VIDEO_LOCKED_EVENT.js +++ b/src/gameobjects/events/VIDEO_LOCKED_EVENT.js @@ -17,7 +17,7 @@ * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_LOCKED - * @type {string} + * @type {'locked'} * @since 3.60.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. diff --git a/src/gameobjects/events/VIDEO_LOOP_EVENT.js b/src/gameobjects/events/VIDEO_LOOP_EVENT.js index d7c7833eac..5ed2e23762 100644 --- a/src/gameobjects/events/VIDEO_LOOP_EVENT.js +++ b/src/gameobjects/events/VIDEO_LOOP_EVENT.js @@ -19,7 +19,7 @@ * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_LOOP - * @type {string} + * @type {'loop'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped. diff --git a/src/gameobjects/events/VIDEO_METADATA_EVENT.js b/src/gameobjects/events/VIDEO_METADATA_EVENT.js index e5fabaf046..d0c8fd9f81 100644 --- a/src/gameobjects/events/VIDEO_METADATA_EVENT.js +++ b/src/gameobjects/events/VIDEO_METADATA_EVENT.js @@ -12,7 +12,7 @@ * Listen for it from a Video Game Object instance using `Video.on('metadata', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_METADATA - * @type {string} + * @type {'metadata'} * @since 3.80.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which fired the event. diff --git a/src/gameobjects/events/VIDEO_PLAYING_EVENT.js b/src/gameobjects/events/VIDEO_PLAYING_EVENT.js index 5bf6fae9fd..8940cef031 100644 --- a/src/gameobjects/events/VIDEO_PLAYING_EVENT.js +++ b/src/gameobjects/events/VIDEO_PLAYING_EVENT.js @@ -14,7 +14,7 @@ * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_PLAYING - * @type {string} + * @type {'playing'} * @since 3.60.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. diff --git a/src/gameobjects/events/VIDEO_PLAY_EVENT.js b/src/gameobjects/events/VIDEO_PLAY_EVENT.js index eb020be6e6..b74647ff0d 100644 --- a/src/gameobjects/events/VIDEO_PLAY_EVENT.js +++ b/src/gameobjects/events/VIDEO_PLAY_EVENT.js @@ -15,7 +15,7 @@ * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_PLAY - * @type {string} + * @type {'play'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. diff --git a/src/gameobjects/events/VIDEO_SEEKED_EVENT.js b/src/gameobjects/events/VIDEO_SEEKED_EVENT.js index 789cf62c4d..df1ba47995 100644 --- a/src/gameobjects/events/VIDEO_SEEKED_EVENT.js +++ b/src/gameobjects/events/VIDEO_SEEKED_EVENT.js @@ -12,7 +12,7 @@ * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKED - * @type {string} + * @type {'seeked'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking. diff --git a/src/gameobjects/events/VIDEO_SEEKING_EVENT.js b/src/gameobjects/events/VIDEO_SEEKING_EVENT.js index 7a44a4b883..d6d0dae050 100644 --- a/src/gameobjects/events/VIDEO_SEEKING_EVENT.js +++ b/src/gameobjects/events/VIDEO_SEEKING_EVENT.js @@ -13,7 +13,7 @@ * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_SEEKING - * @type {string} + * @type {'seeking'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking. diff --git a/src/gameobjects/events/VIDEO_STALLED_EVENT.js b/src/gameobjects/events/VIDEO_STALLED_EVENT.js index 245de71024..f348a93f90 100644 --- a/src/gameobjects/events/VIDEO_STALLED_EVENT.js +++ b/src/gameobjects/events/VIDEO_STALLED_EVENT.js @@ -24,7 +24,7 @@ * the current batch of frames have rendered. * * @event Phaser.GameObjects.Events#VIDEO_STALLED - * @type {string} + * @type {'stalled'} * @since 3.60.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error. diff --git a/src/gameobjects/events/VIDEO_STOP_EVENT.js b/src/gameobjects/events/VIDEO_STOP_EVENT.js index 1df249c3f8..cd6df56a9b 100644 --- a/src/gameobjects/events/VIDEO_STOP_EVENT.js +++ b/src/gameobjects/events/VIDEO_STOP_EVENT.js @@ -13,7 +13,7 @@ * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_STOP - * @type {string} + * @type {'stop'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback. diff --git a/src/gameobjects/events/VIDEO_TEXTURE_EVENT.js b/src/gameobjects/events/VIDEO_TEXTURE_EVENT.js index 4c069aa9ec..0bdc58b247 100644 --- a/src/gameobjects/events/VIDEO_TEXTURE_EVENT.js +++ b/src/gameobjects/events/VIDEO_TEXTURE_EVENT.js @@ -17,7 +17,7 @@ * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_TEXTURE - * @type {string} + * @type {'textureready'} * @since 3.60.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object that emitted the event. diff --git a/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js b/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js index 05a7c1e32c..47306e0216 100644 --- a/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js +++ b/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js @@ -13,7 +13,7 @@ * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED - * @type {string} + * @type {'unlocked'} * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. diff --git a/src/gameobjects/events/VIDEO_UNSUPPORTED_EVENT.js b/src/gameobjects/events/VIDEO_UNSUPPORTED_EVENT.js index 44ce5ca528..d9c3d98c67 100644 --- a/src/gameobjects/events/VIDEO_UNSUPPORTED_EVENT.js +++ b/src/gameobjects/events/VIDEO_UNSUPPORTED_EVENT.js @@ -14,7 +14,7 @@ * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. * * @event Phaser.GameObjects.Events#VIDEO_UNSUPPORTED - * @type {string} + * @type {'unsupported'} * @since 3.60.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback. diff --git a/src/gameobjects/particles/events/COMPLETE_EVENT.js b/src/gameobjects/particles/events/COMPLETE_EVENT.js index 5df7da6815..cb2420a9f0 100644 --- a/src/gameobjects/particles/events/COMPLETE_EVENT.js +++ b/src/gameobjects/particles/events/COMPLETE_EVENT.js @@ -14,7 +14,7 @@ * Listen for it on a Particle Emitter instance using `ParticleEmitter.on('complete', listener)`. * * @event Phaser.GameObjects.Particles.Events#COMPLETE - * @type {string} + * @type {'complete'} * @since 3.60.0 * * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - A reference to the Particle Emitter that just completed. diff --git a/src/gameobjects/particles/events/DEATH_ZONE_EVENT.js b/src/gameobjects/particles/events/DEATH_ZONE_EVENT.js index 2418e9dbe4..6a2a8c6cf9 100644 --- a/src/gameobjects/particles/events/DEATH_ZONE_EVENT.js +++ b/src/gameobjects/particles/events/DEATH_ZONE_EVENT.js @@ -14,7 +14,7 @@ * If you wish to know when the final particle is killed, see the `COMPLETE` event. * * @event Phaser.GameObjects.Particles.Events#DEATH_ZONE - * @type {string} + * @type {'deathzone'} * @since 3.60.0 * * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - A reference to the Particle Emitter that owns the Particle and Death Zone. diff --git a/src/gameobjects/particles/events/EXPLODE_EVENT.js b/src/gameobjects/particles/events/EXPLODE_EVENT.js index 7e41942d1c..d166d38f1f 100644 --- a/src/gameobjects/particles/events/EXPLODE_EVENT.js +++ b/src/gameobjects/particles/events/EXPLODE_EVENT.js @@ -12,7 +12,7 @@ * Listen for it on a Particle Emitter instance using `ParticleEmitter.on('explode', listener)`. * * @event Phaser.GameObjects.Particles.Events#EXPLODE - * @type {string} + * @type {'explode'} * @since 3.60.0 * * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - A reference to the Particle Emitter that just completed. diff --git a/src/gameobjects/particles/events/START_EVENT.js b/src/gameobjects/particles/events/START_EVENT.js index 8dd011ba01..83534859f4 100644 --- a/src/gameobjects/particles/events/START_EVENT.js +++ b/src/gameobjects/particles/events/START_EVENT.js @@ -12,7 +12,7 @@ * Listen for it on a Particle Emitter instance using `ParticleEmitter.on('start', listener)`. * * @event Phaser.GameObjects.Particles.Events#START - * @type {string} + * @type {'start'} * @since 3.60.0 * * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - A reference to the Particle Emitter that just completed. diff --git a/src/gameobjects/particles/events/STOP_EVENT.js b/src/gameobjects/particles/events/STOP_EVENT.js index 04892b3f2c..641b3f1276 100644 --- a/src/gameobjects/particles/events/STOP_EVENT.js +++ b/src/gameobjects/particles/events/STOP_EVENT.js @@ -20,7 +20,7 @@ * If you wish to know when the final particle is killed, see the `COMPLETE` event. * * @event Phaser.GameObjects.Particles.Events#STOP - * @type {string} + * @type {'stop'} * @since 3.60.0 * * @param {Phaser.GameObjects.Particles.ParticleEmitter} emitter - A reference to the Particle Emitter that just completed. diff --git a/src/input/events/BOOT_EVENT.js b/src/input/events/BOOT_EVENT.js index 48495788f3..bc7c270d28 100644 --- a/src/input/events/BOOT_EVENT.js +++ b/src/input/events/BOOT_EVENT.js @@ -10,7 +10,7 @@ * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. * * @event Phaser.Input.Events#BOOT - * @type {string} + * @type {'boot'} * @since 3.0.0 */ module.exports = 'boot'; diff --git a/src/input/events/DESTROY_EVENT.js b/src/input/events/DESTROY_EVENT.js index 3cf01d027d..2c1d526b3a 100644 --- a/src/input/events/DESTROY_EVENT.js +++ b/src/input/events/DESTROY_EVENT.js @@ -10,7 +10,7 @@ * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. * * @event Phaser.Input.Events#DESTROY - * @type {string} + * @type {'destroy'} * @since 3.0.0 */ module.exports = 'destroy'; diff --git a/src/input/events/DRAG_END_EVENT.js b/src/input/events/DRAG_END_EVENT.js index 4e01a65f3a..eed5558896 100644 --- a/src/input/events/DRAG_END_EVENT.js +++ b/src/input/events/DRAG_END_EVENT.js @@ -14,7 +14,7 @@ * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. * * @event Phaser.Input.Events#DRAG_END - * @type {string} + * @type {'dragend'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/DRAG_ENTER_EVENT.js b/src/input/events/DRAG_ENTER_EVENT.js index aeaaa2644f..830e52d887 100644 --- a/src/input/events/DRAG_ENTER_EVENT.js +++ b/src/input/events/DRAG_ENTER_EVENT.js @@ -16,7 +16,7 @@ * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. * * @event Phaser.Input.Events#DRAG_ENTER - * @type {string} + * @type {'dragenter'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/DRAG_EVENT.js b/src/input/events/DRAG_EVENT.js index 8119f37f9d..66299bddfb 100644 --- a/src/input/events/DRAG_EVENT.js +++ b/src/input/events/DRAG_EVENT.js @@ -16,7 +16,7 @@ * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. * * @event Phaser.Input.Events#DRAG - * @type {string} + * @type {'drag'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/DRAG_LEAVE_EVENT.js b/src/input/events/DRAG_LEAVE_EVENT.js index d78ff18db4..96a63f6137 100644 --- a/src/input/events/DRAG_LEAVE_EVENT.js +++ b/src/input/events/DRAG_LEAVE_EVENT.js @@ -16,7 +16,7 @@ * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. * * @event Phaser.Input.Events#DRAG_LEAVE - * @type {string} + * @type {'dragleave'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/DRAG_OVER_EVENT.js b/src/input/events/DRAG_OVER_EVENT.js index 830db3dbe2..4937a003af 100644 --- a/src/input/events/DRAG_OVER_EVENT.js +++ b/src/input/events/DRAG_OVER_EVENT.js @@ -19,7 +19,7 @@ * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. * * @event Phaser.Input.Events#DRAG_OVER - * @type {string} + * @type {'dragover'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/DRAG_START_EVENT.js b/src/input/events/DRAG_START_EVENT.js index 7006b7ce87..01739c4b19 100644 --- a/src/input/events/DRAG_START_EVENT.js +++ b/src/input/events/DRAG_START_EVENT.js @@ -16,7 +16,7 @@ * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. * * @event Phaser.Input.Events#DRAG_START - * @type {string} + * @type {'dragstart'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/DROP_EVENT.js b/src/input/events/DROP_EVENT.js index 159c6e18de..bd7b09b0e4 100644 --- a/src/input/events/DROP_EVENT.js +++ b/src/input/events/DROP_EVENT.js @@ -14,7 +14,7 @@ * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. * * @event Phaser.Input.Events#DROP - * @type {string} + * @type {'drop'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DOWN_EVENT.js b/src/input/events/GAMEOBJECT_DOWN_EVENT.js index 21ebc9dbbc..03e76d74b7 100644 --- a/src/input/events/GAMEOBJECT_DOWN_EVENT.js +++ b/src/input/events/GAMEOBJECT_DOWN_EVENT.js @@ -26,7 +26,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_DOWN - * @type {string} + * @type {'gameobjectdown'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js b/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js index a530e061fc..50fb5d6157 100644 --- a/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js +++ b/src/input/events/GAMEOBJECT_DRAG_END_EVENT.js @@ -16,7 +16,7 @@ * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_END - * @type {string} + * @type {'dragend'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js b/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js index cc472f45c6..f230936638 100644 --- a/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js +++ b/src/input/events/GAMEOBJECT_DRAG_ENTER_EVENT.js @@ -16,7 +16,7 @@ * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_ENTER - * @type {string} + * @type {'dragenter'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DRAG_EVENT.js b/src/input/events/GAMEOBJECT_DRAG_EVENT.js index 550b3b6553..e9d9f2c38f 100644 --- a/src/input/events/GAMEOBJECT_DRAG_EVENT.js +++ b/src/input/events/GAMEOBJECT_DRAG_EVENT.js @@ -16,7 +16,7 @@ * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG - * @type {string} + * @type {'drag'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js b/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js index a926c591ad..dd15f2571a 100644 --- a/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js +++ b/src/input/events/GAMEOBJECT_DRAG_LEAVE_EVENT.js @@ -16,7 +16,7 @@ * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_LEAVE - * @type {string} + * @type {'dragleave'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js b/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js index 3c1ba9a442..dfbd68fa54 100644 --- a/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js +++ b/src/input/events/GAMEOBJECT_DRAG_OVER_EVENT.js @@ -19,7 +19,7 @@ * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_OVER - * @type {string} + * @type {'dragover'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js b/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js index 831a40890b..850252e44d 100644 --- a/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js +++ b/src/input/events/GAMEOBJECT_DRAG_START_EVENT.js @@ -19,7 +19,7 @@ * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. * * @event Phaser.Input.Events#GAMEOBJECT_DRAG_START - * @type {string} + * @type {'dragstart'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_DROP_EVENT.js b/src/input/events/GAMEOBJECT_DROP_EVENT.js index bc3e7d6bdd..105c841da9 100644 --- a/src/input/events/GAMEOBJECT_DROP_EVENT.js +++ b/src/input/events/GAMEOBJECT_DROP_EVENT.js @@ -16,7 +16,7 @@ * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. * * @event Phaser.Input.Events#GAMEOBJECT_DROP - * @type {string} + * @type {'drop'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_MOVE_EVENT.js b/src/input/events/GAMEOBJECT_MOVE_EVENT.js index d644aec2d7..7f3f68f0a8 100644 --- a/src/input/events/GAMEOBJECT_MOVE_EVENT.js +++ b/src/input/events/GAMEOBJECT_MOVE_EVENT.js @@ -26,7 +26,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_MOVE - * @type {string} + * @type {'gameobjectmove'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_OUT_EVENT.js b/src/input/events/GAMEOBJECT_OUT_EVENT.js index 5ab50014f7..dc99192e63 100644 --- a/src/input/events/GAMEOBJECT_OUT_EVENT.js +++ b/src/input/events/GAMEOBJECT_OUT_EVENT.js @@ -29,7 +29,7 @@ * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. * * @event Phaser.Input.Events#GAMEOBJECT_OUT - * @type {string} + * @type {'gameobjectout'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_OVER_EVENT.js b/src/input/events/GAMEOBJECT_OVER_EVENT.js index 0a9247bcb4..6ff2525f46 100644 --- a/src/input/events/GAMEOBJECT_OVER_EVENT.js +++ b/src/input/events/GAMEOBJECT_OVER_EVENT.js @@ -26,7 +26,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_OVER - * @type {string} + * @type {'gameobjectover'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js b/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js index 94e7d85ecb..a2fd7157bf 100644 --- a/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js +++ b/src/input/events/GAMEOBJECT_POINTER_DOWN_EVENT.js @@ -25,7 +25,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_DOWN - * @type {string} + * @type {'pointerdown'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js b/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js index 2fb0f56c94..b259084ff5 100644 --- a/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js +++ b/src/input/events/GAMEOBJECT_POINTER_MOVE_EVENT.js @@ -25,7 +25,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_MOVE - * @type {string} + * @type {'pointermove'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js b/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js index 45240f372c..5c6750781b 100644 --- a/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js +++ b/src/input/events/GAMEOBJECT_POINTER_OUT_EVENT.js @@ -28,7 +28,7 @@ * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OUT - * @type {string} + * @type {'pointerout'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js b/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js index 121a80e969..6d08afeed2 100644 --- a/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js +++ b/src/input/events/GAMEOBJECT_POINTER_OVER_EVENT.js @@ -25,7 +25,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_OVER - * @type {string} + * @type {'pointerover'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js b/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js index 8260252831..729ae342dc 100644 --- a/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js +++ b/src/input/events/GAMEOBJECT_POINTER_UP_EVENT.js @@ -25,7 +25,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_UP - * @type {string} + * @type {'pointerup'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js b/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js index 4923cdd7db..ae4984c4fa 100644 --- a/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js +++ b/src/input/events/GAMEOBJECT_POINTER_WHEEL_EVENT.js @@ -25,7 +25,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_POINTER_WHEEL - * @type {string} + * @type {'wheel'} * @since 3.18.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_UP_EVENT.js b/src/input/events/GAMEOBJECT_UP_EVENT.js index 8cb20f62bc..05a922e312 100644 --- a/src/input/events/GAMEOBJECT_UP_EVENT.js +++ b/src/input/events/GAMEOBJECT_UP_EVENT.js @@ -26,7 +26,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_UP - * @type {string} + * @type {'gameobjectup'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAMEOBJECT_WHEEL_EVENT.js b/src/input/events/GAMEOBJECT_WHEEL_EVENT.js index 9a2906d914..b695274a57 100644 --- a/src/input/events/GAMEOBJECT_WHEEL_EVENT.js +++ b/src/input/events/GAMEOBJECT_WHEEL_EVENT.js @@ -26,7 +26,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#GAMEOBJECT_WHEEL - * @type {string} + * @type {'gameobjectwheel'} * @since 3.18.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/GAME_OUT_EVENT.js b/src/input/events/GAME_OUT_EVENT.js index 45fb334a85..4e1ee7e7ac 100644 --- a/src/input/events/GAME_OUT_EVENT.js +++ b/src/input/events/GAME_OUT_EVENT.js @@ -13,7 +13,7 @@ * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. * * @event Phaser.Input.Events#GAME_OUT - * @type {string} + * @type {'gameout'} * @since 3.16.1 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/input/events/GAME_OVER_EVENT.js b/src/input/events/GAME_OVER_EVENT.js index f1bdabebc5..9313baf46a 100644 --- a/src/input/events/GAME_OVER_EVENT.js +++ b/src/input/events/GAME_OVER_EVENT.js @@ -13,7 +13,7 @@ * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. * * @event Phaser.Input.Events#GAME_OVER - * @type {string} + * @type {'gameover'} * @since 3.16.1 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/input/events/MANAGER_BOOT_EVENT.js b/src/input/events/MANAGER_BOOT_EVENT.js index dfccb1cfb7..3320a8bc2a 100644 --- a/src/input/events/MANAGER_BOOT_EVENT.js +++ b/src/input/events/MANAGER_BOOT_EVENT.js @@ -10,7 +10,7 @@ * This internal event is dispatched by the Input Manager when it boots. * * @event Phaser.Input.Events#MANAGER_BOOT - * @type {string} + * @type {'boot'} * @since 3.0.0 */ module.exports = 'boot'; diff --git a/src/input/events/MANAGER_PROCESS_EVENT.js b/src/input/events/MANAGER_PROCESS_EVENT.js index 0601acf149..9ebfb7ad0d 100644 --- a/src/input/events/MANAGER_PROCESS_EVENT.js +++ b/src/input/events/MANAGER_PROCESS_EVENT.js @@ -11,7 +11,7 @@ * and it wants the Input Plugins to update themselves. * * @event Phaser.Input.Events#MANAGER_PROCESS - * @type {string} + * @type {'process'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/input/events/MANAGER_UPDATE_EVENT.js b/src/input/events/MANAGER_UPDATE_EVENT.js index 486cb7be27..9d89514339 100644 --- a/src/input/events/MANAGER_UPDATE_EVENT.js +++ b/src/input/events/MANAGER_UPDATE_EVENT.js @@ -10,7 +10,7 @@ * This internal event is dispatched by the Input Manager as part of its update step. * * @event Phaser.Input.Events#MANAGER_UPDATE - * @type {string} + * @type {'update'} * @since 3.0.0 */ module.exports = 'update'; diff --git a/src/input/events/POINTERLOCK_CHANGE_EVENT.js b/src/input/events/POINTERLOCK_CHANGE_EVENT.js index 2aadcf1276..ca6fb1fc08 100644 --- a/src/input/events/POINTERLOCK_CHANGE_EVENT.js +++ b/src/input/events/POINTERLOCK_CHANGE_EVENT.js @@ -10,7 +10,7 @@ * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. * * @event Phaser.Input.Events#POINTERLOCK_CHANGE - * @type {string} + * @type {'pointerlockchange'} * @since 3.0.0 * * @param {Event} event - The native DOM Event. diff --git a/src/input/events/POINTER_DOWN_EVENT.js b/src/input/events/POINTER_DOWN_EVENT.js index 39c3cc83d9..f1f1729b62 100644 --- a/src/input/events/POINTER_DOWN_EVENT.js +++ b/src/input/events/POINTER_DOWN_EVENT.js @@ -21,7 +21,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN - * @type {string} + * @type {'pointerdown'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js b/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js index 24b9505636..efaadd1bd6 100644 --- a/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js +++ b/src/input/events/POINTER_DOWN_OUTSIDE_EVENT.js @@ -21,7 +21,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#POINTER_DOWN_OUTSIDE - * @type {string} + * @type {'pointerdownoutside'} * @since 3.16.1 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/POINTER_MOVE_EVENT.js b/src/input/events/POINTER_MOVE_EVENT.js index d6d9f10ef3..762b0aea1c 100644 --- a/src/input/events/POINTER_MOVE_EVENT.js +++ b/src/input/events/POINTER_MOVE_EVENT.js @@ -21,7 +21,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#POINTER_MOVE - * @type {string} + * @type {'pointermove'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/POINTER_OUT_EVENT.js b/src/input/events/POINTER_OUT_EVENT.js index 612d504208..c8ed8e83d9 100644 --- a/src/input/events/POINTER_OUT_EVENT.js +++ b/src/input/events/POINTER_OUT_EVENT.js @@ -24,7 +24,7 @@ * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. * * @event Phaser.Input.Events#POINTER_OUT - * @type {string} + * @type {'pointerout'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/POINTER_OVER_EVENT.js b/src/input/events/POINTER_OVER_EVENT.js index 71b62d1a01..5e9e639f60 100644 --- a/src/input/events/POINTER_OVER_EVENT.js +++ b/src/input/events/POINTER_OVER_EVENT.js @@ -21,7 +21,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#POINTER_OVER - * @type {string} + * @type {'pointerover'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/POINTER_UP_EVENT.js b/src/input/events/POINTER_UP_EVENT.js index fefb69a5ee..d41c305315 100644 --- a/src/input/events/POINTER_UP_EVENT.js +++ b/src/input/events/POINTER_UP_EVENT.js @@ -21,7 +21,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP - * @type {string} + * @type {'pointerup'} * @since 3.0.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/POINTER_UP_OUTSIDE_EVENT.js b/src/input/events/POINTER_UP_OUTSIDE_EVENT.js index 42df93854b..305528e255 100644 --- a/src/input/events/POINTER_UP_OUTSIDE_EVENT.js +++ b/src/input/events/POINTER_UP_OUTSIDE_EVENT.js @@ -21,7 +21,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#POINTER_UP_OUTSIDE - * @type {string} + * @type {'pointerupoutside'} * @since 3.16.1 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/POINTER_WHEEL_EVENT.js b/src/input/events/POINTER_WHEEL_EVENT.js index a4bc240387..928fe67a07 100644 --- a/src/input/events/POINTER_WHEEL_EVENT.js +++ b/src/input/events/POINTER_WHEEL_EVENT.js @@ -21,7 +21,7 @@ * the propagation of this event. * * @event Phaser.Input.Events#POINTER_WHEEL - * @type {string} + * @type {'wheel'} * @since 3.18.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer responsible for triggering this event. diff --git a/src/input/events/PRE_UPDATE_EVENT.js b/src/input/events/PRE_UPDATE_EVENT.js index 59292b25d9..8c6f28161b 100644 --- a/src/input/events/PRE_UPDATE_EVENT.js +++ b/src/input/events/PRE_UPDATE_EVENT.js @@ -11,7 +11,7 @@ * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * * @event Phaser.Input.Events#PRE_UPDATE - * @type {string} + * @type {'preupdate'} * @since 3.0.0 */ module.exports = 'preupdate'; diff --git a/src/input/events/SHUTDOWN_EVENT.js b/src/input/events/SHUTDOWN_EVENT.js index 29eb8b9b1f..6fd0fff645 100644 --- a/src/input/events/SHUTDOWN_EVENT.js +++ b/src/input/events/SHUTDOWN_EVENT.js @@ -10,7 +10,7 @@ * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. * * @event Phaser.Input.Events#SHUTDOWN - * @type {string} + * @type {'shutdown'} * @since 3.0.0 */ module.exports = 'shutdown'; diff --git a/src/input/events/START_EVENT.js b/src/input/events/START_EVENT.js index cf8b8042fc..f18db7ad9f 100644 --- a/src/input/events/START_EVENT.js +++ b/src/input/events/START_EVENT.js @@ -11,7 +11,7 @@ * signalling to all of its internal systems to start. * * @event Phaser.Input.Events#START - * @type {string} + * @type {'start'} * @since 3.0.0 */ module.exports = 'start'; diff --git a/src/input/events/UPDATE_EVENT.js b/src/input/events/UPDATE_EVENT.js index 60145fa4b0..70c7c1832c 100644 --- a/src/input/events/UPDATE_EVENT.js +++ b/src/input/events/UPDATE_EVENT.js @@ -11,7 +11,7 @@ * This hook is designed specifically for input plugins, but can also be listened to from user-land code. * * @event Phaser.Input.Events#UPDATE - * @type {string} + * @type {'update'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/input/gamepad/events/BUTTON_DOWN_EVENT.js b/src/input/gamepad/events/BUTTON_DOWN_EVENT.js index 00f719ca6b..360075969e 100644 --- a/src/input/gamepad/events/BUTTON_DOWN_EVENT.js +++ b/src/input/gamepad/events/BUTTON_DOWN_EVENT.js @@ -14,7 +14,7 @@ * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_DOWN - * @type {string} + * @type {'down'} * @since 3.10.0 * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was pressed. diff --git a/src/input/gamepad/events/BUTTON_UP_EVENT.js b/src/input/gamepad/events/BUTTON_UP_EVENT.js index 23717632ae..e1910c33c7 100644 --- a/src/input/gamepad/events/BUTTON_UP_EVENT.js +++ b/src/input/gamepad/events/BUTTON_UP_EVENT.js @@ -14,7 +14,7 @@ * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#BUTTON_UP - * @type {string} + * @type {'up'} * @since 3.10.0 * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad on which the button was released. diff --git a/src/input/gamepad/events/CONNECTED_EVENT.js b/src/input/gamepad/events/CONNECTED_EVENT.js index 9e7a4ca398..8cebfecbb3 100644 --- a/src/input/gamepad/events/CONNECTED_EVENT.js +++ b/src/input/gamepad/events/CONNECTED_EVENT.js @@ -17,7 +17,7 @@ * already connected. * * @event Phaser.Input.Gamepad.Events#CONNECTED - * @type {string} + * @type {'connected'} * @since 3.0.0 * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was connected. diff --git a/src/input/gamepad/events/DISCONNECTED_EVENT.js b/src/input/gamepad/events/DISCONNECTED_EVENT.js index 82bdb4ee93..88e637f7e6 100644 --- a/src/input/gamepad/events/DISCONNECTED_EVENT.js +++ b/src/input/gamepad/events/DISCONNECTED_EVENT.js @@ -12,7 +12,7 @@ * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. * * @event Phaser.Input.Gamepad.Events#DISCONNECTED - * @type {string} + * @type {'disconnected'} * @since 3.0.0 * * @param {Phaser.Input.Gamepad} pad - A reference to the Gamepad which was disconnected. diff --git a/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js b/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js index e3b36a9772..3d22f6ea75 100644 --- a/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js +++ b/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js @@ -17,7 +17,7 @@ * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN - * @type {string} + * @type {'down'} * @since 3.10.0 * * @param {number} index - The index of the button that was pressed. diff --git a/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js b/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js index 5c6147a9b2..920958b298 100644 --- a/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js +++ b/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js @@ -17,7 +17,7 @@ * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. * * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP - * @type {string} + * @type {'up'} * @since 3.10.0 * * @param {number} index - The index of the button that was released. diff --git a/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js b/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js index 7a0c3b9e4e..ef9ab29896 100644 --- a/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js +++ b/src/input/keyboard/events/ANY_KEY_DOWN_EVENT.js @@ -23,7 +23,7 @@ * There are others. So, please check your extensions if you find you have specific keys that don't work. * * @event Phaser.Input.Keyboard.Events#ANY_KEY_DOWN - * @type {string} + * @type {'keydown'} * @since 3.0.0 * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was pressed, any modifiers, etc. diff --git a/src/input/keyboard/events/ANY_KEY_UP_EVENT.js b/src/input/keyboard/events/ANY_KEY_UP_EVENT.js index b97553c036..f0325efbe9 100644 --- a/src/input/keyboard/events/ANY_KEY_UP_EVENT.js +++ b/src/input/keyboard/events/ANY_KEY_UP_EVENT.js @@ -16,7 +16,7 @@ * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. * * @event Phaser.Input.Keyboard.Events#ANY_KEY_UP - * @type {string} + * @type {'keyup'} * @since 3.0.0 * * @param {KeyboardEvent} event - The native DOM Keyboard Event. You can inspect this to learn more about the key that was released, any modifiers, etc. diff --git a/src/input/keyboard/events/COMBO_MATCH_EVENT.js b/src/input/keyboard/events/COMBO_MATCH_EVENT.js index f96319b684..611fa89040 100644 --- a/src/input/keyboard/events/COMBO_MATCH_EVENT.js +++ b/src/input/keyboard/events/COMBO_MATCH_EVENT.js @@ -20,7 +20,7 @@ * ``` * * @event Phaser.Input.Keyboard.Events#COMBO_MATCH - * @type {string} + * @type {'keycombomatch'} * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyCombo} keycombo - The Key Combo object that was matched. diff --git a/src/input/keyboard/events/DOWN_EVENT.js b/src/input/keyboard/events/DOWN_EVENT.js index 4d4da5399e..fd101604fa 100644 --- a/src/input/keyboard/events/DOWN_EVENT.js +++ b/src/input/keyboard/events/DOWN_EVENT.js @@ -20,7 +20,7 @@ * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. * * @event Phaser.Input.Keyboard.Events#DOWN - * @type {string} + * @type {'down'} * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was pressed. diff --git a/src/input/keyboard/events/UP_EVENT.js b/src/input/keyboard/events/UP_EVENT.js index 52a8702897..7bfb9aa1c3 100644 --- a/src/input/keyboard/events/UP_EVENT.js +++ b/src/input/keyboard/events/UP_EVENT.js @@ -20,7 +20,7 @@ * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. * * @event Phaser.Input.Keyboard.Events#UP - * @type {string} + * @type {'up'} * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object that was released. diff --git a/src/loader/events/ADD_EVENT.js b/src/loader/events/ADD_EVENT.js index 4bfb14719b..f12d8df08a 100644 --- a/src/loader/events/ADD_EVENT.js +++ b/src/loader/events/ADD_EVENT.js @@ -14,7 +14,7 @@ * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. * * @event Phaser.Loader.Events#ADD - * @type {string} + * @type {'addfile'} * @since 3.0.0 * * @param {string} key - The unique key of the file that was added to the Loader. diff --git a/src/loader/events/COMPLETE_EVENT.js b/src/loader/events/COMPLETE_EVENT.js index 1d38b56f24..907dedbc79 100644 --- a/src/loader/events/COMPLETE_EVENT.js +++ b/src/loader/events/COMPLETE_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.load.on('complete', listener)`. * * @event Phaser.Loader.Events#COMPLETE - * @type {string} + * @type {'complete'} * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. diff --git a/src/loader/events/FILE_COMPLETE_EVENT.js b/src/loader/events/FILE_COMPLETE_EVENT.js index 7d6f0a92e8..f4ff63bd01 100644 --- a/src/loader/events/FILE_COMPLETE_EVENT.js +++ b/src/loader/events/FILE_COMPLETE_EVENT.js @@ -16,7 +16,7 @@ * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. * * @event Phaser.Loader.Events#FILE_COMPLETE - * @type {string} + * @type {'filecomplete'} * @since 3.0.0 * * @param {string} key - The key of the file that just loaded and finished processing. diff --git a/src/loader/events/FILE_LOAD_ERROR_EVENT.js b/src/loader/events/FILE_LOAD_ERROR_EVENT.js index b0599af5b5..e5350f7d52 100644 --- a/src/loader/events/FILE_LOAD_ERROR_EVENT.js +++ b/src/loader/events/FILE_LOAD_ERROR_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. * * @event Phaser.Loader.Events#FILE_LOAD_ERROR - * @type {string} + * @type {'loaderror'} * @since 3.0.0 * * @param {Phaser.Loader.File} file - A reference to the File which errored during load. diff --git a/src/loader/events/FILE_LOAD_EVENT.js b/src/loader/events/FILE_LOAD_EVENT.js index 872fb942dd..d6347e4717 100644 --- a/src/loader/events/FILE_LOAD_EVENT.js +++ b/src/loader/events/FILE_LOAD_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.load.on('load', listener)`. * * @event Phaser.Loader.Events#FILE_LOAD - * @type {string} + * @type {'load'} * @since 3.0.0 * * @param {Phaser.Loader.File} file - A reference to the File which just finished loading. diff --git a/src/loader/events/FILE_PROGRESS_EVENT.js b/src/loader/events/FILE_PROGRESS_EVENT.js index 3a1168e86e..733bf5ec51 100644 --- a/src/loader/events/FILE_PROGRESS_EVENT.js +++ b/src/loader/events/FILE_PROGRESS_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. * * @event Phaser.Loader.Events#FILE_PROGRESS - * @type {string} + * @type {'fileprogress'} * @since 3.0.0 * * @param {Phaser.Loader.File} file - A reference to the File for which progress has been updated. diff --git a/src/loader/events/POST_PROCESS_EVENT.js b/src/loader/events/POST_PROCESS_EVENT.js index 7edd4eed07..9c15c2c430 100644 --- a/src/loader/events/POST_PROCESS_EVENT.js +++ b/src/loader/events/POST_PROCESS_EVENT.js @@ -16,7 +16,7 @@ * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. * * @event Phaser.Loader.Events#POST_PROCESS - * @type {string} + * @type {'postprocess'} * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. diff --git a/src/loader/events/PROGRESS_EVENT.js b/src/loader/events/PROGRESS_EVENT.js index 77f2948aad..9fbd41304a 100644 --- a/src/loader/events/PROGRESS_EVENT.js +++ b/src/loader/events/PROGRESS_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using: `this.load.on('progress', listener)`. * * @event Phaser.Loader.Events#PROGRESS - * @type {string} + * @type {'progress'} * @since 3.0.0 * * @param {number} progress - The current progress of the load. A value between 0 and 1. diff --git a/src/loader/events/START_EVENT.js b/src/loader/events/START_EVENT.js index fcfe0c82a3..d1c9b91024 100644 --- a/src/loader/events/START_EVENT.js +++ b/src/loader/events/START_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using: `this.load.on('start', listener)`. * * @event Phaser.Loader.Events#START - * @type {string} + * @type {'start'} * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. diff --git a/src/physics/arcade/events/COLLIDE_EVENT.js b/src/physics/arcade/events/COLLIDE_EVENT.js index e682a5cc64..6b052235ae 100644 --- a/src/physics/arcade/events/COLLIDE_EVENT.js +++ b/src/physics/arcade/events/COLLIDE_EVENT.js @@ -17,7 +17,7 @@ * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#COLLIDE - * @type {string} + * @type {'collide'} * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the collision. This is the parent of `body1`. diff --git a/src/physics/arcade/events/OVERLAP_EVENT.js b/src/physics/arcade/events/OVERLAP_EVENT.js index 8efb0a4cb1..04e57fb630 100644 --- a/src/physics/arcade/events/OVERLAP_EVENT.js +++ b/src/physics/arcade/events/OVERLAP_EVENT.js @@ -17,7 +17,7 @@ * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#OVERLAP - * @type {string} + * @type {'overlap'} * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} gameObject1 - The first Game Object involved in the overlap. This is the parent of `body1`. diff --git a/src/physics/arcade/events/PAUSE_EVENT.js b/src/physics/arcade/events/PAUSE_EVENT.js index e059ddc7a2..5b1870cd1a 100644 --- a/src/physics/arcade/events/PAUSE_EVENT.js +++ b/src/physics/arcade/events/PAUSE_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. * * @event Phaser.Physics.Arcade.Events#PAUSE - * @type {string} + * @type {'pause'} * @since 3.0.0 */ module.exports = 'pause'; diff --git a/src/physics/arcade/events/RESUME_EVENT.js b/src/physics/arcade/events/RESUME_EVENT.js index 66cb557088..0ef47ab6f8 100644 --- a/src/physics/arcade/events/RESUME_EVENT.js +++ b/src/physics/arcade/events/RESUME_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. * * @event Phaser.Physics.Arcade.Events#RESUME - * @type {string} + * @type {'resume'} * @since 3.0.0 */ module.exports = 'resume'; diff --git a/src/physics/arcade/events/TILE_COLLIDE_EVENT.js b/src/physics/arcade/events/TILE_COLLIDE_EVENT.js index c8d2057ba8..0be00fb719 100644 --- a/src/physics/arcade/events/TILE_COLLIDE_EVENT.js +++ b/src/physics/arcade/events/TILE_COLLIDE_EVENT.js @@ -17,7 +17,7 @@ * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_COLLIDE - * @type {string} + * @type {'tilecollide'} * @since 3.16.1 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the collision. This is the parent of `body`. diff --git a/src/physics/arcade/events/TILE_OVERLAP_EVENT.js b/src/physics/arcade/events/TILE_OVERLAP_EVENT.js index 3fc732d85a..0e456fbeab 100644 --- a/src/physics/arcade/events/TILE_OVERLAP_EVENT.js +++ b/src/physics/arcade/events/TILE_OVERLAP_EVENT.js @@ -17,7 +17,7 @@ * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. * * @event Phaser.Physics.Arcade.Events#TILE_OVERLAP - * @type {string} + * @type {'tileoverlap'} * @since 3.16.1 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object involved in the overlap. This is the parent of `body`. diff --git a/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js b/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js index d5e8b803ea..58d09865b4 100644 --- a/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js +++ b/src/physics/arcade/events/WORLD_BOUNDS_EVENT.js @@ -15,7 +15,7 @@ * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_BOUNDS - * @type {string} + * @type {'worldbounds'} * @since 3.0.0 * * @param {Phaser.Physics.Arcade.Body} body - The Arcade Physics Body that hit the world bounds. diff --git a/src/physics/arcade/events/WORLD_STEP_EVENT.js b/src/physics/arcade/events/WORLD_STEP_EVENT.js index ef7002f256..696186cd5a 100644 --- a/src/physics/arcade/events/WORLD_STEP_EVENT.js +++ b/src/physics/arcade/events/WORLD_STEP_EVENT.js @@ -15,7 +15,7 @@ * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_STEP - * @type {string} + * @type {'worldstep'} * @since 3.18.0 * * @param {number} delta - The delta time amount of this step, in seconds. diff --git a/src/physics/matter-js/events/AFTER_ADD_EVENT.js b/src/physics/matter-js/events/AFTER_ADD_EVENT.js index 734a4bd27e..ee1a171ac9 100644 --- a/src/physics/matter-js/events/AFTER_ADD_EVENT.js +++ b/src/physics/matter-js/events/AFTER_ADD_EVENT.js @@ -21,7 +21,7 @@ * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_ADD - * @type {string} + * @type {'afteradd'} * @since 3.22.0 * * @param {Phaser.Physics.Matter.Events.AfterAddEvent} event - The Add Event object. diff --git a/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js b/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js index 5e473c65d0..4f6a219105 100644 --- a/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js +++ b/src/physics/matter-js/events/AFTER_REMOVE_EVENT.js @@ -21,7 +21,7 @@ * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_REMOVE - * @type {string} + * @type {'afterremove'} * @since 3.22.0 * * @param {Phaser.Physics.Matter.Events.AfterRemoveEvent} event - The Remove Event object. diff --git a/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js b/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js index a7109aadc1..ee87616718 100644 --- a/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js +++ b/src/physics/matter-js/events/AFTER_UPDATE_EVENT.js @@ -20,7 +20,7 @@ * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. * * @event Phaser.Physics.Matter.Events#AFTER_UPDATE - * @type {string} + * @type {'afterupdate'} * @since 3.0.0 * * @param {Phaser.Physics.Matter.Events.AfterUpdateEvent} event - The Update Event object. diff --git a/src/physics/matter-js/events/BEFORE_ADD_EVENT.js b/src/physics/matter-js/events/BEFORE_ADD_EVENT.js index c713b98083..b0e650c462 100644 --- a/src/physics/matter-js/events/BEFORE_ADD_EVENT.js +++ b/src/physics/matter-js/events/BEFORE_ADD_EVENT.js @@ -21,7 +21,7 @@ * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_ADD - * @type {string} + * @type {'beforeadd'} * @since 3.22.0 * * @param {Phaser.Physics.Matter.Events.BeforeAddEvent} event - The Add Event object. diff --git a/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js b/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js index 9df15b4660..7770ce4e33 100644 --- a/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js +++ b/src/physics/matter-js/events/BEFORE_REMOVE_EVENT.js @@ -21,7 +21,7 @@ * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_REMOVE - * @type {string} + * @type {'beforeremove'} * @since 3.22.0 * * @param {Phaser.Physics.Matter.Events.BeforeRemoveEvent} event - The Remove Event object. diff --git a/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js b/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js index 85298e8ecc..72d26967f3 100644 --- a/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js +++ b/src/physics/matter-js/events/BEFORE_UPDATE_EVENT.js @@ -20,7 +20,7 @@ * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. * * @event Phaser.Physics.Matter.Events#BEFORE_UPDATE - * @type {string} + * @type {'beforeupdate'} * @since 3.0.0 * * @param {Phaser.Physics.Matter.Events.BeforeUpdateEvent} event - The Update Event object. diff --git a/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js b/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js index bda63001ee..ae1d84e5c3 100644 --- a/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js +++ b/src/physics/matter-js/events/COLLISION_ACTIVE_EVENT.js @@ -22,7 +22,7 @@ * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_ACTIVE - * @type {string} + * @type {'collisionactive'} * @since 3.0.0 * * @param {Phaser.Physics.Matter.Events.CollisionActiveEvent} event - The Collision Event object. diff --git a/src/physics/matter-js/events/COLLISION_END_EVENT.js b/src/physics/matter-js/events/COLLISION_END_EVENT.js index e42e9d4d8b..d93d6df461 100644 --- a/src/physics/matter-js/events/COLLISION_END_EVENT.js +++ b/src/physics/matter-js/events/COLLISION_END_EVENT.js @@ -22,7 +22,7 @@ * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_END - * @type {string} + * @type {'collisionend'} * @since 3.0.0 * * @param {Phaser.Physics.Matter.Events.CollisionEndEvent} event - The Collision Event object. diff --git a/src/physics/matter-js/events/COLLISION_START_EVENT.js b/src/physics/matter-js/events/COLLISION_START_EVENT.js index 8402e62022..ddcd32d130 100644 --- a/src/physics/matter-js/events/COLLISION_START_EVENT.js +++ b/src/physics/matter-js/events/COLLISION_START_EVENT.js @@ -22,7 +22,7 @@ * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. * * @event Phaser.Physics.Matter.Events#COLLISION_START - * @type {string} + * @type {'collisionstart'} * @since 3.0.0 * * @param {Phaser.Physics.Matter.Events.CollisionStartEvent} event - The Collision Event object. diff --git a/src/physics/matter-js/events/DRAG_END_EVENT.js b/src/physics/matter-js/events/DRAG_END_EVENT.js index 05ad901286..6cd3f09699 100644 --- a/src/physics/matter-js/events/DRAG_END_EVENT.js +++ b/src/physics/matter-js/events/DRAG_END_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG_END - * @type {string} + * @type {'dragend'} * @since 3.16.2 * * @param {MatterJS.BodyType} body - The Body that has stopped being dragged. This is a Matter Body, not a Phaser Game Object. diff --git a/src/physics/matter-js/events/DRAG_EVENT.js b/src/physics/matter-js/events/DRAG_EVENT.js index c7f5ff0c78..b8a5058d40 100644 --- a/src/physics/matter-js/events/DRAG_EVENT.js +++ b/src/physics/matter-js/events/DRAG_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG - * @type {string} + * @type {'drag'} * @since 3.16.2 * * @param {MatterJS.BodyType} body - The Body that is being dragged. This is a Matter Body, not a Phaser Game Object. diff --git a/src/physics/matter-js/events/DRAG_START_EVENT.js b/src/physics/matter-js/events/DRAG_START_EVENT.js index 74683770e6..8b0eac42c2 100644 --- a/src/physics/matter-js/events/DRAG_START_EVENT.js +++ b/src/physics/matter-js/events/DRAG_START_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG_START - * @type {string} + * @type {'dragstart'} * @since 3.16.2 * * @param {MatterJS.BodyType} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object. diff --git a/src/physics/matter-js/events/PAUSE_EVENT.js b/src/physics/matter-js/events/PAUSE_EVENT.js index 29b16e1ea6..765b467132 100644 --- a/src/physics/matter-js/events/PAUSE_EVENT.js +++ b/src/physics/matter-js/events/PAUSE_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. * * @event Phaser.Physics.Matter.Events#PAUSE - * @type {string} + * @type {'pause'} * @since 3.0.0 */ module.exports = 'pause'; diff --git a/src/physics/matter-js/events/RESUME_EVENT.js b/src/physics/matter-js/events/RESUME_EVENT.js index 3ace527ae9..878177d0ae 100644 --- a/src/physics/matter-js/events/RESUME_EVENT.js +++ b/src/physics/matter-js/events/RESUME_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. * * @event Phaser.Physics.Matter.Events#RESUME - * @type {string} + * @type {'resume'} * @since 3.0.0 */ module.exports = 'resume'; diff --git a/src/physics/matter-js/events/SLEEP_END_EVENT.js b/src/physics/matter-js/events/SLEEP_END_EVENT.js index 94b052d0bd..b266ad7964 100644 --- a/src/physics/matter-js/events/SLEEP_END_EVENT.js +++ b/src/physics/matter-js/events/SLEEP_END_EVENT.js @@ -19,7 +19,7 @@ * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. * * @event Phaser.Physics.Matter.Events#SLEEP_END - * @type {string} + * @type {'sleepend'} * @since 3.0.0 * * @param {Phaser.Physics.Matter.Events.SleepEndEvent} event - The Sleep Event object. diff --git a/src/physics/matter-js/events/SLEEP_START_EVENT.js b/src/physics/matter-js/events/SLEEP_START_EVENT.js index d12b96482a..8c3de1d1cb 100644 --- a/src/physics/matter-js/events/SLEEP_START_EVENT.js +++ b/src/physics/matter-js/events/SLEEP_START_EVENT.js @@ -19,7 +19,7 @@ * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. * * @event Phaser.Physics.Matter.Events#SLEEP_START - * @type {string} + * @type {'sleepstart'} * @since 3.0.0 * * @param {Phaser.Physics.Matter.Events.SleepStartEvent} event - The Sleep Event object. diff --git a/src/renderer/events/LOSE_WEBGL_EVENT.js b/src/renderer/events/LOSE_WEBGL_EVENT.js index cf7c4934a3..61255b3d77 100644 --- a/src/renderer/events/LOSE_WEBGL_EVENT.js +++ b/src/renderer/events/LOSE_WEBGL_EVENT.js @@ -22,7 +22,7 @@ * it is safe to continue. * * @event Phaser.Renderer.Events#LOSE_WEBGL - * @type {string} + * @type {'losewebgl'} * @since 3.80.0 * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - the renderer that owns the WebGL context diff --git a/src/renderer/events/POST_RENDER_EVENT.js b/src/renderer/events/POST_RENDER_EVENT.js index dcfaf51f54..a5b1c86a94 100644 --- a/src/renderer/events/POST_RENDER_EVENT.js +++ b/src/renderer/events/POST_RENDER_EVENT.js @@ -11,7 +11,7 @@ * has completed, but before any pending snapshots have been taken. * * @event Phaser.Renderer.Events#POST_RENDER - * @type {string} + * @type {'postrender'} * @since 3.50.0 */ module.exports = 'postrender'; diff --git a/src/renderer/events/PRE_RENDER_CLEAR_EVENT.js b/src/renderer/events/PRE_RENDER_CLEAR_EVENT.js index 16fb3c6df0..378644074a 100644 --- a/src/renderer/events/PRE_RENDER_CLEAR_EVENT.js +++ b/src/renderer/events/PRE_RENDER_CLEAR_EVENT.js @@ -10,17 +10,17 @@ * This event is dispatched by the Phaser Renderer. It happens at the start of the render step, before * the WebGL gl.clear function has been called. This allows you to toggle the `config.clearBeforeRender` property * as required, to have fine-grained control over when the canvas is cleared during rendering. - * + * * Listen to it from within a Scene using: `this.renderer.events.on('prerenderclear', listener)`. - * + * * It's very important to understand that this event is called _before_ the scissor and mask stacks are cleared. * This means you should not use this event to modify the scissor or mask. Instead, use the `prerender` event for that. - * + * * If using the Canvas Renderer, this event is dispatched before the canvas is cleared, but after the context globalAlpha * and transform have been reset. * * @event Phaser.Renderer.Events#PRE_RENDER_CLEAR - * @type {string} + * @type {'prerenderclear'} * @since 3.85.0 */ module.exports = 'prerenderclear'; diff --git a/src/renderer/events/PRE_RENDER_EVENT.js b/src/renderer/events/PRE_RENDER_EVENT.js index ac7c5c9834..5deb4f053d 100644 --- a/src/renderer/events/PRE_RENDER_EVENT.js +++ b/src/renderer/events/PRE_RENDER_EVENT.js @@ -12,7 +12,7 @@ * reset ready for the render. * * @event Phaser.Renderer.Events#PRE_RENDER - * @type {string} + * @type {'prerender'} * @since 3.50.0 */ module.exports = 'prerender'; diff --git a/src/renderer/events/RENDER_EVENT.js b/src/renderer/events/RENDER_EVENT.js index b20604e98b..97043bc4ba 100644 --- a/src/renderer/events/RENDER_EVENT.js +++ b/src/renderer/events/RENDER_EVENT.js @@ -12,7 +12,7 @@ * It is dispatched before any of the children in the Scene have been rendered. * * @event Phaser.Renderer.Events#RENDER - * @type {string} + * @type {'render'} * @since 3.50.0 * * @param {Phaser.Scene} scene - The Scene being rendered. diff --git a/src/renderer/events/RESIZE_EVENT.js b/src/renderer/events/RESIZE_EVENT.js index 3dc3ea66c5..82e9915d2c 100644 --- a/src/renderer/events/RESIZE_EVENT.js +++ b/src/renderer/events/RESIZE_EVENT.js @@ -11,7 +11,7 @@ * of the Scale Manager resizing. * * @event Phaser.Renderer.Events#RESIZE - * @type {string} + * @type {'resize'} * @since 3.50.0 * * @param {number} width - The new width of the renderer. diff --git a/src/renderer/events/RESTORE_WEBGL_EVENT.js b/src/renderer/events/RESTORE_WEBGL_EVENT.js index 06b31b4f6c..20122c5619 100644 --- a/src/renderer/events/RESTORE_WEBGL_EVENT.js +++ b/src/renderer/events/RESTORE_WEBGL_EVENT.js @@ -25,7 +25,7 @@ * re-creating any resources of your own. * * @event Phaser.Renderer.Events#RESTORE_WEBGL - * @type {string} + * @type {'restorewebgl'} * @since 3.80.0 * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - the renderer that owns the WebGL context diff --git a/src/scale/events/ENTER_FULLSCREEN_EVENT.js b/src/scale/events/ENTER_FULLSCREEN_EVENT.js index 7058240e60..52a86357b2 100644 --- a/src/scale/events/ENTER_FULLSCREEN_EVENT.js +++ b/src/scale/events/ENTER_FULLSCREEN_EVENT.js @@ -8,7 +8,7 @@ * The Scale Manager has successfully entered fullscreen mode. * * @event Phaser.Scale.Events#ENTER_FULLSCREEN - * @type {string} + * @type {'enterfullscreen'} * @since 3.16.1 */ module.exports = 'enterfullscreen'; diff --git a/src/scale/events/FULLSCREEN_FAILED_EVENT.js b/src/scale/events/FULLSCREEN_FAILED_EVENT.js index 4decf628e5..cdca129084 100644 --- a/src/scale/events/FULLSCREEN_FAILED_EVENT.js +++ b/src/scale/events/FULLSCREEN_FAILED_EVENT.js @@ -8,7 +8,7 @@ * The Scale Manager tried to enter fullscreen mode but failed. * * @event Phaser.Scale.Events#FULLSCREEN_FAILED - * @type {string} + * @type {'fullscreenfailed'} * @since 3.17.0 */ module.exports = 'fullscreenfailed'; diff --git a/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js b/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js index 78d8b0d687..10620e09b0 100644 --- a/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js +++ b/src/scale/events/FULLSCREEN_UNSUPPORTED_EVENT.js @@ -8,7 +8,7 @@ * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser. * * @event Phaser.Scale.Events#FULLSCREEN_UNSUPPORTED - * @type {string} + * @type {'fullscreenunsupported'} * @since 3.16.1 */ module.exports = 'fullscreenunsupported'; diff --git a/src/scale/events/LEAVE_FULLSCREEN_EVENT.js b/src/scale/events/LEAVE_FULLSCREEN_EVENT.js index 3857d99b1c..86c6d5504e 100644 --- a/src/scale/events/LEAVE_FULLSCREEN_EVENT.js +++ b/src/scale/events/LEAVE_FULLSCREEN_EVENT.js @@ -9,7 +9,7 @@ * or via a user gestured, such as pressing the ESC key. * * @event Phaser.Scale.Events#LEAVE_FULLSCREEN - * @type {string} + * @type {'leavefullscreen'} * @since 3.16.1 */ module.exports = 'leavefullscreen'; diff --git a/src/scale/events/ORIENTATION_CHANGE_EVENT.js b/src/scale/events/ORIENTATION_CHANGE_EVENT.js index 0ee69b8dfe..498b353c98 100644 --- a/src/scale/events/ORIENTATION_CHANGE_EVENT.js +++ b/src/scale/events/ORIENTATION_CHANGE_EVENT.js @@ -10,7 +10,7 @@ * This event is dispatched whenever the Scale Manager detects an orientation change event from the browser. * * @event Phaser.Scale.Events#ORIENTATION_CHANGE - * @type {string} + * @type {'orientationchange'} * @since 3.16.1 * * @param {string} orientation - The new orientation value. Either `Phaser.Scale.Orientation.LANDSCAPE` or `Phaser.Scale.Orientation.PORTRAIT`. diff --git a/src/scale/events/RESIZE_EVENT.js b/src/scale/events/RESIZE_EVENT.js index 58fc3eb6b0..243cc64a24 100644 --- a/src/scale/events/RESIZE_EVENT.js +++ b/src/scale/events/RESIZE_EVENT.js @@ -13,7 +13,7 @@ * scaling your own game content. * * @event Phaser.Scale.Events#RESIZE - * @type {string} + * @type {'resize'} * @since 3.16.1 * * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. diff --git a/src/scene/events/ADDED_TO_SCENE_EVENT.js b/src/scene/events/ADDED_TO_SCENE_EVENT.js index b4afd1e724..e7eea96a1d 100644 --- a/src/scene/events/ADDED_TO_SCENE_EVENT.js +++ b/src/scene/events/ADDED_TO_SCENE_EVENT.js @@ -12,7 +12,7 @@ * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. * * @event Phaser.Scenes.Events#ADDED_TO_SCENE - * @type {string} + * @type {'addedtoscene'} * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene. diff --git a/src/scene/events/BOOT_EVENT.js b/src/scene/events/BOOT_EVENT.js index e985b1919c..f4dae82125 100644 --- a/src/scene/events/BOOT_EVENT.js +++ b/src/scene/events/BOOT_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using `this.events.on('boot', listener)`. * * @event Phaser.Scenes.Events#BOOT - * @type {string} + * @type {'boot'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/CREATE_EVENT.js b/src/scene/events/CREATE_EVENT.js index 1aa0c02444..cb4b76a6b1 100644 --- a/src/scene/events/CREATE_EVENT.js +++ b/src/scene/events/CREATE_EVENT.js @@ -16,7 +16,7 @@ * Listen to it from a Scene using `this.events.on('create', listener)`. * * @event Phaser.Scenes.Events#CREATE - * @type {string} + * @type {'create'} * @since 3.17.0 * * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event. diff --git a/src/scene/events/DESTROY_EVENT.js b/src/scene/events/DESTROY_EVENT.js index 14062516cb..8249acb40d 100644 --- a/src/scene/events/DESTROY_EVENT.js +++ b/src/scene/events/DESTROY_EVENT.js @@ -14,7 +14,7 @@ * You should destroy any resources that may be in use by your Scene in this event handler. * * @event Phaser.Scenes.Events#DESTROY - * @type {string} + * @type {'destroy'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/PAUSE_EVENT.js b/src/scene/events/PAUSE_EVENT.js index 7bf36f8bd4..77e3abff3a 100644 --- a/src/scene/events/PAUSE_EVENT.js +++ b/src/scene/events/PAUSE_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using `this.events.on('pause', listener)`. * * @event Phaser.Scenes.Events#PAUSE - * @type {string} + * @type {'pause'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/POST_UPDATE_EVENT.js b/src/scene/events/POST_UPDATE_EVENT.js index c46bdf977c..0b6d0c24a4 100644 --- a/src/scene/events/POST_UPDATE_EVENT.js +++ b/src/scene/events/POST_UPDATE_EVENT.js @@ -23,7 +23,7 @@ * A Scene will only run its step if it is active. * * @event Phaser.Scenes.Events#POST_UPDATE - * @type {string} + * @type {'postupdate'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/scene/events/PRE_RENDER_EVENT.js b/src/scene/events/PRE_RENDER_EVENT.js index c8cdbedacd..fdf6dcc441 100644 --- a/src/scene/events/PRE_RENDER_EVENT.js +++ b/src/scene/events/PRE_RENDER_EVENT.js @@ -25,7 +25,7 @@ * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. * * @event Phaser.Scenes.Events#PRE_RENDER - * @type {string} + * @type {'prerender'} * @since 3.53.0 * * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. diff --git a/src/scene/events/PRE_UPDATE_EVENT.js b/src/scene/events/PRE_UPDATE_EVENT.js index 902940099d..29f591b3f2 100644 --- a/src/scene/events/PRE_UPDATE_EVENT.js +++ b/src/scene/events/PRE_UPDATE_EVENT.js @@ -23,7 +23,7 @@ * A Scene will only run its step if it is active. * * @event Phaser.Scenes.Events#PRE_UPDATE - * @type {string} + * @type {'preupdate'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/scene/events/READY_EVENT.js b/src/scene/events/READY_EVENT.js index 7bf1d9a6a4..dd342394f7 100644 --- a/src/scene/events/READY_EVENT.js +++ b/src/scene/events/READY_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using `this.events.on('ready', listener)`. * * @event Phaser.Scenes.Events#READY - * @type {string} + * @type {'ready'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/REMOVED_FROM_SCENE_EVENT.js b/src/scene/events/REMOVED_FROM_SCENE_EVENT.js index 31670fc477..8e9649eeaf 100644 --- a/src/scene/events/REMOVED_FROM_SCENE_EVENT.js +++ b/src/scene/events/REMOVED_FROM_SCENE_EVENT.js @@ -12,7 +12,7 @@ * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. * * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE - * @type {string} + * @type {'removedfromscene'} * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene. diff --git a/src/scene/events/RENDER_EVENT.js b/src/scene/events/RENDER_EVENT.js index b6681a906e..30e93ca309 100644 --- a/src/scene/events/RENDER_EVENT.js +++ b/src/scene/events/RENDER_EVENT.js @@ -25,7 +25,7 @@ * By the time this event is dispatched, the Scene will have already been rendered. * * @event Phaser.Scenes.Events#RENDER - * @type {string} + * @type {'render'} * @since 3.0.0 * * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene. diff --git a/src/scene/events/RESUME_EVENT.js b/src/scene/events/RESUME_EVENT.js index d69b42ce6f..9f9772c792 100644 --- a/src/scene/events/RESUME_EVENT.js +++ b/src/scene/events/RESUME_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using `this.events.on('resume', listener)`. * * @event Phaser.Scenes.Events#RESUME - * @type {string} + * @type {'resume'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/SHUTDOWN_EVENT.js b/src/scene/events/SHUTDOWN_EVENT.js index 9d7273423a..87fb10bcf2 100644 --- a/src/scene/events/SHUTDOWN_EVENT.js +++ b/src/scene/events/SHUTDOWN_EVENT.js @@ -16,7 +16,7 @@ * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. * * @event Phaser.Scenes.Events#SHUTDOWN - * @type {string} + * @type {'shutdown'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/SLEEP_EVENT.js b/src/scene/events/SLEEP_EVENT.js index f4916350f0..1f0c578701 100644 --- a/src/scene/events/SLEEP_EVENT.js +++ b/src/scene/events/SLEEP_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using `this.events.on('sleep', listener)`. * * @event Phaser.Scenes.Events#SLEEP - * @type {string} + * @type {'sleep'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/START_EVENT.js b/src/scene/events/START_EVENT.js index bd8b4ab845..17d15391f2 100644 --- a/src/scene/events/START_EVENT.js +++ b/src/scene/events/START_EVENT.js @@ -12,7 +12,7 @@ * Listen to it from a Scene using `this.events.on('start', listener)`. * * @event Phaser.Scenes.Events#START - * @type {string} + * @type {'start'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/scene/events/TRANSITION_COMPLETE_EVENT.js b/src/scene/events/TRANSITION_COMPLETE_EVENT.js index 62b60d3992..140b99fa67 100644 --- a/src/scene/events/TRANSITION_COMPLETE_EVENT.js +++ b/src/scene/events/TRANSITION_COMPLETE_EVENT.js @@ -23,7 +23,7 @@ * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. * * @event Phaser.Scenes.Events#TRANSITION_COMPLETE - * @type {string} + * @type {'transitioncomplete'} * @since 3.5.0 * * @param {Phaser.Scene} scene -The Scene on which the transitioned completed. diff --git a/src/scene/events/TRANSITION_INIT_EVENT.js b/src/scene/events/TRANSITION_INIT_EVENT.js index aa0e94765b..705e49fe5e 100644 --- a/src/scene/events/TRANSITION_INIT_EVENT.js +++ b/src/scene/events/TRANSITION_INIT_EVENT.js @@ -23,7 +23,7 @@ * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. * * @event Phaser.Scenes.Events#TRANSITION_INIT - * @type {string} + * @type {'transitioninit'} * @since 3.5.0 * * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. diff --git a/src/scene/events/TRANSITION_OUT_EVENT.js b/src/scene/events/TRANSITION_OUT_EVENT.js index bcbe7a52f7..be937648c6 100644 --- a/src/scene/events/TRANSITION_OUT_EVENT.js +++ b/src/scene/events/TRANSITION_OUT_EVENT.js @@ -20,7 +20,7 @@ * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. * * @event Phaser.Scenes.Events#TRANSITION_OUT - * @type {string} + * @type {'transitionout'} * @since 3.5.0 * * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to. diff --git a/src/scene/events/TRANSITION_START_EVENT.js b/src/scene/events/TRANSITION_START_EVENT.js index 192ccc990d..16b93b085f 100644 --- a/src/scene/events/TRANSITION_START_EVENT.js +++ b/src/scene/events/TRANSITION_START_EVENT.js @@ -26,7 +26,7 @@ * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. * * @event Phaser.Scenes.Events#TRANSITION_START - * @type {string} + * @type {'transitionstart'} * @since 3.5.0 * * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. diff --git a/src/scene/events/TRANSITION_WAKE_EVENT.js b/src/scene/events/TRANSITION_WAKE_EVENT.js index 1d05128589..76dba16202 100644 --- a/src/scene/events/TRANSITION_WAKE_EVENT.js +++ b/src/scene/events/TRANSITION_WAKE_EVENT.js @@ -21,7 +21,7 @@ * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. * * @event Phaser.Scenes.Events#TRANSITION_WAKE - * @type {string} + * @type {'transitionwake'} * @since 3.5.0 * * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from. diff --git a/src/scene/events/UPDATE_EVENT.js b/src/scene/events/UPDATE_EVENT.js index b7a563fd94..1455b2275b 100644 --- a/src/scene/events/UPDATE_EVENT.js +++ b/src/scene/events/UPDATE_EVENT.js @@ -23,7 +23,7 @@ * A Scene will only run its step if it is active. * * @event Phaser.Scenes.Events#UPDATE - * @type {string} + * @type {'update'} * @since 3.0.0 * * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. diff --git a/src/scene/events/WAKE_EVENT.js b/src/scene/events/WAKE_EVENT.js index 116c921d3d..1c84db6082 100644 --- a/src/scene/events/WAKE_EVENT.js +++ b/src/scene/events/WAKE_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using `this.events.on('wake', listener)`. * * @event Phaser.Scenes.Events#WAKE - * @type {string} + * @type {'wake'} * @since 3.0.0 * * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event. diff --git a/src/sound/events/COMPLETE_EVENT.js b/src/sound/events/COMPLETE_EVENT.js index 6174b0bc7f..6a5e386558 100644 --- a/src/sound/events/COMPLETE_EVENT.js +++ b/src/sound/events/COMPLETE_EVENT.js @@ -18,7 +18,7 @@ * ``` * * @event Phaser.Sound.Events#COMPLETE - * @type {string} + * @type {'complete'} * @since 3.16.1 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/DECODED_ALL_EVENT.js b/src/sound/events/DECODED_ALL_EVENT.js index f35fda27e7..5b31fd8c97 100644 --- a/src/sound/events/DECODED_ALL_EVENT.js +++ b/src/sound/events/DECODED_ALL_EVENT.js @@ -21,7 +21,7 @@ * ``` * * @event Phaser.Sound.Events#DECODED_ALL - * @type {string} + * @type {'decodedall'} * @since 3.18.0 */ module.exports = 'decodedall'; diff --git a/src/sound/events/DECODED_EVENT.js b/src/sound/events/DECODED_EVENT.js index a0167ff8b5..be6cbcf7b5 100644 --- a/src/sound/events/DECODED_EVENT.js +++ b/src/sound/events/DECODED_EVENT.js @@ -17,7 +17,7 @@ * ``` * * @event Phaser.Sound.Events#DECODED - * @type {string} + * @type {'decoded'} * @since 3.18.0 * * @param {string} key - The key of the audio file that was decoded and added to the audio cache. diff --git a/src/sound/events/DESTROY_EVENT.js b/src/sound/events/DESTROY_EVENT.js index 7e71d466dd..14dd2488c8 100644 --- a/src/sound/events/DESTROY_EVENT.js +++ b/src/sound/events/DESTROY_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#DESTROY - * @type {string} + * @type {'destroy'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/DETUNE_EVENT.js b/src/sound/events/DETUNE_EVENT.js index 6c227a1f15..f0c4a0ffd7 100644 --- a/src/sound/events/DETUNE_EVENT.js +++ b/src/sound/events/DETUNE_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#DETUNE - * @type {string} + * @type {'detune'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/GLOBAL_DETUNE_EVENT.js b/src/sound/events/GLOBAL_DETUNE_EVENT.js index f9260b411e..7c0f377166 100644 --- a/src/sound/events/GLOBAL_DETUNE_EVENT.js +++ b/src/sound/events/GLOBAL_DETUNE_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using: `this.sound.on('detune', listener)`. * * @event Phaser.Sound.Events#GLOBAL_DETUNE - * @type {string} + * @type {'detune'} * @since 3.0.0 * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. diff --git a/src/sound/events/GLOBAL_MUTE_EVENT.js b/src/sound/events/GLOBAL_MUTE_EVENT.js index 11bffc3ca4..1c18c9666e 100644 --- a/src/sound/events/GLOBAL_MUTE_EVENT.js +++ b/src/sound/events/GLOBAL_MUTE_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.sound.on('mute', listener)`. * * @event Phaser.Sound.Events#GLOBAL_MUTE - * @type {string} + * @type {'mute'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event. diff --git a/src/sound/events/GLOBAL_RATE_EVENT.js b/src/sound/events/GLOBAL_RATE_EVENT.js index 6e38537a67..5fd815b793 100644 --- a/src/sound/events/GLOBAL_RATE_EVENT.js +++ b/src/sound/events/GLOBAL_RATE_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using: `this.sound.on('rate', listener)`. * * @event Phaser.Sound.Events#GLOBAL_RATE - * @type {string} + * @type {'rate'} * @since 3.0.0 * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. diff --git a/src/sound/events/GLOBAL_VOLUME_EVENT.js b/src/sound/events/GLOBAL_VOLUME_EVENT.js index cff46ed953..a2cbe1937b 100644 --- a/src/sound/events/GLOBAL_VOLUME_EVENT.js +++ b/src/sound/events/GLOBAL_VOLUME_EVENT.js @@ -13,7 +13,7 @@ * Listen to it from a Scene using: `this.sound.on('volume', listener)`. * * @event Phaser.Sound.Events#GLOBAL_VOLUME - * @type {string} + * @type {'volume'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the sound manager that emitted the event. diff --git a/src/sound/events/LOOPED_EVENT.js b/src/sound/events/LOOPED_EVENT.js index 28f7894236..3365fb0209 100644 --- a/src/sound/events/LOOPED_EVENT.js +++ b/src/sound/events/LOOPED_EVENT.js @@ -21,7 +21,7 @@ * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. * * @event Phaser.Sound.Events#LOOPED - * @type {string} + * @type {'looped'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/LOOP_EVENT.js b/src/sound/events/LOOP_EVENT.js index 3130393523..c60ebcc03b 100644 --- a/src/sound/events/LOOP_EVENT.js +++ b/src/sound/events/LOOP_EVENT.js @@ -20,7 +20,7 @@ * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. * * @event Phaser.Sound.Events#LOOP - * @type {string} + * @type {'loop'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/MUTE_EVENT.js b/src/sound/events/MUTE_EVENT.js index 31608dda96..cc175db787 100644 --- a/src/sound/events/MUTE_EVENT.js +++ b/src/sound/events/MUTE_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#MUTE - * @type {string} + * @type {'mute'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/PAN_EVENT.js b/src/sound/events/PAN_EVENT.js index 8dfe7efafb..04b23448af 100644 --- a/src/sound/events/PAN_EVENT.js +++ b/src/sound/events/PAN_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#PAN - * @type {string} + * @type {'pan'} * @since 3.50.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/PAUSE_ALL_EVENT.js b/src/sound/events/PAUSE_ALL_EVENT.js index 62420fa34f..aa64f1de0f 100644 --- a/src/sound/events/PAUSE_ALL_EVENT.js +++ b/src/sound/events/PAUSE_ALL_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. * * @event Phaser.Sound.Events#PAUSE_ALL - * @type {string} + * @type {'pauseall'} * @since 3.0.0 * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. diff --git a/src/sound/events/PAUSE_EVENT.js b/src/sound/events/PAUSE_EVENT.js index 2963e65f9c..61512ec8fc 100644 --- a/src/sound/events/PAUSE_EVENT.js +++ b/src/sound/events/PAUSE_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#PAUSE - * @type {string} + * @type {'pause'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/PLAY_EVENT.js b/src/sound/events/PLAY_EVENT.js index 5914836572..a724bc185a 100644 --- a/src/sound/events/PLAY_EVENT.js +++ b/src/sound/events/PLAY_EVENT.js @@ -18,7 +18,7 @@ * ``` * * @event Phaser.Sound.Events#PLAY - * @type {string} + * @type {'play'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/RATE_EVENT.js b/src/sound/events/RATE_EVENT.js index 55d4bfd9b9..3cca51b78f 100644 --- a/src/sound/events/RATE_EVENT.js +++ b/src/sound/events/RATE_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#RATE - * @type {string} + * @type {'rate'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/RESUME_ALL_EVENT.js b/src/sound/events/RESUME_ALL_EVENT.js index f7dbf1f74d..a2dcefad0b 100644 --- a/src/sound/events/RESUME_ALL_EVENT.js +++ b/src/sound/events/RESUME_ALL_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. * * @event Phaser.Sound.Events#RESUME_ALL - * @type {string} + * @type {'resumeall'} * @since 3.0.0 * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. diff --git a/src/sound/events/RESUME_EVENT.js b/src/sound/events/RESUME_EVENT.js index b03072a8da..94b312b8a4 100644 --- a/src/sound/events/RESUME_EVENT.js +++ b/src/sound/events/RESUME_EVENT.js @@ -20,7 +20,7 @@ * ``` * * @event Phaser.Sound.Events#RESUME - * @type {string} + * @type {'resume'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/SEEK_EVENT.js b/src/sound/events/SEEK_EVENT.js index 9ed1a9a2ed..633a18d30d 100644 --- a/src/sound/events/SEEK_EVENT.js +++ b/src/sound/events/SEEK_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#SEEK - * @type {string} + * @type {'seek'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/STOP_ALL_EVENT.js b/src/sound/events/STOP_ALL_EVENT.js index 50930f540e..a865611c50 100644 --- a/src/sound/events/STOP_ALL_EVENT.js +++ b/src/sound/events/STOP_ALL_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. * * @event Phaser.Sound.Events#STOP_ALL - * @type {string} + * @type {'stopall'} * @since 3.0.0 * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. diff --git a/src/sound/events/STOP_EVENT.js b/src/sound/events/STOP_EVENT.js index e0ca37b792..aa0a89e4b3 100644 --- a/src/sound/events/STOP_EVENT.js +++ b/src/sound/events/STOP_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#STOP - * @type {string} + * @type {'stop'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/sound/events/UNLOCKED_EVENT.js b/src/sound/events/UNLOCKED_EVENT.js index d758ef584c..ace7e56f3b 100644 --- a/src/sound/events/UNLOCKED_EVENT.js +++ b/src/sound/events/UNLOCKED_EVENT.js @@ -14,7 +14,7 @@ * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. * * @event Phaser.Sound.Events#UNLOCKED - * @type {string} + * @type {'unlocked'} * @since 3.0.0 * * @param {Phaser.Sound.BaseSoundManager} soundManager - A reference to the sound manager that emitted the event. diff --git a/src/sound/events/VOLUME_EVENT.js b/src/sound/events/VOLUME_EVENT.js index 67485341ce..e391cd5608 100644 --- a/src/sound/events/VOLUME_EVENT.js +++ b/src/sound/events/VOLUME_EVENT.js @@ -19,7 +19,7 @@ * ``` * * @event Phaser.Sound.Events#VOLUME - * @type {string} + * @type {'volume'} * @since 3.0.0 * * @param {(Phaser.Sound.WebAudioSound|Phaser.Sound.HTML5AudioSound)} sound - A reference to the Sound that emitted the event. diff --git a/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js b/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js index a76023cd7c..13059cb374 100644 --- a/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js +++ b/src/structs/events/PROCESS_QUEUE_ADD_EVENT.js @@ -14,7 +14,7 @@ * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_ADD - * @type {string} + * @type {'add'} * @since 3.20.0 * * @param {*} item - The item that was added to the Process Queue. diff --git a/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js b/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js index 8faa190e62..6a46786556 100644 --- a/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js +++ b/src/structs/events/PROCESS_QUEUE_REMOVE_EVENT.js @@ -14,7 +14,7 @@ * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`. * * @event Phaser.Structs.Events#PROCESS_QUEUE_REMOVE - * @type {string} + * @type {'remove'} * @since 3.20.0 * * @param {*} item - The item that was removed from the Process Queue. diff --git a/src/textures/events/ADD_EVENT.js b/src/textures/events/ADD_EVENT.js index 482ed0df98..bec4256256 100644 --- a/src/textures/events/ADD_EVENT.js +++ b/src/textures/events/ADD_EVENT.js @@ -12,7 +12,7 @@ * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. * * @event Phaser.Textures.Events#ADD - * @type {string} + * @type {'addtexture'} * @since 3.0.0 * * @param {string} key - The key of the Texture that was added to the Texture Manager. diff --git a/src/textures/events/ERROR_EVENT.js b/src/textures/events/ERROR_EVENT.js index 1b634f7f77..59dc71b6c7 100644 --- a/src/textures/events/ERROR_EVENT.js +++ b/src/textures/events/ERROR_EVENT.js @@ -13,7 +13,7 @@ * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. * * @event Phaser.Textures.Events#ERROR - * @type {string} + * @type {'onerror'} * @since 3.0.0 * * @param {string} key - The key of the Texture that failed to load into the Texture Manager. diff --git a/src/textures/events/LOAD_EVENT.js b/src/textures/events/LOAD_EVENT.js index 4e5be5e315..89464a4787 100644 --- a/src/textures/events/LOAD_EVENT.js +++ b/src/textures/events/LOAD_EVENT.js @@ -15,7 +15,7 @@ * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. * * @event Phaser.Textures.Events#LOAD - * @type {string} + * @type {'onload'} * @since 3.0.0 * * @param {string} key - The key of the Texture that was loaded by the Texture Manager. diff --git a/src/textures/events/READY_EVENT.js b/src/textures/events/READY_EVENT.js index 0d4d999b51..d1a5b6c95d 100644 --- a/src/textures/events/READY_EVENT.js +++ b/src/textures/events/READY_EVENT.js @@ -12,7 +12,7 @@ * instance, which tells the Game to carry on booting. * * @event Phaser.Textures.Events#READY - * @type {string} + * @type {'ready'} * @since 3.16.1 */ module.exports = 'ready'; diff --git a/src/textures/events/REMOVE_EVENT.js b/src/textures/events/REMOVE_EVENT.js index b7c9a74d4f..da96a0b4c5 100644 --- a/src/textures/events/REMOVE_EVENT.js +++ b/src/textures/events/REMOVE_EVENT.js @@ -15,7 +15,7 @@ * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. * * @event Phaser.Textures.Events#REMOVE - * @type {string} + * @type {'removetexture'} * @since 3.0.0 * * @param {string} key - The key of the Texture that was removed from the Texture Manager. diff --git a/src/time/events/COMPLETE_EVENT.js b/src/time/events/COMPLETE_EVENT.js index bc36c43fef..d69a62e532 100644 --- a/src/time/events/COMPLETE_EVENT.js +++ b/src/time/events/COMPLETE_EVENT.js @@ -18,7 +18,7 @@ * ``` * * @event Phaser.Time.Events#COMPLETE - * @type {string} + * @type {'complete'} * @since 3.70.0 * * @param {Phaser.Time.Timeline} timeline - A reference to the Timeline that emitted the event. diff --git a/src/tweens/events/TWEEN_ACTIVE_EVENT.js b/src/tweens/events/TWEEN_ACTIVE_EVENT.js index 3465927f7a..155d4d358a 100644 --- a/src/tweens/events/TWEEN_ACTIVE_EVENT.js +++ b/src/tweens/events/TWEEN_ACTIVE_EVENT.js @@ -30,7 +30,7 @@ * meant for use with `tweens.create()` and/or `tweens.existing()`. * * @event Phaser.Tweens.Events#TWEEN_ACTIVE - * @type {string} + * @type {'active'} * @since 3.19.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_COMPLETE_EVENT.js b/src/tweens/events/TWEEN_COMPLETE_EVENT.js index dc64a5fecb..720de0b1df 100644 --- a/src/tweens/events/TWEEN_COMPLETE_EVENT.js +++ b/src/tweens/events/TWEEN_COMPLETE_EVENT.js @@ -27,7 +27,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_COMPLETE - * @type {string} + * @type {'complete'} * @since 3.19.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_LOOP_EVENT.js b/src/tweens/events/TWEEN_LOOP_EVENT.js index 394e00e6d8..2bfc12e727 100644 --- a/src/tweens/events/TWEEN_LOOP_EVENT.js +++ b/src/tweens/events/TWEEN_LOOP_EVENT.js @@ -30,7 +30,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_LOOP - * @type {string} + * @type {'loop'} * @since 3.19.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_PAUSE_EVENT.js b/src/tweens/events/TWEEN_PAUSE_EVENT.js index 32c1084a93..b2d462e4ac 100644 --- a/src/tweens/events/TWEEN_PAUSE_EVENT.js +++ b/src/tweens/events/TWEEN_PAUSE_EVENT.js @@ -24,7 +24,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_PAUSE - * @type {string} + * @type {'pause'} * @since 3.60.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_REPEAT_EVENT.js b/src/tweens/events/TWEEN_REPEAT_EVENT.js index 30c341231b..0a3dbd8d99 100644 --- a/src/tweens/events/TWEEN_REPEAT_EVENT.js +++ b/src/tweens/events/TWEEN_REPEAT_EVENT.js @@ -30,7 +30,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_REPEAT - * @type {string} + * @type {'repeat'} * @since 3.19.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_RESUME_EVENT.js b/src/tweens/events/TWEEN_RESUME_EVENT.js index c344ab5906..df9248b6aa 100644 --- a/src/tweens/events/TWEEN_RESUME_EVENT.js +++ b/src/tweens/events/TWEEN_RESUME_EVENT.js @@ -24,7 +24,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_RESUME - * @type {string} + * @type {'resume'} * @since 3.60.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_START_EVENT.js b/src/tweens/events/TWEEN_START_EVENT.js index 9b1299a159..0854024148 100644 --- a/src/tweens/events/TWEEN_START_EVENT.js +++ b/src/tweens/events/TWEEN_START_EVENT.js @@ -26,7 +26,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_START - * @type {string} + * @type {'start'} * @since 3.19.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_STOP_EVENT.js b/src/tweens/events/TWEEN_STOP_EVENT.js index f4b18c0164..e11fb1dce1 100644 --- a/src/tweens/events/TWEEN_STOP_EVENT.js +++ b/src/tweens/events/TWEEN_STOP_EVENT.js @@ -22,7 +22,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_STOP - * @type {string} + * @type {'stop'} * @since 3.24.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_UPDATE_EVENT.js b/src/tweens/events/TWEEN_UPDATE_EVENT.js index 93bb921209..57898e6f80 100644 --- a/src/tweens/events/TWEEN_UPDATE_EVENT.js +++ b/src/tweens/events/TWEEN_UPDATE_EVENT.js @@ -26,7 +26,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_UPDATE - * @type {string} + * @type {'update'} * @since 3.19.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/src/tweens/events/TWEEN_YOYO_EVENT.js b/src/tweens/events/TWEEN_YOYO_EVENT.js index dd39e68d63..e761dbd2d0 100644 --- a/src/tweens/events/TWEEN_YOYO_EVENT.js +++ b/src/tweens/events/TWEEN_YOYO_EVENT.js @@ -31,7 +31,7 @@ * ``` * * @event Phaser.Tweens.Events#TWEEN_YOYO - * @type {string} + * @type {'yoyo'} * @since 3.19.0 * * @param {Phaser.Tweens.Tween} tween - A reference to the Tween instance that emitted the event. diff --git a/types/phaser.d.ts b/types/phaser.d.ts index 62345ca813..ed975e6e66 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -168,11 +168,11 @@ declare namespace Phaser { /** * Takes an array of Game Objects and aligns them next to each other. - * + * * The alignment position is controlled by the `position` parameter, which should be one * of the Phaser.Display.Align constants, such as `Phaser.Display.Align.TOP_LEFT`, * `Phaser.Display.Align.TOP_CENTER`, etc. - * + * * The first item isn't moved. The second item is aligned next to the first, * then the third next to the second, and so on. * @param items The array of items to be updated by this action. @@ -186,9 +186,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `angle` property, * and then adds the given value to each of their `angle` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `Angle(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount, in degrees, to be added to the `angle` property. @@ -244,7 +244,7 @@ declare namespace Phaser { * Takes an array of objects and returns the first element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1. - * + * * To use this with a Group: `GetFirst(group.getChildren(), compare, index)` * @param items The array of items to be searched by this action. * @param compare The comparison object. Each property in this object will be checked against the items of the array. @@ -257,7 +257,7 @@ declare namespace Phaser { * Takes an array of objects and returns the last element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1. - * + * * To use this with a Group: `GetLast(group.getChildren(), compare, index)` * @param items The array of items to be searched by this action. * @param compare The comparison object. Each property in this object will be checked against the items of the array. @@ -289,9 +289,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `alpha` property, * and then adds the given value to each of their `alpha` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncAlpha(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `alpha` property. @@ -305,9 +305,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `x` property, * and then adds the given value to each of their `x` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `x` property. @@ -321,9 +321,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, * and then adds the given value to each of them. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)` * @param items The array of items to be updated by this action. * @param x The amount to be added to the `x` property. @@ -339,9 +339,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `y` property, * and then adds the given value to each of their `y` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `y` property. @@ -354,7 +354,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. - * + * * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param circle The Circle to position the Game Objects on. @@ -393,7 +393,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. - * + * * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. * If the `shift` parameter is given you can offset where placement begins. * @param items An array of Game Objects. The contents of this array are updated by this Action. @@ -405,7 +405,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. - * + * * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param triangle The Triangle to position the Game Objects on. @@ -416,7 +416,7 @@ declare namespace Phaser { /** * Play an animation on all Game Objects in the array that have an Animation component. - * + * * You can pass either an animation key, or an animation configuration object for more control over the playback. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. @@ -428,9 +428,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then adds the given value to it. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)` * @param items The array of items to be updated by this action. * @param key The property to be updated. @@ -445,9 +445,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` * @param items The array of items to be updated by this action. * @param key The property to be updated. @@ -461,7 +461,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations within the Circle. - * + * * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param circle The Circle to position the Game Objects within. @@ -471,7 +471,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. - * + * * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param ellipse The Ellipse to position the Game Objects within. @@ -481,7 +481,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations on the Line. - * + * * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param line The Line to position the Game Objects randomly on. @@ -499,7 +499,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations within the Triangle. - * + * * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param triangle The Triangle to position the Game Objects within. @@ -510,9 +510,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `rotation` property, * and then adds the given value to each of their `rotation` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `Rotate(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `rotation` property (in radians). @@ -545,9 +545,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `scaleX` property, * and then adds the given value to each of their `scaleX` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `ScaleX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `scaleX` property. @@ -561,9 +561,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, * and then adds the given value to each of them. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param scaleX The amount to be added to the `scaleX` property. @@ -611,7 +611,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `blendMode` * and then sets it to the given value. - * + * * To use this with a Group: `SetBlendMode(group.getChildren(), value)` * @param items The array of items to be updated by this action. * @param value The Blend Mode to be set. @@ -628,7 +628,7 @@ declare namespace Phaser { * of those with lower values. * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetDepth(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The depth value to assign to each item. @@ -651,9 +651,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param originX The amount to set the `originX` property to. @@ -669,9 +669,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `rotation` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetRotation(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to (in radians). @@ -685,9 +685,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param scaleX The amount to set the `scaleX` property to. @@ -735,9 +735,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `scrollFactorX` and `scrollFactorY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScrollFactor(group.getChildren(), scrollFactorX, scrollFactorY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param scrollFactorX The amount to set the `scrollFactorX` property to. @@ -753,9 +753,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorX` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScrollFactorX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. @@ -769,9 +769,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorY` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScrollFactorY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. @@ -796,7 +796,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `visible` * and then sets it to the given value. - * + * * To use this with a Group: `SetVisible(group.getChildren(), value)` * @param items The array of items to be updated by this action. * @param value The visible state to set on each item. Set to `true` to make items visible, or `false` to hide them. @@ -809,9 +809,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `x` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The x coordinate, in pixels, to set on each item. @@ -825,9 +825,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetXY(group.getChildren(), x, y, stepX, stepY)` * @param items The array of items to be updated by this action. * @param x The amount to set the `x` property to. @@ -843,9 +843,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `y` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. @@ -861,18 +861,18 @@ declare namespace Phaser { * `y` properties and then iterates through them. As this function iterates, it moves * the position of the current element to be that of the previous entry in the array. * This repeats until all items have been moved. - * + * * The direction controls the order of iteration. A value of 0 (the default) assumes * that the final item in the array is the 'head' item. - * + * * A direction value of 1 assumes that the first item in the array is the 'head' item. - * + * * The position of the 'head' item is set to the x/y values given to this function. * Every other item in the array is then updated, in sequence, to be that of the * previous (or next) entry in the array. - * + * * The final x/y coords are returned, or set in the 'output' Vector2. - * + * * Think of it as being like the game Snake, where the 'head' is moved and then * each body piece is moved into the space of the previous piece. * @param items An array of Game Objects, or objects with public x and y positions. The contents of this array are updated by this Action. @@ -897,15 +897,15 @@ declare namespace Phaser { * based on its position, creating a smooth ease-in/ease-out transition across the items. * * Smoothstep is a sigmoid-like interpolation and clamping function. - * + * * The function depends on three parameters, the input x, the "left edge" * and the "right edge", with the left edge being assumed smaller than the right edge. - * + * * The function receives a real number x as an argument and returns 0 if x is less than * or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly * interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the * smoothstep function is zero at both edges. - * + * * This is convenient for creating a sequence of transitions using smoothstep to interpolate * each segment as an alternative to using more sophisticated or expensive interpolation techniques. * @param items An array of Game Objects. The contents of this array are updated by this Action. @@ -937,11 +937,11 @@ declare namespace Phaser { /** * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, by the * calculated spread value. - * + * * The spread value is derived from the given `min` and `max` values and the total number of items in the array. - * + * * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: - * + * * ```javascript * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); * ``` @@ -978,21 +978,21 @@ declare namespace Phaser { namespace Animations { /** * A Frame based Animation. - * + * * Animations in Phaser consist of a sequence of `AnimationFrame` objects, which are managed by * this class, along with properties that impact playback, such as the animation's frame rate * or delay. - * + * * This class contains all of the properties and methods needed to handle playback of the animation * directly to an `AnimationState` instance, which is owned by a Sprite, or similar Game Object. - * + * * You don't typically create an instance of this class directly, but instead go via * either the `AnimationManager` or the `AnimationState` and use their `create` methods, * depending on if you need a global animation, or local to a specific Sprite. */ class Animation { /** - * + * * @param manager A reference to the global Animation Manager * @param key The unique identifying string for this animation. * @param config The Animation configuration. @@ -1250,7 +1250,7 @@ declare namespace Phaser { */ class AnimationFrame { /** - * + * * @param textureKey The key of the Texture this AnimationFrame uses. * @param textureFrame The key of the Frame within the Texture that this AnimationFrame uses. * @param index The index of this AnimationFrame within the Animation sequence. @@ -1346,7 +1346,7 @@ declare namespace Phaser { */ class AnimationManager extends Phaser.Events.EventEmitter { /** - * + * * @param game A reference to the Phaser.Game instance. */ constructor(game: Phaser.Game); @@ -1363,21 +1363,21 @@ declare namespace Phaser { /** * The global time scale of the Animation Manager. - * + * * This scales the time delta between two frames, thus influencing the speed of time for the Animation Manager. */ globalTimeScale: number; /** * The Animations registered in the Animation Manager. - * + * * This map should be modified with the {@link #add} and {@link #create} methods of the Animation Manager. */ protected anims: Phaser.Structs.Map; /** * A list of animation mix times. - * + * * See the {@link #setMix} method for more details. */ mixes: Phaser.Structs.Map; @@ -1399,21 +1399,21 @@ declare namespace Phaser { /** * Adds a mix between two animations. - * + * * Mixing allows you to specify a unique delay between a pairing of animations. - * + * * When playing Animation A on a Game Object, if you then play Animation B, and a * mix exists, it will wait for the specified delay to be over before playing Animation B. - * + * * This allows you to customise smoothing between different types of animation, such * as blending between an idle and a walk state, or a running and a firing state. - * + * * Note that mixing is only applied if you use the `Sprite.play` method. If you opt to use * `playAfterRepeat` or `playAfterDelay` instead, those will take priority and the mix * delay will not be used. - * + * * To update an existing mix, just call this method with the new delay. - * + * * To remove a mix pairing, see the `removeMix` method. * @param animA The string-based key, or instance of, Animation A. * @param animB The string-based key, or instance of, Animation B. @@ -1424,13 +1424,13 @@ declare namespace Phaser { /** * Removes a mix between two animations. - * + * * Mixing allows you to specify a unique delay between a pairing of animations. - * + * * Calling this method lets you remove those pairings. You can either remove * it between `animA` and `animB`, or if you do not provide the `animB` parameter, * it will remove all `animA` mixes. - * + * * If you wish to update an existing mix instead, call the `addMix` method with the * new delay. * @param animA The string-based key, or instance of, Animation A. @@ -1462,7 +1462,7 @@ declare namespace Phaser { /** * Checks to see if the given key is already in use within the Animation Manager or not. - * + * * Animations are global. Keys created in one scene can be used from any other Scene in your game. They are not Scene specific. * @param key The key of the Animation to check. * @returns `true` if the Animation already exists in the Animation Manager, or `false` if the key is available. @@ -1471,41 +1471,41 @@ declare namespace Phaser { /** * Create one, or more animations from a loaded Aseprite JSON file. - * + * * Aseprite is a powerful animated sprite editor and pixel art tool. - * + * * You can find more details at https://www.aseprite.org/ - * + * * To export a compatible JSON file in Aseprite, please do the following: - * + * * 1. Go to "File - Export Sprite Sheet" - * + * * 2. On the **Layout** tab: * 2a. Set the "Sheet type" to "Packed" * 2b. Set the "Constraints" to "None" * 2c. Check the "Merge Duplicates" checkbox - * + * * 3. On the **Sprite** tab: * 3a. Set "Layers" to "Visible layers" * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags - * + * * 4. On the **Borders** tab: * 4a. Check the "Trim Sprite" and "Trim Cells" options * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) - * + * * 5. On the **Output** tab: * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type * 5b. Check "JSON Data" and give your json file a name * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. * 5d. Make sure "Tags" is checked in the Meta options * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. - * + * * 6. Click export - * + * * This was tested with Aseprite 1.2.25. - * + * * This will export a png and json file which you can load using the Aseprite Loader, i.e.: - * + * * ```javascript * function preload () * { @@ -1513,28 +1513,28 @@ declare namespace Phaser { * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); * } * ``` - * + * * Once loaded, you can call this method from within a Scene with the 'atlas' key: - * + * * ```javascript * this.anims.createFromAseprite('paladin'); * ``` - * + * * Any animations defined in the JSON will now be available to use in Phaser and you play them * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, * you can play it in Phaser using that Tag name: - * + * * ```javascript * this.add.sprite(400, 300).play('War Cry'); * ``` - * + * * When calling this method you can optionally provide an array of tag names, and only those animations * will be created. For example: - * + * * ```javascript * this.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); * ``` - * + * * This will only create the 3 animations defined. Note that the tag names are case-sensitive. * @param key The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. * @param tags An array of Tag names. If provided, only animations found in this array will be created. @@ -1545,15 +1545,15 @@ declare namespace Phaser { /** * Creates a new Animation and adds it to the Animation Manager. - * + * * Animations are global. Once created, you can use them in any Scene in your game. They are not Scene specific. - * + * * If an invalid key is given this method will return `false`. - * + * * If you pass the key of an animation that already exists in the Animation Manager, that animation will be returned. - * + * * A brand new animation is only created if the key is valid and not already in use. - * + * * If you wish to re-use an existing key, call `AnimationManager.remove` first, then this method. * @param config The configuration settings for the Animation. * @returns The Animation that was created, or `false` if the key is already in use. @@ -1570,21 +1570,21 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. - * + * * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. - * + * * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. - * + * * Example: - * + * * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', start: 1, end: 6, zeroPad: 4 })`. - * + * * The `end` value tells it to select frames 1 through 6, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'ruby', @@ -1596,7 +1596,7 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Please see the animation examples for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frame names. @@ -1606,23 +1606,23 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. - * + * * If you're working with a texture atlas, see the `generateFrameNames` method instead. - * + * * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. - * + * * Example: - * + * * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: - * + * * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 11 })`. - * + * * The `end` value of 11 tells it to stop after the 12th frame has been added, because it started at zero. - * + * * To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'boom', @@ -1632,15 +1632,15 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. - * + * * To specify an animation in reverse, swap the `start` and `end` values. - * + * * If the frames are not sequential, you may pass an array of frame numbers instead, for example: - * + * * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` - * + * * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frames. @@ -1686,24 +1686,24 @@ declare namespace Phaser { * Takes an array of Game Objects that have an Animation Component and then * starts the given animation playing on them. The start time of each Game Object * is offset, incrementally, by the `stagger` amount. - * + * * For example, if you pass an array with 4 children and a stagger time of 1000, * the delays will be: - * + * * child 1: 1000ms delay * child 2: 2000ms delay * child 3: 3000ms delay * child 4: 4000ms delay - * + * * If you set the `staggerFirst` parameter to `false` they would be: - * + * * child 1: 0ms delay * child 2: 1000ms delay * child 3: 2000ms delay * child 4: 3000ms delay - * + * * You can also set `stagger` to be a negative value. If it was -1000, the above would be: - * + * * child 1: 3000ms delay * child 2: 2000ms delay * child 3: 1000ms delay @@ -1718,7 +1718,7 @@ declare namespace Phaser { /** * Removes an Animation from this Animation Manager, based on the given key. - * + * * This is a global action. Once an Animation has been removed, no Game Objects * can carry on using it. * @param key The key of the animation to remove. @@ -1751,33 +1751,33 @@ declare namespace Phaser { /** * The Animation State Component. - * + * * This component provides features to apply animations to Game Objects. It is responsible for * loading, queuing animations for later playback, mixing between animations and setting * the current animation frame to the Game Object that owns this component. - * + * * This component lives as an instance within any Game Object that has it defined, such as Sprites. - * + * * You can access its properties and methods via the `anims` property, i.e. `Sprite.anims`. - * + * * As well as playing animations stored in the global Animation Manager, this component * can also create animations that are stored locally within it. See the `create` method * for more details. - * + * * Prior to Phaser 3.50 this component was called just `Animation` and lived in the * `Phaser.GameObjects.Components` namespace. It was renamed to `AnimationState` * in 3.50 to help better identify its true purpose when browsing the documentation. */ class AnimationState { /** - * + * * @param parent The Game Object to which this animation component belongs. */ constructor(parent: Phaser.GameObjects.GameObject); /** * The Game Object to which this animation component belongs. - * + * * You can typically access this component from the Game Object * via the `this.anims` property. */ @@ -1795,7 +1795,7 @@ declare namespace Phaser { /** * The Animations stored locally in this Animation component. - * + * * Do not modify the contents of this Map directly, instead use the * `add`, `create` and `remove` methods of this class instead. */ @@ -1813,14 +1813,14 @@ declare namespace Phaser { /** * The current Animation loaded into this Animation component. - * + * * Will be `null` if no animation is yet loaded. */ currentAnim: Phaser.Animations.Animation | null; /** * The current AnimationFrame being displayed by this Animation component. - * + * * Will be `null` if no animation is yet loaded. */ currentFrame: Phaser.Animations.AnimationFrame | null; @@ -1828,34 +1828,34 @@ declare namespace Phaser { /** * The key, instance, or config of the next Animation to be loaded into this Animation component * when the current animation completes. - * + * * Will be `null` if no animation has been queued. */ nextAnim: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig | null; /** * A queue of Animations to be loaded into this Animation component when the current animation completes. - * + * * Populate this queue via the `chain` method. */ nextAnimsQueue: any[]; /** * The Time Scale factor. - * + * * You can adjust this value to modify the passage of time for the animation that is currently * playing. For example, setting it to 2 will make the animation play twice as fast. Or setting * it to 0.5 will slow the animation down. - * + * * You can change this value at run-time, or set it via the `PlayAnimationConfig`. - * + * * Prior to Phaser 3.50 this property was private and called `_timeScale`. */ timeScale: number; /** * The frame rate of playback, of the current animation, in frames per second. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the frame rate, provide a new value in the `PlayAnimationConfig` object. @@ -1864,7 +1864,7 @@ declare namespace Phaser { /** * The duration of the current animation, in milliseconds. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the duration, provide a new value in the `PlayAnimationConfig` object. @@ -1874,7 +1874,7 @@ declare namespace Phaser { /** * The number of milliseconds per frame, not including frame specific modifiers that may be present in the * Animation data. - * + * * This value is calculated when a new animation is loaded into this component and should * be treated as read-only. Changing it will not alter playback speed. */ @@ -1892,36 +1892,36 @@ declare namespace Phaser { /** * The delay before starting playback of the current animation, in milliseconds. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the delay, provide a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_delay`. */ delay: number; /** * The number of times to repeat playback of the current animation. - * + * * If -1, it means the animation will repeat forever. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the number of repeats, provide a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_repeat`. */ repeat: number; /** * The number of milliseconds to wait before starting the repeat playback of the current animation. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time. - * + * * You can change the repeat delay by providing a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_repeatDelay`. */ repeatDelay: number; @@ -1930,12 +1930,12 @@ declare namespace Phaser { * Should the current animation yoyo? An animation that yoyos will play in reverse, from the end * to the start, before then repeating or completing. An animation that does not yoyo will just * play from the start to the end. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time. - * + * * You can change the yoyo by providing a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_yoyo`. */ yoyo: boolean; @@ -1945,7 +1945,7 @@ declare namespace Phaser { * controls when the first frame is set on the Sprite. If this property * is 'false' then the frame is set only after the delay has expired. * This is the default behavior. - * + * * If this property is 'true' then the first frame of this animation * is set immediately, and then when the delay expires, playback starts. */ @@ -1953,9 +1953,9 @@ declare namespace Phaser { /** * Should the GameObject's `visible` property be set to `true` when the animation starts to play? - * + * * This will happen _after_ any delay that may have been set. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time, assuming the animation is currently delayed. */ @@ -1963,7 +1963,7 @@ declare namespace Phaser { /** * Should the GameObject's `visible` property be set to `false` when the animation completes? - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time, assuming the animation is still actively playing. */ @@ -1978,28 +1978,28 @@ declare namespace Phaser { * An internal trigger that tells the component if it should plays the animation * in reverse mode ('true') or not ('false'). This is used because `forward` can * be changed by the `yoyo` feature. - * + * * Prior to Phaser 3.50 this property was private and called `_reverse`. */ inReverse: boolean; /** * Internal time overflow accumulator. - * + * * This has the `delta` time added to it as part of the `update` step. */ accumulator: number; /** * The time point at which the next animation frame will change. - * + * * This value is compared against the `accumulator` as part of the `update` step. */ nextTick: number; /** * A counter keeping track of how much delay time, in milliseconds, is left before playback begins. - * + * * This is set via the `playAfterDelay` method, although it can be modified at run-time * if required, as long as the animation has not already started playing. */ @@ -2007,7 +2007,7 @@ declare namespace Phaser { /** * A counter that keeps track of how many repeats are left to run. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time. */ @@ -2020,16 +2020,16 @@ declare namespace Phaser { /** * Sets an animation, or an array of animations, to be played in the future, after the current one completes or stops. - * + * * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, * or have one of the `stop` methods called. - * + * * An animation set to repeat forever will never enter a completed state unless stopped. - * + * * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` event). - * + * * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. - * + * * Call this method with no arguments to reset all currently chained animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * @returns The Game Object that owns this Animation Component. @@ -2075,14 +2075,14 @@ declare namespace Phaser { /** * Waits for the specified delay, in milliseconds, then starts playback of the given animation. - * + * * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. - * + * * If an animation is already running and a new animation is given to this method, it will wait for * the given delay before starting the new animation. - * + * * If no animation is currently running, the given one begins after the delay. - * + * * Prior to Phaser 3.50 this method was called 'delayedPlay' and the parameters were in the reverse order. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param delay The delay, in milliseconds, to wait before starting the animation playing. @@ -2093,10 +2093,10 @@ declare namespace Phaser { /** * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback * of the given animation. - * + * * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an * idle animation to a walking animation, by making them blend smoothly into each other. - * + * * If no animation is currently running, the given one will start immediately. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param repeatCount How many times should the animation repeat before the next one starts? Default 1. @@ -2106,15 +2106,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -2122,37 +2122,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).play('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If this animation is already playing then ignore this call. Default false. @@ -2162,15 +2162,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite, in reverse. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -2178,37 +2178,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).playReverse('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. @@ -2232,7 +2232,7 @@ declare namespace Phaser { /** * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. - * + * * The value is based on the current frame and how far that is in the animation, it is not based on * the duration of the animation.undefined * @returns The progress of the current animation in frames, between 0 and 1. @@ -2241,9 +2241,9 @@ declare namespace Phaser { /** * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. - * + * * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. - * + * * The value is based on the current frame and how far that is in the animation, it is not based on * the duration of the animation. * @param value The progress value, between 0 and 1. Default 0. @@ -2254,10 +2254,10 @@ declare namespace Phaser { /** * Sets the number of times that the animation should repeat after its first play through. * For example, if repeat is 1, the animation will play a total of twice: the initial play plus 1 repeat. - * + * * To repeat indefinitely, use -1. * The value should always be an integer. - * + * * Calling this method only works if the animation is already running. Otherwise, any * value specified here will be overwritten when the next animation loads in. To avoid this, * use the `repeat` property of the `PlayAnimationConfig` object instead. @@ -2275,11 +2275,11 @@ declare namespace Phaser { /** * Restarts the current animation from its beginning. - * + * * You can optionally reset the delay and repeat counters as well. - * + * * Calling this will fire the `ANIMATION_RESTART` event immediately. - * + * * If you `includeDelay` then it will also fire the `ANIMATION_START` event once * the delay has expired, otherwise, playback will just begin immediately. * @param includeDelay Whether to include the delay value of the animation when restarting. Default false. @@ -2290,9 +2290,9 @@ declare namespace Phaser { /** * The current animation has completed. This dispatches the `ANIMATION_COMPLETE` event. - * + * * This method is called by the Animation instance and should not usually be invoked directly. - * + * * If no animation is loaded, no events will be dispatched. * * If another animation has been queued for playback, it will be started after the events fire.undefined @@ -2302,7 +2302,7 @@ declare namespace Phaser { /** * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. * * If there is another animation in the queue (set via the `chain` method) then it will start playing.undefined @@ -2312,11 +2312,11 @@ declare namespace Phaser { /** * Stops the current animation from playing after the specified time delay, given in milliseconds. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param delay The number of milliseconds to wait before stopping this animation. @@ -2326,14 +2326,14 @@ declare namespace Phaser { /** * Stops the current animation from playing when it next repeats. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. - * + * * Prior to Phaser 3.50 this method was called `stopOnRepeat` and had no parameters. * @param repeatCount How many times should the animation repeat before stopping? Default 1. * @returns The Game Object that owns this Animation Component. @@ -2343,11 +2343,11 @@ declare namespace Phaser { /** * Stops the current animation from playing when it next sets the given frame. * If this frame doesn't exist within the animation it will not stop it from playing. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param frame The frame to check before stopping this animation. @@ -2364,7 +2364,7 @@ declare namespace Phaser { /** * The internal update loop for the AnimationState Component. - * + * * This is called automatically by the `Sprite.preUpdate` method. * @param time The current timestamp. * @param delta The delta time, in ms, elapsed since the last frame. @@ -2382,7 +2382,7 @@ declare namespace Phaser { /** * Advances the animation to the next frame, regardless of the time or animation state. * If the animation is set to repeat, or yoyo, this will still take effect. - * + * * Calling this does not change the direction of the animation. I.e. if it was currently * playing in reverse, calling this method doesn't then change the direction to forwards.undefined * @returns The Game Object this Animation Component belongs to. @@ -2392,7 +2392,7 @@ declare namespace Phaser { /** * Advances the animation to the previous frame, regardless of the time or animation state. * If the animation is set to repeat, or yoyo, this will still take effect. - * + * * Calling this does not change the direction of the animation. I.e. if it was currently * playing in forwards, calling this method doesn't then change the direction to backwards.undefined * @returns The Game Object this Animation Component belongs to. @@ -2401,7 +2401,7 @@ declare namespace Phaser { /** * Get an Animation instance that has been created locally on this Sprite. - * + * * See the `create` method for more details. * @param key The key of the Animation to retrieve. * @returns The Animation, or `null` if the key is invalid. @@ -2417,19 +2417,19 @@ declare namespace Phaser { /** * Creates a new Animation that is local specifically to this Sprite. - * + * * When a Sprite owns an animation, it is kept out of the global Animation Manager, which means * you're free to use keys that may be already defined there. Unless you specifically need a Sprite * to have a unique animation, you should favor using global animations instead, as they allow for * the same animation to be used across multiple Sprites, saving on memory. However, if this Sprite * is the only one to use this animation, it's sensible to create it here. - * + * * If an invalid key is given this method will return `false`. - * + * * If you pass the key of an animation that already exists locally, that animation will be returned. - * + * * A brand new animation is only created if the key is valid and not already in use by this Sprite. - * + * * If you wish to re-use an existing key, call the `remove` method first, then this method. * @param config The configuration settings for the Animation. * @returns The Animation that was created, or `false` if the key is already in use. @@ -2438,41 +2438,41 @@ declare namespace Phaser { /** * Create one, or more animations from a loaded Aseprite JSON file. - * + * * Aseprite is a powerful animated sprite editor and pixel art tool. - * + * * You can find more details at https://www.aseprite.org/ - * + * * To export a compatible JSON file in Aseprite, please do the following: - * + * * 1. Go to "File - Export Sprite Sheet" - * + * * 2. On the **Layout** tab: * 2a. Set the "Sheet type" to "Packed" * 2b. Set the "Constraints" to "None" * 2c. Check the "Merge Duplicates" checkbox - * + * * 3. On the **Sprite** tab: * 3a. Set "Layers" to "Visible layers" * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags - * + * * 4. On the **Borders** tab: * 4a. Check the "Trim Sprite" and "Trim Cells" options * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) - * + * * 5. On the **Output** tab: * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type * 5b. Check "JSON Data" and give your json file a name * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. * 5d. Make sure "Tags" is checked in the Meta options * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. - * + * * 6. Click export - * + * * This was tested with Aseprite 1.2.25. - * + * * This will export a png and json file which you can load using the Aseprite Loader, i.e.: - * + * * ```javascript * function preload () * { @@ -2480,34 +2480,34 @@ declare namespace Phaser { * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); * } * ``` - * + * * Once loaded, you can call this method on a Sprite with the 'atlas' key: - * + * * ```javascript * const sprite = this.add.sprite(400, 300); - * + * * sprite.anims.createFromAseprite('paladin'); * ``` - * + * * Any animations defined in the JSON will now be available to use on this Sprite and you play them * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, * you can play it on the Sprite using that Tag name: - * + * * ```javascript * const sprite = this.add.sprite(400, 300); - * + * * sprite.anims.createFromAseprite('paladin'); - * + * * sprite.play('War Cry'); * ``` - * + * * When calling this method you can optionally provide an array of tag names, and only those animations * will be created. For example: - * + * * ```javascript * sprite.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); * ``` - * + * * This will only create the 3 animations defined. Note that the tag names are case-sensitive. * @param key The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. * @param tags An array of Tag names. If provided, only animations found in this array will be created. @@ -2517,20 +2517,20 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. - * + * * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. - * + * * Example: - * + * * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. - * + * * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'ruby', @@ -2542,7 +2542,7 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Please see the animation examples for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frame names. @@ -2552,20 +2552,20 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. - * + * * If you're working with a texture atlas, see the `generateFrameNames` method instead. - * + * * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. * * Example: - * + * * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 11 })`. - * + * * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'boom', @@ -2575,15 +2575,15 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. - * + * * To specify an animation in reverse, swap the `start` and `end` values. - * + * * If the frames are not sequential, you may pass an array of frame numbers instead, for example: - * + * * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` - * + * * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frames. @@ -2593,7 +2593,7 @@ declare namespace Phaser { /** * Removes a locally created Animation from this Sprite, based on the given key. - * + * * Once an Animation has been removed, this Sprite cannot play it again without re-creating it. * @param key The key of the animation to remove. * @returns The Animation instance that was removed from this Sprite, if the key was valid. @@ -2602,7 +2602,7 @@ declare namespace Phaser { /** * Destroy this Animation component. - * + * * Unregisters event listeners and cleans up its references. */ destroy(): void; @@ -2617,196 +2617,196 @@ declare namespace Phaser { namespace Events { /** * The Add Animation Event. - * + * * This event is dispatched when a new animation is added to the global Animation Manager. - * + * * This can happen either as a result of an animation instance being added to the Animation Manager, * or the Animation Manager creating a new animation directly. */ - const ADD_ANIMATION: string; + const ADD_ANIMATION: 'add'; /** * The Animation Complete Event. - * + * * This event is dispatched by a Sprite when an animation playing on it completes playback. * This happens when the animation gets to the end of its sequence, factoring in any delays * or repeats it may have to process. - * + * * An animation that is set to loop, or repeat forever, will never fire this event, because * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` * event instead, as this is emitted when the animation is stopped directly. - * + * * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_COMPLETE: string; /** * The Animation Complete Dynamic Key Event. - * + * * This event is dispatched by a Sprite when an animation playing on it completes playback. * This happens when the animation gets to the end of its sequence, factoring in any delays * or repeats it may have to process. - * + * * An animation that is set to loop, or repeat forever, will never fire this event, because * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` * event instead, as this is emitted when the animation is stopped directly. - * + * * The difference between this and the `ANIMATION_COMPLETE` event is that this one has a * dynamic event name that contains the name of the animation within it. For example, * if you had an animation called `explode` you could listen for the completion of that * specific animation by using: `sprite.on('animationcomplete-explode', listener)`. Or, if you * wish to use types: `sprite.on(Phaser.Animations.Events.ANIMATION_COMPLETE_KEY + 'explode', listener)`. - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_COMPLETE_KEY: string; /** * The Animation Repeat Event. - * + * * This event is dispatched by a Sprite when an animation repeats playing on it. * This happens if the animation was created, or played, with a `repeat` value specified. - * + * * An animation will repeat when it reaches the end of its sequence. - * + * * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_REPEAT: string; /** * The Animation Restart Event. - * + * * This event is dispatched by a Sprite when an animation restarts playing on it. * This only happens when the `Sprite.anims.restart` method is called. - * + * * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_RESTART: string; /** * The Animation Start Event. - * + * * This event is dispatched by a Sprite when an animation starts playing on it. * This happens when the animation is played, factoring in any delay that may have been specified. * This event happens after the delay has expired and prior to the first update event. - * + * * Listen for it on the Sprite using `sprite.on('animationstart', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_START: string; /** * The Animation Stop Event. - * + * * This event is dispatched by a Sprite when an animation is stopped on it. An animation * will only be stopped if a method such as `Sprite.stop` or `Sprite.anims.stopAfterDelay` * is called. It can also be emitted if a new animation is started before the current one completes. - * + * * Listen for it on the Sprite using `sprite.on('animationstop', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_STOP: string; /** * The Animation Update Event. - * + * * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame. * An animation will change frame based on the frame rate and other factors like `timeScale` and `delay`. It can also change * frame when stopped or restarted. - * + * * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` - * + * * If an animation is playing faster than the game frame-rate can handle, it's entirely possible for it to emit several * update events in a single game frame, so please be aware of this in your code. The **final** event received that frame * is the one that is rendered to the game. - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_UPDATE: string; /** * The Pause All Animations Event. - * + * * This event is dispatched when the global Animation Manager is told to pause. - * + * * When this happens all current animations will stop updating, although it doesn't necessarily mean * that the game has paused as well. */ @@ -2814,16 +2814,16 @@ declare namespace Phaser { /** * The Remove Animation Event. - * + * * This event is dispatched when an animation is removed from the global Animation Manager. */ const REMOVE_ANIMATION: string; /** * The Resume All Animations Event. - * + * * This event is dispatched when the global Animation Manager resumes, having been previously paused. - * + * * When this happens all current animations will continue updating again. */ const RESUME_ALL: string; @@ -2843,7 +2843,7 @@ declare namespace Phaser { class BaseCache { /** * The Map in which the cache objects are stored. - * + * * You can query the Map directly or use the BaseCache methods. */ entries: Phaser.Structs.Map; @@ -2912,7 +2912,7 @@ declare namespace Phaser { /** * The Cache Manager is the global cache owned and maintained by the Game instance. - * + * * Various systems, such as the file Loader, rely on this cache in order to store the files * they have loaded. The manager itself doesn't store any files, but instead owns multiple BaseCache * instances, one per type of file. Built-in caches are provided for binary files, bitmap fonts, @@ -2923,7 +2923,7 @@ declare namespace Phaser { */ class CacheManager { /** - * + * * @param game A reference to the Phaser.Game instance that owns this CacheManager. */ constructor(game: Phaser.Game); @@ -3020,14 +3020,14 @@ declare namespace Phaser { namespace Events { /** * The Cache Add Event. - * + * * This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it. */ const ADD: string; /** * The Cache Remove Event. - * + * * This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it. */ const REMOVE: string; @@ -3040,34 +3040,34 @@ declare namespace Phaser { namespace Scene2D { /** * A Base Camera class. - * + * * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, * and can be positioned, rotated, zoomed and scrolled accordingly. - * + * * A Camera consists of two elements: The viewport and the scroll values. - * + * * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are * created the same size as your game, but their position and size can be set to anything. This means if you * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). - * + * * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the * viewport, and changing the viewport has no impact on the scrolling. - * + * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. - * + * * The Base Camera is extended by the Camera class, which adds in special effects including Fade, * Flash and Camera Shake, as well as the ability to follow Game Objects. - * + * * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate * to when they were added to the Camera class. */ class BaseCamera extends Phaser.Events.EventEmitter implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.Visible { /** - * + * * @param x The x position of the Camera, relative to the top-left of the game canvas. * @param y The y position of the Camera, relative to the top-left of the game canvas. * @param width The width of the Camera, in pixels. @@ -3113,7 +3113,7 @@ declare namespace Phaser { /** * Is this Camera visible or not? - * + * * A visible camera will render and perform input tests. * An invisible camera will not render anything and will skip input tests. */ @@ -3121,7 +3121,7 @@ declare namespace Phaser { /** * Is this Camera using a bounds to restrict scrolling movement? - * + * * Set this property along with the bounds via `Camera.setBounds`. */ useBounds: boolean; @@ -3136,7 +3136,7 @@ declare namespace Phaser { /** * Is this Camera dirty? - * + * * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame. * * This flag is cleared during rendering with the new values. @@ -3178,9 +3178,9 @@ declare namespace Phaser { /** * The mid-point of the Camera in 'world' coordinates. - * + * * Use it to obtain exactly where in the world the center of the camera is currently looking. - * + * * This value is updated in the preRender method, after the scroll values and follower * have been processed. */ @@ -3188,24 +3188,24 @@ declare namespace Phaser { /** * The horizontal origin of rotation for this Camera. - * + * * By default the camera rotates around the center of the viewport. - * + * * Changing the origin allows you to adjust the point in the viewport from which rotation happens. * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. - * + * * See `setOrigin` to set both origins in a single, chainable call. */ originX: number; /** * The vertical origin of rotation for this Camera. - * + * * By default the camera rotates around the center of the viewport. - * + * * Changing the origin allows you to adjust the point in the viewport from which rotation happens. * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. - * + * * See `setOrigin` to set both origins in a single, chainable call. */ originY: number; @@ -3219,9 +3219,9 @@ declare namespace Phaser { /** * This array is populated with all of the Game Objects that this Camera has rendered * in the previous (or current, depending on when you inspect it) frame. - * + * * It is cleared at the start of `Camera.preUpdate`, or if the Camera is destroyed. - * + * * You should not modify this array as it is used internally by the input system, * however you can read it as required. Note that Game Objects may appear in this * list multiple times if they belong to multiple non-exclusive Containers. @@ -3244,7 +3244,7 @@ declare namespace Phaser { /** * Can this Camera render rounded pixel values? - * + * * This property is updated during the `preRender` method and should not be * set directly. It is set based on the `roundPixels` property of the Camera * combined with the zoom level. If the zoom is an integer then the WebGL @@ -3271,11 +3271,11 @@ declare namespace Phaser { /** * Sets the rotation origin of this Camera. - * + * * The values are given in the range 0 to 1 and are only used when calculating Camera rotation. - * + * * By default the camera rotates around the center of the viewport. - * + * * Changing the origin allows you to adjust the point in the viewport from which rotation happens. * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. * @param x The horizontal origin value. Default 0.5. @@ -3381,7 +3381,7 @@ declare namespace Phaser { /** * Set the rotation of this Camera. This causes everything it renders to appear rotated. - * + * * Rotating a camera does not rotate the viewport itself, it is applied during rendering. * @param value The camera's angle of rotation, given in degrees. Default 0. * @returns This Camera instance. @@ -3390,10 +3390,10 @@ declare namespace Phaser { /** * Sets the background color for this Camera. - * + * * By default a Camera has a transparent background but it can be given a solid color, with any level * of transparency, via this method. - * + * * The color value can be specified using CSS color notation, hex or numbers. * @param color The color value. In CSS, hex or numeric color notation. Default 'rgba(0,0,0,0)'. * @returns This Camera instance. @@ -3402,15 +3402,15 @@ declare namespace Phaser { /** * Set the bounds of the Camera. The bounds are an axis-aligned rectangle. - * + * * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the * edges and into blank space. It does not limit the placement of Game Objects, or where * the Camera viewport can be positioned. - * + * * Temporarily disable the bounds by changing the boolean `Camera.useBounds`. - * + * * Clear the bounds entirely by calling `Camera.removeBounds`. - * + * * If you set bounds that are smaller than the viewport it will stop the Camera from being * able to scroll. The bounds can be positioned where-ever you wish. By default they are from * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of @@ -3439,9 +3439,9 @@ declare namespace Phaser { /** * Returns a rectangle containing the bounds of the Camera. - * + * * If the Camera does not have any bounds the rectangle will be empty. - * + * * The rectangle is a copy of the bounds, so is safe to modify. * @param out An optional Rectangle to store the bounds in. If not given, a new Rectangle will be created. * @returns A rectangle containing the bounds of this Camera. @@ -3458,7 +3458,7 @@ declare namespace Phaser { /** * Set the position of the Camera viewport within the game. - * + * * This does not change where the camera is 'looking'. See `setScroll` to control that. * @param x The top-left x coordinate of the Camera viewport. * @param y The top-left y coordinate of the Camera viewport. Default x. @@ -3468,7 +3468,7 @@ declare namespace Phaser { /** * Set the rotation of this Camera. This causes everything it renders to appear rotated. - * + * * Rotating a camera does not rotate the viewport itself, it is applied during rendering. * @param value The rotation of the Camera, in radians. Default 0. * @returns This Camera instance. @@ -3477,7 +3477,7 @@ declare namespace Phaser { /** * Should the Camera round pixel values to whole integers when rendering Game Objects? - * + * * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing. * @param value `true` to round Camera pixels, `false` to not. * @returns This Camera instance. @@ -3496,7 +3496,7 @@ declare namespace Phaser { * Set the position of where the Camera is looking within the game. * You can also modify the properties `Camera.scrollX` and `Camera.scrollY` directly. * Use this method, or the scroll properties, to move your camera around the game world. - * + * * This does not change where the camera viewport is placed. See `setPosition` to control that. * @param x The x coordinate of the Camera in the game world. * @param y The y coordinate of the Camera in the game world. Default x. @@ -3506,7 +3506,7 @@ declare namespace Phaser { /** * Set the size of the Camera viewport. - * + * * By default a Camera is the same size as the game, but can be made smaller via this method, * allowing you to create mini-cam style effects by creating and positioning a smaller Camera * viewport within your game. @@ -3518,11 +3518,11 @@ declare namespace Phaser { /** * This method sets the position and size of the Camera viewport in a single call. - * + * * If you're trying to change where the Camera is looking at in your game, then see * the method `Camera.setScroll` instead. This method is for changing the viewport * itself, not what the camera can see. - * + * * By default a Camera is the same size as the game, but can be made smaller via this method, * allowing you to create mini-cam style effects by creating and positioning a smaller Camera * viewport within your game. @@ -3546,14 +3546,14 @@ declare namespace Phaser { /** * Set the zoom value of the Camera. - * + * * Changing to a smaller value, such as 0.5, will cause the camera to 'zoom out'. * Changing to a larger value, such as 2, will cause the camera to 'zoom in'. - * + * * A value of 1 means 'no zoom' and is the default. - * + * * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. - * + * * As of Phaser 3.50 you can now set the horizontal and vertical zoom values independently. * @param x The horizontal zoom value of the Camera. The minimum it can be is 0.001. Default 1. * @param y The vertical zoom value of the Camera. The minimum it can be is 0.001. Default x. @@ -3569,7 +3569,7 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Camera it will be immediately replaced. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Camera will use when rendering. @@ -3587,7 +3587,7 @@ declare namespace Phaser { /** * Sets the visibility of this Camera. - * + * * An invisible Camera will skip rendering and input tests of everything it can see. * @param value The visible state of the Camera. * @returns This Camera instance. @@ -3617,9 +3617,9 @@ declare namespace Phaser { /** * Destroys this Camera instance and its internal properties and references. * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager. - * + * * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default. - * + * * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction, * rather than calling this method directly. */ @@ -3641,7 +3641,7 @@ declare namespace Phaser { /** * The width of the Camera viewport, in pixels. - * + * * The viewport is the area into which the Camera renders. Setting the viewport does * not restrict where the Camera can scroll to. */ @@ -3649,7 +3649,7 @@ declare namespace Phaser { /** * The height of the Camera viewport, in pixels. - * + * * The viewport is the area into which the Camera renders. Setting the viewport does * not restrict where the Camera can scroll to. */ @@ -3657,63 +3657,63 @@ declare namespace Phaser { /** * The horizontal scroll position of this Camera. - * + * * Change this value to cause the Camera to scroll around your Scene. - * + * * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, * will automatically adjust the Camera scroll values accordingly. - * + * * You can set the bounds within which the Camera can scroll via the `setBounds` method. */ scrollX: number; /** * The vertical scroll position of this Camera. - * + * * Change this value to cause the Camera to scroll around your Scene. - * + * * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, * will automatically adjust the Camera scroll values accordingly. - * + * * You can set the bounds within which the Camera can scroll via the `setBounds` method. */ scrollY: number; /** * The Camera zoom value. Change this value to zoom in, or out of, a Scene. - * + * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel * now takes up 2 pixels when rendered. - * + * * Set to 1 to return to the default zoom level. - * + * * Be careful to never set this value to zero. */ zoom: number; /** * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. - * + * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel * now takes up 2 pixels when rendered. - * + * * Set to 1 to return to the default zoom level. - * + * * Be careful to never set this value to zero. */ zoomX: number; /** * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. - * + * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel * now takes up 2 pixels when rendered. - * + * * Set to 1 to return to the default zoom level. - * + * * Be careful to never set this value to zero. */ zoomY: number; @@ -3730,10 +3730,10 @@ declare namespace Phaser { /** * The displayed width of the camera viewport, factoring in the camera zoom level. - * + * * If a camera has a viewport width of 800 and a zoom of 0.5 then its display width * would be 1600, as it's displaying twice as many pixels as zoom level 1. - * + * * Equally, a camera with a width of 800 and zoom of 2 would have a display width * of 400 pixels. */ @@ -3741,10 +3741,10 @@ declare namespace Phaser { /** * The displayed height of the camera viewport, factoring in the camera zoom level. - * + * * If a camera has a viewport height of 600 and a zoom of 0.5 then its display height * would be 1200, as it's displaying twice as many pixels as zoom level 1. - * + * * Equally, a camera with a height of 600 and zoom of 2 would have a display height * of 300 pixels. */ @@ -3768,9 +3768,9 @@ declare namespace Phaser { * * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, * and can be positioned, rotated, zoomed and scrolled accordingly. - * + * * A Camera consists of two elements: The viewport and the scroll values. - * + * * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are * created the same size as your game, but their position and size can be set to anything. This means if you * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, @@ -3784,10 +3784,10 @@ declare namespace Phaser { * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the * viewport, and changing the viewport has no impact on the scrolling. - * + * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. - * + * * A Camera also has built-in special effects including Fade, Flash and Camera Shake. * * You can apply full-camera filters. @@ -3797,7 +3797,7 @@ declare namespace Phaser { */ class Camera extends Phaser.Cameras.Scene2D.BaseCamera { /** - * + * * @param x The x position of the Camera, relative to the top-left of the game canvas. * @param y The y position of the Camera, relative to the top-left of the game canvas. * @param width The width of the Camera, in pixels. @@ -3864,14 +3864,14 @@ declare namespace Phaser { /** * The linear interpolation value to use when following a target. - * + * * Can also be set via `setLerp` or as part of the `startFollow` call. * * The default value of 1 means the camera will instantly snap to the target coordinates. * A lower value, such as 0.1 means the camera will more slowly track the target, giving * a smooth transition. You can set the horizontal and vertical values independently, and also * adjust this value in real-time during your game. - * + * * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. */ lerp: Phaser.Math.Vector2; @@ -3885,20 +3885,20 @@ declare namespace Phaser { /** * The Camera dead zone. - * + * * The deadzone is only used when the camera is following a target. - * + * * It defines a rectangular region within which if the target is present, the camera will not scroll. * If the target moves outside of this area, the camera will begin scrolling in order to follow it. - * + * * The `lerp` values that you can set for a follower target also apply when using a deadzone. - * + * * You can directly set this property to be an instance of a Rectangle. Or, you can use the * `setDeadzone` method for a chainable approach. - * + * * The rectangle you provide can have its dimensions adjusted dynamically, however, please * note that its position is updated every frame, as it is constantly re-centered on the cameras mid point. - * + * * Calling `setDeadzone` with no arguments will reset an active deadzone, as will setting this property * to `null`. */ @@ -3906,18 +3906,18 @@ declare namespace Phaser { /** * Sets the Camera dead zone. - * + * * The deadzone is only used when the camera is following a target. - * + * * It defines a rectangular region within which if the target is present, the camera will not scroll. * If the target moves outside of this area, the camera will begin scrolling in order to follow it. - * + * * The deadzone rectangle is re-positioned every frame so that it is centered on the mid-point * of the camera. This allows you to use the object for additional game related checks, such as * testing if an object is within it or not via a Rectangle.contains call. - * + * * The `lerp` values that you can set for a follower target also apply when using a deadzone. - * + * * Calling this method with no arguments will reset an active deadzone. * @param width The width of the deadzone rectangle in pixels. If not specified the deadzone is removed. * @param height The height of the deadzone rectangle in pixels. @@ -4095,12 +4095,12 @@ declare namespace Phaser { /** * Sets the linear interpolation value to use when following a target. - * + * * The default values of 1 means the camera will instantly snap to the target coordinates. * A lower value, such as 0.1 means the camera will more slowly track the target, giving * a smooth transition. You can set the horizontal and vertical values independently, and also * adjust this value in real-time during your game. - * + * * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. * @param x The horizontal linear interpolation value for the follow target. A value between 0 and 1. Default 1. * @param y The vertical linear interpolation value for the follow target. A value between 0 and 1. Default 1. @@ -4119,13 +4119,13 @@ declare namespace Phaser { /** * Sets the Camera to follow a Game Object. - * + * * When enabled the Camera will automatically adjust its scroll position to keep the target Game Object * in its center. - * + * * You can set the linear interpolation value used in the follow code. * Use low lerp values (such as 0.1) to automatically smooth the camera motion. - * + * * If you find you're getting a slight "jitter" effect when following an object it's probably to do with sub-pixel * rendering of the targets position. This can be rounded by setting the `roundPixels` argument to `true` to * force full pixel rounding rendering. Note that this can still be broken if you have specified a non-integer zoom @@ -4162,7 +4162,7 @@ declare namespace Phaser { /** * Destroys this Camera instance. You rarely need to call this directly. - * + * * Called by the Camera Manager. If you wish to destroy a Camera please use `CameraManager.remove` as * cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that. */ @@ -4180,37 +4180,37 @@ declare namespace Phaser { /** * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras. - * + * * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed * in your game config. - * + * * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add * the new Camera in using the `addExisting` method. - * + * * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly. - * + * * A Camera consists of two elements: The viewport and the scroll values. - * + * * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are * created the same size as your game, but their position and size can be set to anything. This means if you * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). - * + * * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the * viewport, and changing the viewport has no impact on the scrolling. - * + * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore * Game Objects, make sure it's one of the first 31 created. - * + * * A Camera also has built-in special effects including Fade, Flash, Camera Shake, Pan and Zoom. */ class CameraManager { /** - * + * * @param scene The Scene that owns the Camera Manager plugin. */ constructor(scene: Phaser.Scene); @@ -4245,11 +4245,11 @@ declare namespace Phaser { * A handy reference to the 'main' camera. By default this is the first Camera the * Camera Manager creates. You can also set it directly, or use the `makeMain` argument * in the `add` and `addExisting` methods. It allows you to access it from your game: - * + * * ```javascript * var cam = this.cameras.main; * ``` - * + * * Also see the properties `camera1`, `camera2` and so on. */ main: Phaser.Cameras.Scene2D.Camera; @@ -4264,19 +4264,19 @@ declare namespace Phaser { /** * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras. - * + * * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas. - * + * * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake, * pan and zoom. - * + * * By default Cameras are transparent and will render anything that they can see based on their `scrollX` * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after creation if required. - * + * * See the Camera class documentation for more details. * @param x The horizontal position of the Camera viewport. Default 0. * @param y The vertical position of the Camera viewport. Default 0. @@ -4290,15 +4290,15 @@ declare namespace Phaser { /** * Adds an existing Camera into the Camera Manager. - * + * * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after addition if required. - * + * * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the * manager. As long as it doesn't already exist in the manager it will be added then returned. - * + * * If this method returns `null` then the Camera already exists in this Camera Manager. * @param camera The Camera to be added to the Camera Manager. * @param makeMain Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. Default false. @@ -4308,7 +4308,7 @@ declare namespace Phaser { /** * Gets the total number of Cameras in this Camera Manager. - * + * * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. * @param isVisible Set to `true` to only include visible Cameras in the total. Default false. * @returns The total number of Cameras in this Camera Manager. @@ -4317,7 +4317,7 @@ declare namespace Phaser { /** * Populates this Camera Manager based on the given configuration object, or an array of config objects. - * + * * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure. * @param config A Camera configuration object, or an array of them, to be added to this Camera Manager. * @returns This Camera Manager instance. @@ -4326,7 +4326,7 @@ declare namespace Phaser { /** * Gets a Camera based on its name. - * + * * Camera names are optional and don't have to be set, so this method is only of any use if you * have given your Cameras unique names. * @param name The name of the Camera. @@ -4336,7 +4336,7 @@ declare namespace Phaser { /** * Returns an array of all cameras below the given Pointer. - * + * * The first camera in the array is the top-most camera in the camera list. * @param pointer The Pointer to check against. * @returns An array of cameras below the Pointer. @@ -4345,10 +4345,10 @@ declare namespace Phaser { /** * Removes the given Camera, or an array of Cameras, from this Camera Manager. - * + * * If found in the Camera Manager it will be immediately removed from the local cameras array. * If also currently the 'main' camera, 'main' will be reset to be camera 0. - * + * * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default. * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references * and internal data until destroyed or re-added to a Camera Manager. @@ -4360,7 +4360,7 @@ declare namespace Phaser { /** * The internal render method. This is called automatically by the Scene and should not be invoked directly. - * + * * It will iterate through all local cameras and render them in turn, as long as they're visible and have * an alpha level > 0. * @param renderer The Renderer that will render the children to this camera. @@ -4380,7 +4380,7 @@ declare namespace Phaser { /** * Resets this Camera Manager. - * + * * This will iterate through all current Cameras, destroying them all, then it will reset the * cameras array, reset the ID counter and create 1 new single camera using the default values.undefined * @returns The freshly created main Camera. @@ -4413,18 +4413,18 @@ declare namespace Phaser { namespace Effects { /** * A Camera Fade effect. - * + * * This effect will fade the camera viewport to the given color, over the duration specified. - * + * * Only the camera viewport is faded. None of the objects it is displaying are impacted, i.e. their colors do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect, if required. */ class Fade { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4441,7 +4441,7 @@ declare namespace Phaser { /** * Has this effect finished running? - * + * * This is different from `isRunning` because it remains set to `true` when the effect is over, * until the effect is either reset or started again. */ @@ -4518,18 +4518,18 @@ declare namespace Phaser { /** * A Camera Flash effect. - * + * * This effect will flash the camera viewport to the given color, over the duration specified. - * + * * Only the camera viewport is flashed. None of the objects it is displaying are impacted, i.e. their colors do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect, if required. */ class Flash { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4614,19 +4614,19 @@ declare namespace Phaser { /** * A Camera Pan effect. - * + * * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, * over the duration and with the ease specified. - * + * * Only the camera scroll is moved. None of the objects it is displaying are impacted, i.e. their positions do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect if required. */ class Pan { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4719,22 +4719,22 @@ declare namespace Phaser { * * This effect will rotate the Camera so that its viewport finishes at the given angle in radians, * over the duration and with the ease specified. - * + * * Camera rotation always takes place based on the Camera viewport. By default, rotation happens * in the center of the viewport. You can adjust this with the `originX` and `originY` properties. - * + * * Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not * rotate the Camera viewport itself, which always remains an axis-aligned rectangle. * * Only the camera is rotated. None of the objects it is displaying are impacted, i.e. their positions do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect if required. */ class RotateTo { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4831,18 +4831,18 @@ declare namespace Phaser { /** * A Camera Shake effect. - * + * * This effect will shake the camera viewport by a random amount, bounded by the specified intensity, each frame. - * + * * Only the camera viewport is moved. None of the objects it is displaying are impacted, i.e. their positions do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect if required. */ class Shake { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4932,7 +4932,7 @@ declare namespace Phaser { */ class Zoom { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -5016,17 +5016,17 @@ declare namespace Phaser { namespace Events { /** * The Destroy Camera Event. - * + * * This event is dispatched by a Camera instance when it is destroyed by the Camera Manager. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('cameradestroy', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.DESTROY, () => {}); * ``` @@ -5035,53 +5035,53 @@ declare namespace Phaser { /** * The Camera Fade In Complete Event. - * + * * This event is dispatched by a Camera instance when the Fade In Effect completes. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeincomplete', listener)`. */ const FADE_IN_COMPLETE: string; /** * The Camera Fade In Start Event. - * + * * This event is dispatched by a Camera instance when the Fade In Effect starts. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeinstart', listener)`. */ const FADE_IN_START: string; /** * The Camera Fade Out Complete Event. - * + * * This event is dispatched by a Camera instance when the Fade Out Effect completes. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeoutcomplete', listener)`. */ const FADE_OUT_COMPLETE: string; /** * The Camera Fade Out Start Event. - * + * * This event is dispatched by a Camera instance when the Fade Out Effect starts. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeoutstart', listener)`. */ const FADE_OUT_START: string; /** * The Camera Flash Complete Event. - * + * * This event is dispatched by a Camera instance when the Flash Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('cameraflashcomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.FLASH_COMPLETE, () => {}); * ``` @@ -5090,17 +5090,17 @@ declare namespace Phaser { /** * The Camera Flash Start Event. - * + * * This event is dispatched by a Camera instance when the Flash Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('cameraflashstart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.FLASH_START, () => {}); * ``` @@ -5109,28 +5109,28 @@ declare namespace Phaser { /** * The Camera Follower Update Event. - * + * * This event is dispatched by a Camera instance when it is following a * Game Object and the Camera position has been updated as a result of * that following. - * + * * Listen to it from a Camera instance using: `camera.on('followupdate', listener)`. */ const FOLLOW_UPDATE: string; /** * The Camera Pan Complete Event. - * + * * This event is dispatched by a Camera instance when the Pan Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerapancomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.PAN_COMPLETE, () => {}); * ``` @@ -5139,17 +5139,17 @@ declare namespace Phaser { /** * The Camera Pan Start Event. - * + * * This event is dispatched by a Camera instance when the Pan Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerapanstart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.PAN_START, () => {}); * ``` @@ -5158,7 +5158,7 @@ declare namespace Phaser { /** * The Camera Post-Render Event. - * + * * This event is dispatched by a Camera instance after is has finished rendering. * It is dispatched whether the Camera is rendering to a texture or to the main canvas. * @@ -5168,27 +5168,27 @@ declare namespace Phaser { /** * The Camera Pre-Render Event. - * + * * This event is dispatched by a Camera instance when it is about to render. * It is only dispatched if the Camera is rendering to a texture. - * + * * Listen to it from a Camera instance using: `camera.on('prerender', listener)`. */ const PRE_RENDER: string; /** * The Camera Rotate Complete Event. - * + * * This event is dispatched by a Camera instance when the Rotate Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerarotatecomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ROTATE_COMPLETE, () => {}); * ``` @@ -5197,17 +5197,17 @@ declare namespace Phaser { /** * The Camera Rotate Start Event. - * + * * This event is dispatched by a Camera instance when the Rotate Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerarotatestart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ROTATE_START, () => {}); * ``` @@ -5216,17 +5216,17 @@ declare namespace Phaser { /** * The Camera Shake Complete Event. - * + * * This event is dispatched by a Camera instance when the Shake Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerashakecomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.SHAKE_COMPLETE, () => {}); * ``` @@ -5235,17 +5235,17 @@ declare namespace Phaser { /** * The Camera Shake Start Event. - * + * * This event is dispatched by a Camera instance when the Shake Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerashakestart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.SHAKE_START, () => {}); * ``` @@ -5254,17 +5254,17 @@ declare namespace Phaser { /** * The Camera Zoom Complete Event. - * + * * This event is dispatched by a Camera instance when the Zoom Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerazoomcomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ZOOM_COMPLETE, () => {}); * ``` @@ -5273,17 +5273,17 @@ declare namespace Phaser { /** * The Camera Zoom Start Event. - * + * * This event is dispatched by a Camera instance when the Zoom Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerazoomstart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ZOOM_START, () => {}); * ``` @@ -5312,14 +5312,14 @@ declare namespace Phaser { * speed: float OR { x: 0, y: 0 } * }); * ``` - * + * * Movement is precise and has no 'smoothing' applied to it. - * + * * You must call the `update` method of this controller every frame. */ class FixedKeyControl { /** - * + * * @param config The Fixed Key Control configuration object. */ constructor(config: Phaser.Types.Cameras.Controls.FixedKeyControlConfig); @@ -5410,7 +5410,7 @@ declare namespace Phaser { /** * Applies the results of pressing the control keys to the Camera. - * + * * You must call this every step, it is not called automatically. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -5426,10 +5426,10 @@ declare namespace Phaser { /** * A Smoothed Key Camera Control. - * + * * This allows you to control the movement and zoom of a camera using the defined keys. * Unlike the Fixed Camera Control you can also provide physics values for acceleration, drag and maxSpeed for smoothing effects. - * + * * ```javascript * var controlConfig = { * camera: this.cameras.main, @@ -5445,12 +5445,12 @@ declare namespace Phaser { * maxSpeed: 1.0 * }; * ``` - * + * * You must call the `update` method of this controller every frame. */ class SmoothedKeyControl { /** - * + * * @param config The Smoothed Key Control configuration object. */ constructor(config: Phaser.Types.Cameras.Controls.SmoothedKeyControlConfig); @@ -5561,7 +5561,7 @@ declare namespace Phaser { /** * Applies the results of pressing the control keys to the Camera. - * + * * You must call this every step, it is not called automatically. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -5655,7 +5655,7 @@ declare namespace Phaser { * for handling the boot process, parsing the configuration values, creating the renderer, * and setting-up all of the global Phaser systems, such as sound and input. * Once that is complete it will start the Scene Manager and then begin the main game loop. - * + * * You should generally avoid accessing any of the systems created by Game, and instead use those * made available to you via the Phaser.Scene Systems class instead. */ @@ -5668,7 +5668,7 @@ declare namespace Phaser { /** * The parsed Game Configuration object. - * + * * The values stored within this object are read-only and should not be changed at run-time. */ readonly config: Phaser.Core.Config; @@ -5680,10 +5680,10 @@ declare namespace Phaser { /** * A reference to an HTML Div Element used as the DOM Element Container. - * + * * Only set if `createDOMContainer` is `true` in the game config (by default it is `false`) and * if you provide a parent element to insert the Phaser Game inside. - * + * * See the DOM Element Game Object for more details. */ domContainer: HTMLDivElement; @@ -5721,21 +5721,21 @@ declare namespace Phaser { /** * An instance of the Animation Manager. - * + * * The Animation Manager is a global system responsible for managing all animations used within your game. */ anims: Phaser.Animations.AnimationManager; /** * An instance of the Texture Manager. - * + * * The Texture Manager is a global system responsible for managing all textures being used by your game. */ textures: Phaser.Textures.TextureManager; /** * An instance of the Cache Manager. - * + * * The Cache Manager is a global system responsible for caching, accessing and releasing external game assets. */ cache: Phaser.Cache.CacheManager; @@ -5749,21 +5749,21 @@ declare namespace Phaser { /** * An instance of the Input Manager. - * + * * The Input Manager is a global system responsible for the capture of browser-level input events. */ input: Phaser.Input.InputManager; /** * An instance of the Scene Manager. - * + * * The Scene Manager is a global system responsible for creating, modifying and updating the Scenes in your game. */ scene: Phaser.Scenes.SceneManager; /** * A reference to the Device inspector. - * + * * Contains information about the device running this game, such as OS, browser vendor and feature support. * Used by various systems to determine capabilities and code paths. */ @@ -5771,23 +5771,23 @@ declare namespace Phaser { /** * An instance of the Scale Manager. - * + * * The Scale Manager is a global system responsible for handling scaling of the game canvas. */ scale: Phaser.Scale.ScaleManager; /** * An instance of the base Sound Manager. - * + * * The Sound Manager is a global system responsible for the playback and updating of all audio in your game. - * + * * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. */ sound: Phaser.Sound.NoAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager; /** * An instance of the Time Step. - * + * * The Time Step is a global system responsible for setting-up and responding to the browser frame events, processing * them and calculating delta values. It then automatically calls the game step. */ @@ -5795,7 +5795,7 @@ declare namespace Phaser { /** * An instance of the Plugin Manager. - * + * * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install * those plugins into Scenes as required. */ @@ -5831,9 +5831,9 @@ declare namespace Phaser { /** * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of * Request Animation Frame, or Set Timeout on very old browsers.) - * + * * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. - * + * * It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events. * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. @@ -5842,12 +5842,12 @@ declare namespace Phaser { /** * A special version of the Game Step for the HEADLESS renderer only. - * + * * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of * Request Animation Frame, or Set Timeout on very old browsers.) - * + * * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. - * + * * This process emits `prerender` and `postrender` events, even though nothing actually displays. * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. @@ -5862,9 +5862,9 @@ declare namespace Phaser { /** * This will pause the entire game and emit a `PAUSE` event. - * + * * All of Phaser's internal systems will be paused and the game will not re-render. - * + * * Note that it does not pause any Loader requests that are currently in-flight. */ pause(): void; @@ -5877,7 +5877,7 @@ declare namespace Phaser { /** * This will resume the entire game and emit a `RESUME` event. - * + * * All of Phaser's internal systems will be resumed and the game will start rendering again. */ resume(): void; @@ -5910,7 +5910,7 @@ declare namespace Phaser { /** * Flags this Game instance as needing to be destroyed on the _next frame_, making this an asynchronous operation. - * + * * It will wait until the current frame has completed and then call `runDestroy` internally. * * If you need to react to the game's eventual destruction, listen for the `DESTROY` event. @@ -5934,7 +5934,7 @@ declare namespace Phaser { */ class Config { /** - * + * * @param GameConfig The configuration object for your Phaser Game instance. */ constructor(GameConfig?: Phaser.Types.Core.GameConfig); @@ -6483,11 +6483,11 @@ declare namespace Phaser { /** * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame, * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser. - * + * * Each time the loop fires, `TimeStep.step` is called and this is then passed onto the core Game update loop, * it is the core heartbeat of your game. It will fire as often as Request Animation Frame is capable of handling * on the target device. - * + * * Note that there are lots of situations where a browser will stop updating your game. Such as if the player * switches tabs, or covers up the browser window with another application. In these cases, the 'heartbeat' * of your game will pause, and only resume when focus is returned to it by the player. There is no way to avoid @@ -6496,7 +6496,7 @@ declare namespace Phaser { */ class TimeStep { /** - * + * * @param game A reference to the Phaser.Game instance that owns this Time Step. * @param config The FPS configuration object, as parsed by the Game Config. */ @@ -6527,7 +6527,7 @@ declare namespace Phaser { /** * The minimum fps rate you want the Time Step to run at. - * + * * Setting this cannot guarantee the browser runs at this rate, it merely influences * the internal timing values to help the Timestep know when it has gone out of sync. */ @@ -6535,7 +6535,7 @@ declare namespace Phaser { /** * The target fps rate for the Time Step to run at. - * + * * Setting this value will not actually change the speed at which the browser runs, that is beyond * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step * is spiraling out of control. @@ -6546,27 +6546,27 @@ declare namespace Phaser { * Enforce a frame rate limit. This forces how often the Game step will run. By default it is zero, * which means it will run at whatever limit the browser (via RequestAnimationFrame) can handle, which * is the optimum rate for fast-action or responsive games. - * + * * However, if you are building a non-game app, like a graphics generator, or low-intensity game that doesn't * require 60fps, then you can lower the step rate via this Game Config value: - * + * * ```js * fps: { * limit: 30 * } * ``` - * + * * Setting this _beyond_ the rate of RequestAnimationFrame will make no difference at all. - * + * * Use it purely to _restrict_ updates in low-intensity situations only. */ fpsLimit: number; /** * Is the FPS rate limited? - * + * * This is set by setting the Game Config `limit` value to a value above zero. - * + * * Consider this property as read-only. */ hasFpsLimit: boolean; @@ -6578,7 +6578,7 @@ declare namespace Phaser { /** * The time at which the next fps rate update will take place. - * + * * When an fps update happens, the `framesThisSecond` value is reset. */ readonly nextFpsUpdate: number; @@ -6601,7 +6601,7 @@ declare namespace Phaser { /** * The time, updated each step by adding the elapsed delta time to the previous value. - * + * * This differs from the `TimeStep.now` value, which is the high resolution time value * as provided by Request Animation Frame. */ @@ -6609,14 +6609,14 @@ declare namespace Phaser { /** * The time at which the game started running. - * + * * This value is adjusted if the game is then paused and resumes. */ startTime: number; /** * The time of the previous step. - * + * * This is typically a high resolution timer value, as provided by Request Animation Frame. */ lastTime: number; @@ -6629,7 +6629,7 @@ declare namespace Phaser { /** * Is the browser currently considered in focus by the Page Visibility API? - * + * * This value is set in the `blur` method, which is called automatically by the Game instance. */ readonly inFocus: boolean; @@ -6656,7 +6656,7 @@ declare namespace Phaser { /** * The maximum number of delta values that are retained in order to calculate a smoothed moving average. - * + * * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. */ deltaSmoothingMax: number; @@ -6664,14 +6664,14 @@ declare namespace Phaser { /** * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually * as a result of switching tabs and regaining focus. - * + * * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. */ panicMax: number; /** * The actual elapsed time in ms between one update and the next. - * + * * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. * So please be careful when using this value in math calculations. */ @@ -6679,9 +6679,9 @@ declare namespace Phaser { /** * The time, set at the start of the current step. - * + * * This is typically a high resolution timer value, as provided by Request Animation Frame. - * + * * This can differ from the `time` value in that it isn't calculated based on the delta value. */ now: number; @@ -6690,7 +6690,7 @@ declare namespace Phaser { * Apply smoothing to the delta value used within Phaser's internal calculations? * * This can be changed in the Game Config via the `fps.smoothStep` property. The default is `true`. - * + * * Smoothing helps settle down the delta values after browser tab switches, or other situations * which could cause significant delta spikes or dips. By default it has been enabled in Phaser 3 * since the first version, but is now exposed under this property (and the corresponding game config @@ -6733,7 +6733,7 @@ declare namespace Phaser { /** * Takes the delta value and smooths it based on the previous frames. - * + * * Called automatically as part of the step. * @param delta The delta value for this step. * @returns The smoothed delta value. @@ -6746,7 +6746,7 @@ declare namespace Phaser { * moving average of all frames per second, with an alpha of 0.25. This * means that more recent seconds affect the estimated frame rate more than * older seconds. - * + * * When a browser window is NOT minimized, but is covered up (i.e. you're using * another app which has spawned a window over the top of the browser), then it * will start to throttle the raf callback time. It waits for a while, and then @@ -6756,11 +6756,11 @@ declare namespace Phaser { * * When they make the game visible again, the frame rate is increased at a rate of * approx. 8fps, back up to 60fps (or the max it can obtain) - * + * * There is no easy way to determine if this drop in frame rate is because the * browser is throttling raf, or because the game is struggling with performance * because you're asking it to do too much on the device. - * + * * Compute the new exponential moving average with an alpha of 0.25. * @param time The timestamp passed in from RequestAnimationFrame or setTimeout. */ @@ -7001,7 +7001,7 @@ declare namespace Phaser { */ class CubicBezier extends Phaser.Curves.Curve { /** - * + * * @param p0 Start point, or an array of point pairs. * @param p1 Control Point 1. * @param p2 Control Point 2. @@ -7090,7 +7090,7 @@ declare namespace Phaser { */ class Curve { /** - * + * * @param type The curve type. */ constructor(type: string); @@ -7127,7 +7127,7 @@ declare namespace Phaser { /** * Draws this curve on the given Graphics object. - * + * * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is. * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. * @param graphics The Graphics instance onto which this curve will be drawn. @@ -7138,7 +7138,7 @@ declare namespace Phaser { /** * Returns a Rectangle where the position and dimensions match the bounds of this Curve. - * + * * You can control the accuracy of the bounds. The value given is used to work out how many points * to plot across the curve. Higher values are more accurate at the cost of calculation speed. * @param out The Rectangle to store the bounds in. If falsey a new object will be created. @@ -7193,15 +7193,15 @@ declare namespace Phaser { /** * Get a sequence of evenly spaced points from the curve. - * + * * You can pass `divisions`, `stepRate`, or neither. - * + * * The number of divisions will be - * + * * 1. `divisions`, if `divisions` > 0; or * 2. `this.getLength / stepRate`, if `stepRate` > 0; or * 3. `this.defaultDivisions` - * + * * `1 + divisions` points will be returned. * @param divisions The number of divisions to make. * @param stepRate The curve distance between points, implying `divisions`. @@ -7219,7 +7219,7 @@ declare namespace Phaser { /** * Get a sequence of equally spaced points (by arc distance) from the curve. - * + * * `1 + divisions` points will be returned. * @param divisions The number of divisions to make. Default this.defaultDivisions. * @param stepRate Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. @@ -7294,7 +7294,7 @@ declare namespace Phaser { */ class Ellipse extends Phaser.Curves.Curve { /** - * + * * @param x The x coordinate of the ellipse, or an Ellipse Curve configuration object. Default 0. * @param y The y coordinate of the ellipse. Default 0. * @param xRadius The horizontal radius of ellipse. Default 0. @@ -7459,7 +7459,7 @@ declare namespace Phaser { */ class Line extends Phaser.Curves.Curve { /** - * + * * @param p0 The first endpoint. * @param p1 The second endpoint. */ @@ -7539,7 +7539,7 @@ declare namespace Phaser { /** * Draws this curve on the given Graphics object. - * + * * The curve is drawn using `Graphics.lineBetween` so will be drawn at whatever the present Graphics line color is. * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. * @param graphics The Graphics instance onto which this curve will be drawn. @@ -8054,7 +8054,7 @@ declare namespace Phaser { */ class DataManager { /** - * + * * @param parent The object that this DataManager belongs to. * @param eventEmitter The DataManager's event emitter. */ @@ -8079,13 +8079,13 @@ declare namespace Phaser { * The public values list. You can use this to access anything you have stored * in this Data Manager. For example, if you set a value called `gold` you can * access it via: - * + * * ```javascript * this.data.values.gold; * ``` - * + * * You can also modify it directly: - * + * * ```javascript * this.data.values.gold += 1000; * ``` @@ -8099,25 +8099,25 @@ declare namespace Phaser { /** * Retrieves the value for the given key, or undefined if it doesn't exist. - * + * * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * + * * ```javascript * this.data.get('gold'); * ``` - * + * * Or access the value directly: - * + * * ```javascript * this.data.values.gold; * ``` - * + * * You can also pass in an array of keys, in which case an array of values will be returned: - * + * * ```javascript * this.data.get([ 'gold', 'armor', 'health' ]); * ``` - * + * * This approach is useful for destructuring arrays in ES6. * @param key The key of the value to retrieve, or an array of keys. * @returns The value belonging to the given key, or an array of values, the order of which will match the input array. @@ -8139,35 +8139,35 @@ declare namespace Phaser { /** * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * + * * ```javascript * data.set('name', 'Red Gem Stone'); * ``` - * + * * You can also pass in an object of key value pairs as the first argument: - * + * * ```javascript * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); * ``` - * + * * To get a value back again you can call `get`: - * + * * ```javascript * data.get('gold'); * ``` - * + * * Or you can access the value directly via the `values` property, where it works like any other variable: - * + * * ```javascript * data.values.gold += 50; * ``` - * + * * When the value is first set, a `setdata` event is emitted. - * + * * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * + * * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @param key The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. @@ -8210,7 +8210,7 @@ declare namespace Phaser { /** * Merge the given object of key value pairs into this DataManager. - * + * * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) * will emit a `changedata` event. * @param data The data to merge. @@ -8221,12 +8221,12 @@ declare namespace Phaser { /** * Remove the value for the given key. - * + * * If the key is found in this Data Manager it is removed from the internal lists and a * `removedata` event is emitted. - * + * * You can also pass in an array of keys, in which case all keys in the array will be removed: - * + * * ```javascript * this.data.remove([ 'gold', 'armor', 'health' ]); * ``` @@ -8244,7 +8244,7 @@ declare namespace Phaser { /** * Determines whether the given key is set in this Data Manager. - * + * * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @param key The key to check. @@ -8295,7 +8295,7 @@ declare namespace Phaser { */ class DataManagerPlugin extends Phaser.Data.DataManager { /** - * + * * @param scene A reference to the Scene that this DataManager belongs to. */ constructor(scene: Phaser.Scene); @@ -8322,12 +8322,12 @@ declare namespace Phaser { namespace Events { /** * The Change Data Event. - * + * * This event is dispatched by a Data Manager when an item in the data store is changed. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * a change data event from a Game Object you would use: `sprite.on('changedata', listener)`. - * + * * This event is dispatched for all items that change in the Data Manager. * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. */ @@ -8335,9 +8335,9 @@ declare namespace Phaser { /** * The Change Data Key Event. - * + * * This event is dispatched by a Data Manager when an item in the data store is changed. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * the change of a specific data item from a Game Object you would use: `sprite.on('changedata-key', listener)`, * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` @@ -8347,16 +8347,16 @@ declare namespace Phaser { /** * The Data Manager Destroy Event. - * + * * The Data Manager will listen for the destroy event from its parent, and then close itself down. */ const DESTROY: string; /** * The Remove Data Event. - * + * * This event is dispatched by a Data Manager when an item is removed from it. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * the removal of a data item on a Game Object you would use: `sprite.on('removedata', listener)`. */ @@ -8364,9 +8364,9 @@ declare namespace Phaser { /** * The Set Data Event. - * + * * This event is dispatched by a Data Manager when a new item is added to the data store. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * the addition of a new data item on a Game Object you would use: `sprite.on('setdata', listener)`. */ @@ -8728,9 +8728,9 @@ declare namespace Phaser { /** * Determines the video support of the browser running this Phaser Game instance. - * + * * These values are read-only and populated during the boot sequence of the game. - * + * * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.video` from within any Scene. */ @@ -10215,7 +10215,7 @@ declare namespace Phaser { */ class Color { /** - * + * * @param red The red color value. A number between 0 and 255. Default 0. * @param green The green color value. A number between 0 and 255. Default 0. * @param blue The blue color value. A number between 0 and 255. Default 0. @@ -10489,9 +10489,9 @@ declare namespace Phaser { /** * Converts a HSV (hue, saturation and value) color set to RGB. - * + * * Conversion formula from https://en.wikipedia.org/wiki/HSL_and_HSV - * + * * Assumes HSV values are contained in the set [0, 1]. * @param h The hue, in the range 0 - 1. This is the base color. * @param s The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you a greyscale color. @@ -10553,7 +10553,7 @@ declare namespace Phaser { /** * Converts a CSS 'web' string into a Phaser Color object. - * + * * The web string can be in the format `'rgb(r,g,b)'` or `'rgba(r,g,b,a)'` where r/g/b are in the range [0..255] and a is in the range [0..1]. * @param rgb The CSS format color string, using the `rgb` or `rgba` format. * @param color An optional Color object to populate with the parsed values. If not provided, a new Color object is created and returned. @@ -10617,12 +10617,12 @@ declare namespace Phaser { * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). - * + * * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and * alpha of the pixel from the Geometry Mask do not matter. - * + * * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility * of any masked objects), whereas moving or transforming a masked object will not affect the mask. @@ -10636,7 +10636,7 @@ declare namespace Phaser { */ class GeometryMask { /** - * + * * @param scene This parameter is not used. * @param graphicsGeometry The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. */ @@ -10670,7 +10670,7 @@ declare namespace Phaser { /** * Destroys this GeometryMask and nulls any references it holds. - * + * * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, * so be sure to call `clearMask` on any Game Object using it, before destroying it. */ @@ -10692,13 +10692,13 @@ declare namespace Phaser { * * BaseShaders are stored in the Shader Cache, available in a Scene via `this.cache.shaders` and are referenced * by a unique key-based string. Retrieve them via `this.cache.shaders.get(key)`. - * + * * BaseShaders are created automatically by the GLSL File Loader when loading an external shader resource. * They can also be created at runtime, allowing you to use dynamically generated shader source code. */ class BaseShader { /** - * + * * @param key The key of this shader. Must be unique within the shader cache. * @param glsl The GLSL source code for the shader. * @param metadata Additional metadata for this shader code. @@ -10858,14 +10858,14 @@ declare namespace Phaser { /** * The RAF step function. - * + * * Invokes the callback and schedules another call to requestAnimationFrame. */ step: FrameRequestCallback; /** * The SetTimeout step function. - * + * * Invokes the callback and schedules another call to setTimeout. */ stepTimeout: Function; @@ -11194,9 +11194,9 @@ declare namespace Phaser { /** * The quality of the blur effect. - * + * * This can be: - * + * * 0 for Low Quality * 1 for Medium Quality * 2 for High Quality @@ -11205,7 +11205,7 @@ declare namespace Phaser { * and the more processing time is spent on the GPU calculating * the final blur. This value is used in conjunction with the * `steps` value, as one has a direct impact on the other. - * + * * Keep this value as low as you can, while still achieving the * desired effect you need for your game. */ @@ -11277,7 +11277,7 @@ declare namespace Phaser { * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. - * + * * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature * effect by blurring everything except a small area of the image. This effect is achieved by blurring the * top and bottom elements, while keeping the center area in focus. @@ -11311,7 +11311,7 @@ declare namespace Phaser { /** * The radius of the bokeh effect. - * + * * This is a float value, where a radius of 0 will result in no effect being applied, * and a radius of 1 will result in a strong bokeh. However, you can exceed this value * for even stronger effects. @@ -11341,14 +11341,14 @@ declare namespace Phaser { /** * If a Tilt Shift effect this controls the amount of horizontal blur. - * + * * Setting this value on a non-Tilt Shift effect will have no effect. */ blurX: number; /** * If a Tilt Shift effect this controls the amount of vertical blur. - * + * * Setting this value on a non-Tilt Shift effect will have no effect. */ blurY: number; @@ -15828,43 +15828,53 @@ declare namespace Phaser { * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} */ - class DynamicBitmapText extends Phaser.GameObjects.BitmapText { + function BuildGameObject(scene: Phaser.Scene, gameObject: Phaser.GameObjects.GameObject, config: Phaser.Types.GameObjects.GameObjectConfig): Phaser.GameObjects.GameObject; + + /** + * Adds an Animation component to a Sprite and populates it based on the given config. + * @param sprite The sprite to add an Animation component to. + * @param config The animation config. + */ + function BuildGameObjectAnimation(sprite: Phaser.GameObjects.Sprite, config: object): Phaser.GameObjects.Sprite; + + /** + * The Display List plugin. + * + * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame. + * + * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating. + */ + class DisplayList extends Phaser.Structs.List { /** - * - * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. - * @param x The x coordinate of this Game Object in world space. - * @param y The y coordinate of this Game Object in world space. - * @param font The key of the font to use from the Bitmap Font cache. - * @param text The string, or array of strings, to be set as the content of this Bitmap Text. - * @param size The font size of this Bitmap Text. - * @param align The alignment of the text in a multi-line BitmapText object. Default 0. + * + * @param scene The Scene that this Display List belongs to. */ - constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: number); + constructor(scene: Phaser.Scene); /** - * The horizontal scroll position of the Bitmap Text. + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. */ - scrollX: number; + sortChildrenFlag: boolean; /** - * The vertical scroll position of the Bitmap Text. + * The Scene that this Display List belongs to. */ - scrollY: number; + scene: Phaser.Scene; /** - * The crop width of the Bitmap Text. + * The Scene's Systems. */ - cropWidth: number; + systems: Phaser.Scenes.Systems; /** - * The crop height of the Bitmap Text. + * The Scene's Event Emitter. */ - cropHeight: number; + events: Phaser.Events.EventEmitter; /** - * A callback that alters how each character of the Bitmap Text is rendered. + * Force a sort of the display list on the next call to depthSort. */ - displayCallback: Phaser.Types.GameObjects.BitmapText.DisplayCallback; + queueDepthSort(): void; /** * The data object that is populated during rendering, then passed to the displayCallback. @@ -15874,7 +15884,7 @@ declare namespace Phaser { * Please note that if you need a reference to this object locally in your game code then you * should shallow copy it, as it's updated and re-used for every glyph in the text. */ - callbackData: Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig; + depthSort(): void; /** * Set the crop size of this Bitmap Text. @@ -15882,7 +15892,7 @@ declare namespace Phaser { * @param height The height of the crop. * @returns This Game Object. */ - setSize(width: number, height: number): this; + sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): number; /** * Set a callback that alters how each character of the Bitmap Text is rendered. @@ -15895,21 +15905,36 @@ declare namespace Phaser { * @param callback The display callback to set. * @returns This Game Object. */ - setDisplayCallback(callback: Phaser.Types.GameObjects.BitmapText.DisplayCallback): this; + getChildren(): Phaser.GameObjects.GameObject[]; + + } + + /** + * The base class that all Game Objects extend. + * You don't create GameObjects directly and they cannot be added to the display list. + * Instead, use them as the base for your own custom classes. + */ + class GameObject extends Phaser.Events.EventEmitter { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param type A textual representation of the type of Game Object, i.e. `sprite`. + */ + constructor(scene: Phaser.Scene, type: string); /** * Set the horizontal scroll position of this Bitmap Text. * @param value The horizontal scroll position to set. * @returns This Game Object. */ - setScrollX(value: number): this; + scene: Phaser.Scene; /** * Set the vertical scroll position of this Bitmap Text. * @param value The vertical scroll position to set. * @returns This Game Object. */ - setScrollY(value: number): this; + displayList: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer; /** * The Camera used for filters. @@ -16138,7 +16163,7 @@ declare namespace Phaser { * Immediately sets the alpha levels back to 1 (fully opaque).undefined * @returns This Game Object instance. */ - clearAlpha(): this; + type: string; /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. @@ -16152,7 +16177,7 @@ declare namespace Phaser { * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. * @returns This Game Object instance. */ - setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + state: number | string; /** * The alpha value of the Game Object, between 0 (fully transparent) and 1 (fully opaque). @@ -16161,31 +16186,33 @@ declare namespace Phaser { * all four corner alpha values (`alphaTopLeft`, `alphaTopRight`, `alphaBottomLeft`, * `alphaBottomRight`) to the same value. The input is clamped to the range [0, 1]. */ - alpha: number; + parentContainer: Phaser.GameObjects.Container; /** - * The alpha value starting from the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. */ - alphaTopLeft: number; + name: string; /** - * The alpha value starting from the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. */ - alphaTopRight: number; + active: boolean; /** - * The alpha value starting from the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. + * The Tab Index of the Game Object. + * Reserved for future use by plugins and the Input Manager. */ - alphaBottomLeft: number; + tabIndex: number; /** - * The alpha value starting from the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. */ - alphaBottomRight: number; + data: Phaser.Data.DataManager; /** * Sets the Blend Mode being used by this Game Object. @@ -16209,7 +16236,7 @@ declare namespace Phaser { * reasons try to be careful about the construction of your Scene and the frequency with which blend modes * are used. */ - blendMode: Phaser.BlendModes | string | number; + renderFlags: number; /** * Sets the Blend Mode being used by this Game Object. @@ -16235,20 +16262,13 @@ declare namespace Phaser { * @param value The BlendMode value. Either a string, a CONST or a number. * @returns This Game Object instance. */ - setBlendMode(value: string | Phaser.BlendModes | number): this; + cameraFilter: number; /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. + * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. + * Not usually set directly. Instead call `GameObject.setInteractive()`. */ - depth: number; + input: Phaser.Types.Input.InteractiveObject | null; /** * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. @@ -16262,7 +16282,7 @@ declare namespace Phaser { * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. * @returns This Game Object instance. */ - setDepth(value: number): this; + body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody | MatterJS.BodyType | null; /** * Sets this Game Object to be at the top of the display list, or the top of its parent container. @@ -16272,7 +16292,7 @@ declare namespace Phaser { * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined * @returns This Game Object instance. */ - setToTop(): this; + ignoreDestroy: boolean; /** * Sets this Game Object to the back of the display list, or the back of its parent container. @@ -16282,7 +16302,7 @@ declare namespace Phaser { * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined * @returns This Game Object instance. */ - setToBack(): this; + setActive(value: boolean): this; /** * Move this Game Object so that it appears above the given Game Object. @@ -16295,7 +16315,7 @@ declare namespace Phaser { * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; + setName(value: string): this; /** * Move this Game Object so that it appears below the given Game Object. @@ -16308,7 +16328,7 @@ declare namespace Phaser { * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; + setState(value: number | string): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -16319,7 +16339,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getCenter(output?: O, includeParent?: boolean): O; + setDataEnabled(): this; /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. @@ -16330,7 +16350,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getTopLeft(output?: O, includeParent?: boolean): O; + setData(key: (string|T), data?: any): this; /** * Gets the top-center coordinate of this Game Object, regardless of origin. @@ -16341,7 +16361,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getTopCenter(output?: O, includeParent?: boolean): O; + incData(key: string, amount?: number): this; /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. @@ -16352,7 +16372,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getTopRight(output?: O, includeParent?: boolean): O; + toggleData(key: string): this; /** * Gets the left-center coordinate of this Game Object, regardless of origin. @@ -16363,7 +16383,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getLeftCenter(output?: O, includeParent?: boolean): O; + getData(key: string | string[]): any; /** * Gets the right-center coordinate of this Game Object, regardless of origin. @@ -16374,7 +16394,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getRightCenter(output?: O, includeParent?: boolean): O; + setInteractive(hitArea?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. @@ -16385,7 +16405,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getBottomLeft(output?: O, includeParent?: boolean): O; + disableInteractive(resetCursor?: boolean): this; /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. @@ -16396,7 +16416,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getBottomCenter(output?: O, includeParent?: boolean): O; + removeInteractive(resetCursor?: boolean): this; /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. @@ -16407,7 +16427,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getBottomRight(output?: O, includeParent?: boolean): O; + addedToScene(): void; /** * Gets the axis-aligned bounding rectangle of this Game Object, regardless of origin. @@ -16421,7 +16441,7 @@ declare namespace Phaser { * @param output An object to store the values in. If not provided a new Rectangle will be created. * @returns The values stored in the output object. */ - getBounds(output?: O): O; + removedFromScene(): void; /** * Controls whether this Game Object participates in the WebGL lighting system. @@ -16501,7 +16521,7 @@ declare namespace Phaser { * @param destroyMask Destroy the mask before clearing it? Default false. * @returns This Game Object instance. */ - clearMask(destroyMask?: boolean): this; + willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, @@ -16519,23 +16539,15 @@ declare namespace Phaser { * @param graphics A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. * @returns This Geometry Mask that was created. */ - createGeometryMask(graphics?: Phaser.GameObjects.Graphics | Phaser.GameObjects.Shape): Phaser.Display.Masks.GeometryMask; + protected scene: Phaser.Scene; /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - * Set this value with `setOrigin()`. + * A reference to the Scene.Systems. */ originX: number; /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. - * Set this value with `setOrigin()`. + * A reference to the Scene Event Emitter. */ originY: number; @@ -16545,7 +16557,7 @@ declare namespace Phaser { * calculated pixel offset derived from the Game Object's width multiplied by its `originX` value. * Setting this property updates `originX` accordingly. */ - displayOriginX: number; + protected displayList: Phaser.GameObjects.DisplayList; /** * The vertical display origin of this Game Object, expressed in pixels. @@ -16553,7 +16565,7 @@ declare namespace Phaser { * calculated pixel offset derived from the Game Object's height multiplied by its `originY` value. * Setting this property updates `originY` accordingly. */ - displayOriginY: number; + protected updateList: Phaser.GameObjects.UpdateList; /** * Sets the origin of this Game Object. @@ -16563,7 +16575,7 @@ declare namespace Phaser { * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. * @returns This Game Object instance. */ - setOrigin(x?: number, y?: number): this; + existing(child: G): G; /** * Sets the origin of this Game Object based on the Pivot values in its Frame. @@ -16572,7 +16584,7 @@ declare namespace Phaser { * resetting the origin to the default value of 0.5 for both axes.undefined * @returns This Game Object instance. */ - setOriginFromFrame(): this; + static register(factoryType: string, factoryFunction: Function): void; /** * Sets the display origin of this Game Object. @@ -16581,7 +16593,7 @@ declare namespace Phaser { * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. * @returns This Game Object instance. */ - setDisplayOrigin(x?: number, y?: number): this; + static remove(factoryType: string): void; /** * Customized WebGL render nodes of this Game Object. @@ -16667,7 +16679,7 @@ declare namespace Phaser { * the scroll factor is a visual adjustment to where the textures are rendered, which can offset * them from physics bodies if not accounted for in your code. */ - scrollFactorX: number; + particles(x?: number, y?: number, texture?: string | Phaser.Textures.Texture, config?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): Phaser.GameObjects.Particles.ParticleEmitter; /** * The vertical scroll factor of this Game Object. @@ -16686,7 +16698,7 @@ declare namespace Phaser { * the scroll factor is a visual adjustment to where the textures are rendered, which can offset * them from physics bodies if not accounted for in your code. */ - scrollFactorY: number; + follower(path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.PathFollower; /** * Sets the horizontal and vertical scroll factor of this Game Object. If only the `x` value is @@ -16710,17 +16722,68 @@ declare namespace Phaser { * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. * @returns This Game Object instance. */ - setScrollFactor(x: number, y?: number): this; + plane(x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number, width?: number, height?: number, tile?: boolean): Phaser.GameObjects.Plane; /** - * The Texture this Game Object is using to render with. + * Creates a new Point Light Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Point Light Game Object has been built into Phaser. + * + * The Point Light Game Object provides a way to add a point light effect into your game, + * without the expensive shader processing requirements of the traditional Light Game Object. + * + * The difference is that the Point Light renders using a custom shader, designed to give the + * impression of a point light source, of variable radius, intensity and color, in your game. + * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their + * normal maps for calcuations. This makes them extremely fast to render compared to Lights + * and perfect for special effects, such as flickering torches or muzzle flashes. + * + * For maximum performance you should batch Point Light Game Objects together. This means + * ensuring they follow each other consecutively on the display list. Ideally, use a Layer + * Game Object and then add just Point Lights to it, so that it can batch together the rendering + * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in + * your game then it's perfectly safe to mix them into the display list as normal. However, if + * you're using a large number of them, please consider how they are mixed into the display list. + * + * The renderer will automatically cull Point Lights. Those with a radius that does not intersect + * with the Camera will be skipped in the rendering list. This happens automatically and the + * culled state is refreshed every frame, for every camera. + * + * The origin of a Point Light is always 0.5 and it cannot be changed. + * + * Point Lights are a WebGL only feature and do not have a Canvas counterpart. + * @param x The horizontal position of this Point Light in the world. + * @param y The vertical position of this Point Light in the world. + * @param color The color of the Point Light, given as a hex value. Default 0xffffff. + * @param radius The radius of the Point Light. Default 128. + * @param intensity The intensity, or color blend, of the Point Light. Default 1. + * @param attenuation The attenuation of the Point Light. This is the reduction of light from the center point. Default 0.1. */ - texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; + pointlight(x: number, y: number, color?: number, radius?: number, intensity?: number, attenuation?: number): Phaser.GameObjects.PointLight; /** - * The Texture Frame this Game Object is using to render with. + * Creates a new Render Texture Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. + * + * A Render Texture is a combination of Dynamic Texture and an Image Game Object, that uses the + * Dynamic Texture to display itself with. + * + * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of + * Game Objects directly to it. + * + * You can take many complex objects and draw them to this one texture, which can then be used as the + * base texture for other Game Objects, such as Sprites. Should you then update this texture, all + * Game Objects using it will instantly be updated as well, reflecting the changes immediately. + * + * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke + * expensive GPU uploads on each change. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Render Texture. Default 32. + * @param height The height of the Render Texture. Default 32. */ - frame: Phaser.Textures.Frame; + renderTexture(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.RenderTexture; /** * Sets the texture and frame this Game Object will use to render with. @@ -16736,7 +16799,7 @@ declare namespace Phaser { * @param updateOrigin Should this call change the origin of the Game Object? Default true. * @returns This Game Object instance. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | number, updateSize?: boolean, updateOrigin?: boolean): this; + rope(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number, points?: Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]): Phaser.GameObjects.Rope; /** * Sets the frame this Game Object will use to render with. @@ -16754,35 +16817,35 @@ declare namespace Phaser { * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. * @returns This Game Object instance. */ - setFrame(frame: string | number | Phaser.Textures.Frame, updateSize?: boolean, updateOrigin?: boolean): this; + shader(key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[], textureData?: object): Phaser.GameObjects.Shader; /** * The tint value being applied to the top-left vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - tintTopLeft: number; + arc(x?: number, y?: number, radius?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; /** * The tint value being applied to the top-right vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - tintTopRight: number; + circle(x?: number, y?: number, radius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; /** * The tint value being applied to the bottom-left vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - tintBottomLeft: number; + curve(x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Curve; /** * The tint value being applied to the bottom-right vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - tintBottomRight: number; + ellipse(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Ellipse; /** * The tint mode to use when applying the tint to the texture. @@ -16807,7 +16870,7 @@ declare namespace Phaser { * which results in no visible change to the texture.undefined * @returns This Game Object instance. */ - clearTint(): this; + isobox(x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoBox; /** * Sets the tint color on this Game Object. @@ -16834,7 +16897,7 @@ declare namespace Phaser { * @param bottomRight The tint being applied to the bottom-right of the Game Object. * @returns This Game Object instance. */ - setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + isotriangle(x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoTriangle; /** * Sets the tint mode to use when applying the tint to the texture. @@ -16859,7 +16922,7 @@ declare namespace Phaser { * color value is applied to all four corner tint properties (`tintTopLeft`, * `tintTopRight`, `tintBottomLeft`, and `tintBottomRight`) simultaneously. */ - tint: number; + polygon(x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Polygon; /** * Does this Game Object have a tint applied? @@ -16869,74 +16932,319 @@ declare namespace Phaser { * Returns `false` when all four tint values are 0xffffff and the tint mode * is `MULTIPLY`, which is the default untinted state. */ - readonly isTinted: boolean; + rectangle(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Rectangle; /** - * A property indicating that a Game Object has this component. + * Creates a new Star Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Star Game Object has been built into Phaser. + * + * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * As the name implies, the Star shape will display a star in your game. You can control several + * aspects of it including the number of points that constitute the star. The default is 5. If + * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky + * star shape. + * + * You can also control the inner and outer radius, which is how 'long' each point of the star is. + * Modify these values to create more interesting shapes. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param points The number of points on the star. Default 5. + * @param innerRadius The inner radius of the star. Default 32. + * @param outerRadius The outer radius of the star. Default 64. + * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. */ - readonly hasTransformComponent: boolean; + star(x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Star; /** - * The x position of this Game Object. + * Creates a new Triangle Shape Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Triangle Game Object has been built into Phaser. + * + * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can + * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling + * it for input or physics. It provides a quick and easy way for you to render this shape in your + * game without using a texture, while still taking advantage of being fully batched in WebGL. + * + * This shape supports both fill and stroke colors. + * + * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the + * position of each point of these lines. The triangle is always closed and cannot have an open + * face. If you require that, consider using a Polygon instead. + * @param x The horizontal position of this Game Object in the world. Default 0. + * @param y The vertical position of this Game Object in the world. Default 0. + * @param x1 The horizontal position of the first point in the triangle. Default 0. + * @param y1 The vertical position of the first point in the triangle. Default 128. + * @param x2 The horizontal position of the second point in the triangle. Default 64. + * @param y2 The vertical position of the second point in the triangle. Default 0. + * @param x3 The horizontal position of the third point in the triangle. Default 128. + * @param y3 The vertical position of the third point in the triangle. Default 128. + * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. + * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. */ - x: number; + triangle(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Triangle; /** - * The y position of this Game Object. + * Creates a new Sprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Sprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. */ - y: number; + sprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Sprite; /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. + * Creates a new Text Game Object and adds it to the Scene. + * + * A Text Game Object. + * + * Text objects work by creating their own internal hidden Canvas and then renders text to it using + * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered + * to your game during the render pass. + * + * Because it uses the Canvas API you can take advantage of all the features this offers, such as + * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts + * loaded externally, such as Google or TypeKit Web fonts. + * + * You can only display fonts that are currently loaded and available to the browser: therefore fonts must + * be pre-loaded. Phaser does not do this for you, so you will require the use of a 3rd party font loader, + * or have the fonts ready available in the CSS on the page in which your Phaser game resides. + * + * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts + * across mobile browsers. + * + * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being + * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the + * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of + * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text + * instead, as it benefits from batching and avoids expensive Canvas API calls. + * + * Note: This method will only be available if the Text Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param text The text this Text object will display. + * @param style The Text style configuration object. */ - z: number; + text(x: number, y: number, text: string | string[], style?: Phaser.Types.GameObjects.Text.TextStyle): Phaser.GameObjects.Text; /** - * The w position of this Game Object. + * Creates a new TileSprite Game Object and adds it to the Scene. + * + * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. If zero it will use the size of the texture frame. + * @param height The height of the Game Object. If zero it will use the size of the texture frame. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. Cannot be a DynamicTexture. + * @param frame An optional frame from the Texture this Game Object is rendering with. */ - w: number; + tileSprite(x: number, y: number, width: number, height: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.TileSprite; /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. + * Creates a new Video Game Object and adds it to the Scene. + * + * This Game Object is capable of handling playback of a video file, video stream or media stream. + * + * You can optionally 'preload' the video into the Phaser Video Cache: + * + * ```javascript + * preload () { + * this.load.video('ripley', 'assets/aliens.mp4'); + * } + * + * create () { + * this.add.video(400, 300, 'ripley'); + * } + * ``` + * + * You don't have to 'preload' the video. You can also play it directly from a URL: + * + * ```javascript + * create () { + * this.add.video(400, 300).loadURL('assets/aliens.mp4'); + * } + * ``` + * + * To all intents and purposes, a video is a standard Game Object, just like a Sprite. And as such, you can do + * all the usual things to it, such as scaling, rotating, cropping, tinting, making interactive, giving a + * physics body, etc. + * + * Transparent videos are also possible via the WebM file format. Providing the video file has was encoded with + * an alpha channel, and providing the browser supports WebM playback (not all of them do), then it will render + * in-game with full transparency. + * + * ### Autoplaying Videos + * + * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. + * The policies that control autoplaying are vast and vary between browser. You can, and should, read more about + * it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide + * + * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, + * and it will often allow the video to play immediately: + * + * ```javascript + * preload () { + * this.load.video('pixar', 'nemo.mp4', true); + * } + * ``` + * + * The 3rd parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without + * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies + * the browsers MEI settings. See the MDN Autoplay Guide for further details. + * + * Or: + * + * ```javascript + * create () { + * this.add.video(400, 300).loadURL('assets/aliens.mp4', true); + * } + * ``` + * + * You can set the `noAudio` parameter to `true` even if the video does contain audio. It will still allow the video + * to play immediately, but the audio will not start. + * + * Note that due to a bug in IE11 you cannot play a video texture to a Sprite in WebGL. For IE11 force Canvas mode. + * + * More details about video playback and the supported media formats can be found on MDN: + * + * https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement + * https://developer.mozilla.org/en-US/docs/Web/Media/Formats + * + * Note: This method will only be available if the Video Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param key Optional key of the Video this Game Object will play, as stored in the Video Cache. */ - scale: number; + video(x: number, y: number, key?: string): Phaser.GameObjects.Video; /** - * The horizontal scale of this Game Object. + * Creates a new Zone Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Zone Game Object has been built into Phaser. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param width The width of the Game Object. + * @param height The height of the Game Object. */ - scaleX: number; + zone(x: number, y: number, width: number, height: number): Phaser.GameObjects.Zone; /** - * The vertical scale of this Game Object. + * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. + * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing + * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map + * data. For an empty map, you should specify tileWidth, tileHeight, width & height. + * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. + * @param tileWidth The width of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param tileHeight The height of a tile in pixels. Pass in `null` to leave as the + * default. Default 32. + * @param width The width of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param height The height of the map in tiles. Pass in `null` to leave as the + * default. Default 10. + * @param data Instead of loading from the cache, you can also load directly from + * a 2D array of tile indexes. Pass in `null` for no data. + * @param insertNull Controls how empty tiles, tiles with an index of -1, in the + * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty + * location will get a Tile object with an index of -1. If you've a large sparsely populated map and + * the tile data doesn't need to change then setting this value to `true` will help with memory + * consumption. However if your map is small or you need to update the tiles dynamically, then leave + * the default value set. Default false. */ - scaleY: number; + tilemap(key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number, data?: number[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. + * A Timeline is a way to schedule events to happen at specific times in the future. + * + * You can think of it as an event sequencer for your game, allowing you to schedule the + * running of callbacks, events and other actions at specific times in the future. + * + * A Timeline is a Scene level system, meaning you can have as many Timelines as you like, each + * belonging to a different Scene. You can also have multiple Timelines running at the same time. + * + * If the Scene is paused, the Timeline will also pause. If the Scene is destroyed, the Timeline + * will be automatically destroyed. However, you can control the Timeline directly, pausing, + * resuming and stopping it at any time. + * + * Create an instance of a Timeline via the Game Object Factory: + * + * ```js + * const timeline = this.add.timeline(); + * ``` + * + * The Timeline always starts paused. You must call `play` on it to start it running. + * + * You can also pass in a configuration object on creation, or an array of them: + * + * ```js + * const timeline = this.add.timeline({ + * at: 1000, + * run: () => { + * this.add.sprite(400, 300, 'logo'); + * } + * }); + * + * timeline.play(); + * ``` + * + * In this example we sequence a few different events: + * + * ```js + * const timeline = this.add.timeline([ + * { + * at: 1000, + * run: () => { this.logo = this.add.sprite(400, 300, 'logo'); }, + * sound: 'TitleMusic' + * }, + * { + * at: 2500, + * tween: { + * targets: this.logo, + * y: 600, + * yoyo: true + * }, + * sound: 'Explode' + * }, + * { + * at: 8000, + * event: 'HURRY_PLAYER', + * target: this.background, + * set: { + * tint: 0xff0000 + * } + * } + * ]); + * + * timeline.play(); + * ``` + * + * The Timeline can also be looped with the repeat method: + * ```js + * timeline.repeat().play(); + * ``` + * + * There are lots of options available to you via the configuration object. See the + * {@link Phaser.Types.Time.TimelineEventConfig} typedef for more details. + * @param config The configuration object for this Timeline Event, or an array of them. */ - angle: number; + timeline(config: Phaser.Types.Time.TimelineEventConfig | Phaser.Types.Time.TimelineEventConfig[]): Phaser.Time.Timeline; /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. + * Creates a new Tween object. + * + * Note: This method will only be available if Tweens have been built into Phaser. + * @param config A Tween Configuration object, or a Tween or TweenChain instance. */ - rotation: number; + tween(config: Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfig | Phaser.Tweens.Tween | Phaser.Tweens.TweenChain): Phaser.Tweens.Tween; /** * Sets the position of this Game Object. @@ -16946,14 +17254,44 @@ declare namespace Phaser { * @param w The w position of this Game Object. Default 0. * @returns This Game Object instance. */ - setPosition(x?: number, y?: number, z?: number, w?: number): this; + tweenchain(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.TweenChain; + + } + + /** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * @param src The Game Object to calculate the transform matrix for. + * @param camera The camera being used to render the Game Object. + * @param parentMatrix The transform matrix of the parent container, if any. + */ + function GetCalcMatrix(src: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Types.GameObjects.GetCalcMatrixResults; + + /** + * The Update List plugin. + * + * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame. + * + * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering. + */ + class UpdateList extends Phaser.Structs.ProcessQueue { + /** + * + * @param scene The Scene that the Update List belongs to. + */ + constructor(scene: Phaser.Scene); /** * Copies an object's coordinates to this Game Object's position. * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. * @returns This Game Object instance. */ - copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + scene: Phaser.Scene; /** * Sets the position of this Game Object to be a random position within the confines of @@ -16969,21 +17307,21 @@ declare namespace Phaser { * @param height The height of the random area. * @returns This Game Object instance. */ - setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + systems: Phaser.Scenes.Systems; /** * Sets the rotation of this Game Object. * @param radians The rotation of this Game Object, in radians. Default 0. * @returns This Game Object instance. */ - setRotation(radians?: number): this; + sceneUpdate(time: number, delta: number): void; /** * Sets the angle of this Game Object. * @param degrees The rotation of this Game Object, in degrees. Default 0. * @returns This Game Object instance. */ - setAngle(degrees?: number): this; + shutdown(): void; /** * Sets the scale of this Game Object. @@ -17093,29 +17431,29 @@ declare namespace Phaser { /** * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. - * + * * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to * match the font structure. - * + * * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by * processing the font texture in an image editor, applying fills and any other effects required. - * + * * To create multi-line text insert \r, \n or \r\n escape codes into the text string. - * + * * To create a BitmapText data files you need a 3rd party app such as: - * + * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} - * + * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} */ class BitmapText extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. * @param x The x coordinate of this Game Object in world space. * @param y The y coordinate of this Game Object in world space. @@ -17145,28 +17483,28 @@ declare namespace Phaser { /** * The horizontal offset of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowX: number; /** * The vertical offset of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowY: number; /** * The color of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowColor: number; /** * The alpha value of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowAlpha: number; @@ -17216,9 +17554,9 @@ declare namespace Phaser { /** * Sets the line spacing value. This value is added to the font height to * calculate the overall line height. - * + * * Spacing can be a negative or positive number. - * + * * Only has an effect if this BitmapText object contains multiple lines of text. * @param spacing The amount of space to add between each line in multi-line text. Default 0. * @returns This BitmapText Object. @@ -17227,7 +17565,7 @@ declare namespace Phaser { /** * Set the textual content of this BitmapText. - * + * * An array of strings will be converted into multi-line text. Use the align methods to change multi-line alignment. * @param value The string, or array of strings, to be set as the content of this BitmapText. * @returns This BitmapText Object. @@ -17236,14 +17574,14 @@ declare namespace Phaser { /** * Sets a drop shadow effect on this Bitmap Text. - * + * * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. - * + * * You can set the vertical and horizontal offset of the shadow, as well as the color and alpha. - * + * * Once a shadow has been enabled you can modify the `dropShadowX` and `dropShadowY` properties of this * Bitmap Text directly to adjust the position of the shadow in real-time. - * + * * If you wish to clear the shadow, call this method with no parameters specified. * @param x The horizontal offset of the drop shadow. Default 0. * @param y The vertical offset of the drop shadow. Default 0. @@ -17256,14 +17594,14 @@ declare namespace Phaser { /** * Sets a tint on a range of characters in this Bitmap Text, starting from the `start` parameter index * and running for `length` quantity of characters. - * + * * The `start` parameter can be negative. In this case, it starts at the end of the text and counts * backwards `start` places. - * + * * You can also pass in -1 as the `length` and it will tint all characters from `start` * up until the end of the string. * Remember that spaces and punctuation count as characters. - * + * * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. * * The tint applies a color to the pixel color values @@ -17281,9 +17619,9 @@ declare namespace Phaser { * per corner. The colors are blended together across the extent of the character range. * * To modify the tint color once set, call this method again with new color values. - * + * * Using `setWordTint` can override tints set by this function, and vice versa. - * + * * To remove a tint call this method with just the `start`, and optionally, the `length` parameters defined. * @param start The starting character to begin the tint at. If negative, it counts back from the end of the text. Default 0. * @param length The number of characters to tint. Remember that spaces count as a character too. Pass -1 to tint all characters from `start` onwards. Default 1. @@ -17298,18 +17636,18 @@ declare namespace Phaser { /** * Sets a tint on a matching word within this Bitmap Text. - * + * * The `word` parameter can be either a string or a number. - * + * * If a string, it will run a string comparison against the text contents, and if matching, * it will tint the whole word. * * If a number, it will tint that word, based on its index within the words array. * * The `count` parameter controls how many words are replaced. Pass in -1 to replace them all. - * + * * This parameter is ignored if you pass a number as the `word` to be searched for. - * + * * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. * * The tint applies a color to the pixel color values @@ -17327,7 +17665,7 @@ declare namespace Phaser { * per corner. The colors are blended together across the extent of the character range. * * To modify the tint color once set, call this method again with new color values. - * + * * Using `setCharacterTint` can override tints set by this function, and vice versa. * @param word The word to search for. Either a string, or an index of the word in the words array. * @param count The number of matching words to tint. Pass -1 to tint all matching words. Default 1. @@ -17342,14 +17680,14 @@ declare namespace Phaser { /** * Calculate the bounds of this Bitmap Text. - * + * * An object is returned that contains the position, width and height of the Bitmap Text in local and global * contexts. - * + * * Local size is based on just the font size and a [0, 0] position. - * + * * Global size takes into account the Game Object's scale, world position and display origin. - * + * * Also in the object is data regarding the length of each line, should this be a multi-line BitmapText. * @param round Whether to round the results up to the nearest integer. Default false. * @returns An object that describes the size of this Bitmap Text. @@ -17358,16 +17696,16 @@ declare namespace Phaser { /** * Gets the character located at the given x/y coordinate within this Bitmap Text. - * + * * The coordinates you pass in are translated into the local space of the * Bitmap Text, however, it is up to you to first translate the input coordinates to world space. - * + * * If you wish to use this in combination with an input event, be sure * to pass in `Pointer.worldX` and `worldY` so they are in world space. - * + * * In some cases, based on kerning, characters can overlap. When this happens, * the first character in the word is returned. - * + * * Note that this does not work for DynamicBitmapText if you have changed the * character positions during render. It will only scan characters in their un-translated state. * @param x The x position to check. @@ -17386,7 +17724,7 @@ declare namespace Phaser { /** * Changes the font this BitmapText is using to render. - * + * * The new texture is loaded and applied to the BitmapText. The existing text, size and alignment are preserved, * unless overridden via the arguments. * @param font The key of the font to use from the Bitmap Font cache. @@ -17398,14 +17736,14 @@ declare namespace Phaser { /** * Sets the maximum display width of this BitmapText in pixels. - * + * * If `BitmapText.text` is longer than `maxWidth` then the lines will be automatically wrapped * based on the previous whitespace character found in the line. - * + * * If no whitespace was found then no wrapping will take place and consequently the `maxWidth` value will not be honored. - * + * * Disable maxWidth by setting the value to 0. - * + * * You can set the whitespace character to be searched for by setting the `wordWrapCharCode` parameter or property. * @param value The maximum display width of this BitmapText in pixels. Set to zero to disable. * @param wordWrapCharCode The character code to check for when word wrapping. Defaults to 32 (the space character). @@ -17415,7 +17753,7 @@ declare namespace Phaser { /** * Sets the display size of this BitmapText Game Object. - * + * * Calling this will adjust the scale. * @param width The width of this BitmapText Game Object. * @param height The height of this BitmapText Game Object. @@ -17425,67 +17763,67 @@ declare namespace Phaser { /** * Controls the alignment of each line of text in this BitmapText object. - * + * * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns. * Has no effect with single-lines of text. - * + * * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`. - * + * * 0 = Left aligned (default) * 1 = Middle aligned * 2 = Right aligned - * + * * The alignment position is based on the longest line of text. */ align: number; /** * The text that this Bitmap Text object displays. - * + * * You can also use the method `setText` if you want a chainable way to change the text content. */ text: string; /** * The font size of this Bitmap Text. - * + * * You can also use the method `setFontSize` if you want a chainable way to change the font size. */ fontSize: number; /** * Adds / Removes spacing between characters. - * + * * Can be a negative or positive number. - * + * * You can also use the method `setLetterSpacing` if you want a chainable way to change the letter spacing. */ letterSpacing: number; /** * Adds / Removes spacing between lines. - * + * * Can be a negative or positive number. - * + * * You can also use the method `setLineSpacing` if you want a chainable way to change the line spacing. */ lineSpacing: number; /** * The maximum display width of this BitmapText in pixels. - * + * * If BitmapText.text is longer than maxWidth then the lines will be automatically wrapped * based on the last whitespace character found in the line. - * + * * If no whitespace was found then no wrapping will take place and consequently the maxWidth value will not be honored. - * + * * Disable maxWidth by setting the value to 0. */ maxWidth: number; /** * The width of this Bitmap Text. - * + * * This property is read-only. */ readonly width: number; @@ -17499,18 +17837,18 @@ declare namespace Phaser { /** * The displayed width of this Bitmap Text. - * + * * This value takes into account the scale factor. - * + * * This property is read-only. */ readonly displayWidth: number; /** * The displayed height of this Bitmap Text. - * + * * This value takes into account the scale factor. - * + * * This property is read-only. */ readonly displayHeight: number; @@ -17543,7 +17881,7 @@ declare namespace Phaser { /** * Parse an XML Bitmap Font from an Atlas. - * + * * Adds the parsed Bitmap Font data to the cache with the `fontName` key. * @param scene The Scene to parse the Bitmap Font for. * @param fontName The key of the font to add to the Bitmap Font cache. @@ -17798,7 +18136,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -17844,21 +18182,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -17868,21 +18206,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -17894,13 +18232,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -17931,7 +18269,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -17941,11 +18279,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -17954,11 +18292,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -17967,7 +18305,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -17978,7 +18316,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -17989,7 +18327,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18000,7 +18338,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18011,7 +18349,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18022,7 +18360,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18033,7 +18371,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18044,7 +18382,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18055,7 +18393,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18137,10 +18475,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -18161,12 +18499,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -18212,7 +18550,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -18307,12 +18645,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -18326,12 +18664,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -18349,10 +18687,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -18379,11 +18717,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -18395,14 +18733,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -18471,11 +18809,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -18543,7 +18881,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -18557,7 +18895,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -18575,20 +18913,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -18613,9 +18951,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -18664,7 +19002,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -18697,9 +19035,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -18730,14 +19068,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -18748,22 +19086,22 @@ declare namespace Phaser { /** * A Blitter Game Object. - * + * * The Blitter Game Object is a special kind of container that creates, updates and manages Bob objects. * Bobs are designed for rendering speed rather than flexibility. They consist of a texture, or frame from a texture, * a position and an alpha value. You cannot scale or rotate them. They use a batched drawing method for speed * during rendering. - * + * * A Blitter Game Object has one texture bound to it. Bobs created by the Blitter can use any Frame from this * Texture to render with, but they cannot use any other Texture. It is this single texture-bind that allows * them their speed. - * + * * If you have a need to blast a large volume of frames around the screen then Blitter objects are well worth * investigating. They are especially useful for using as a base for your own special effects systems. */ class Blitter extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. * @param x The x coordinate of this Game Object in world space. Default 0. * @param y The y coordinate of this Game Object in world space. Default 0. @@ -18786,7 +19124,7 @@ declare namespace Phaser { /** * Creates a new Bob in this Blitter. - * + * * The Bob is created at the given coordinates, relative to the Blitter and uses the given frame. * A Bob can use any frame belonging to the texture bound to the Blitter. * @param x The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. @@ -18810,9 +19148,9 @@ declare namespace Phaser { /** * Creates multiple Bobs in one call. - * + * * The amount created is controlled by a combination of the `quantity` argument and the number of frames provided. - * + * * If the quantity is set to 10 and you provide 2 frames, then 20 Bobs will be created. 10 with the first * frame and 10 with the second. * @param quantity The quantity of Bob objects to create. @@ -19078,7 +19416,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -19124,21 +19462,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -19148,21 +19486,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -19174,13 +19512,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -19211,7 +19549,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -19221,11 +19559,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -19234,11 +19572,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -19304,10 +19642,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -19328,12 +19666,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -19412,12 +19750,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -19431,12 +19769,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -19454,10 +19792,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -19474,7 +19812,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -19483,7 +19821,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -19492,30 +19830,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -19525,12 +19863,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -19564,11 +19902,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -19580,14 +19918,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -19613,7 +19951,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -19627,7 +19965,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -19645,20 +19983,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -19683,9 +20021,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -19734,7 +20072,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -19767,9 +20105,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -19800,14 +20138,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -19818,22 +20156,22 @@ declare namespace Phaser { /** * A Bob Game Object. - * + * * A Bob belongs to a Blitter Game Object. The Blitter is responsible for managing and rendering this object. - * + * * A Bob has a position, alpha value and a frame from a texture that it uses to render with. You can also toggle * the flipped and visible state of the Bob. The Frame the Bob uses to render can be changed dynamically, but it * must be a Frame within the Texture used by the parent Blitter. - * + * * Bob positions are relative to the Blitter parent. So if you move the Blitter parent, all Bob children will * have their positions impacted by this change as well. - * + * * You can manipulate Bob objects directly from your game code, but the creation and destruction of them should be * handled via the Blitter parent. */ class Bob { /** - * + * * @param blitter The parent Blitter object is responsible for updating this Bob. * @param x The horizontal position of this Game Object in the world, relative to the parent Blitter position. * @param y The vertical position of this Game Object in the world, relative to the parent Blitter position. @@ -19904,9 +20242,9 @@ declare namespace Phaser { /** * Resets this Bob. - * + * * Changes the position to the values given, and optionally changes the frame. - * + * * Also resets the flipX and flipY values, sets alpha back to 1 and visible to true. * @param x The x position of the Bob. Bob coordinates are relative to the position of the Blitter object. * @param y The y position of the Bob. Bob coordinates are relative to the position of the Blitter object. @@ -19947,7 +20285,7 @@ declare namespace Phaser { /** * Sets the visibility of this Bob. - * + * * An invisible Bob will skip rendering. * @param value The visible state of the Game Object. * @returns This Bob Game Object. @@ -19957,7 +20295,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * A Bob with alpha 0 will skip rendering. * @param value The alpha value used for this Bob. Between 0 and 1. * @returns This Bob Game Object. @@ -19982,14 +20320,14 @@ declare namespace Phaser { /** * The visible state of the Bob. - * + * * An invisible Bob will skip rendering. */ visible: boolean; /** * The alpha value of the Bob, between 0 and 1. - * + * * A Bob with alpha 0 will skip rendering. */ alpha: number; @@ -20508,7 +20846,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -20571,7 +20909,7 @@ declare namespace Phaser { setAlpha(value?: number): this; /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -20592,21 +20930,21 @@ declare namespace Phaser { interface BlendMode { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -20615,21 +20953,21 @@ declare namespace Phaser { blendMode: Phaser.BlendModes | string | number; /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -20653,7 +20991,7 @@ declare namespace Phaser { interface ComputedSize { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -20661,7 +20999,7 @@ declare namespace Phaser { width: number; /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -20669,28 +21007,28 @@ declare namespace Phaser { height: number; /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -20737,26 +21075,26 @@ declare namespace Phaser { isCropped: boolean; /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates cannot exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -20775,13 +21113,13 @@ declare namespace Phaser { interface Depth { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -20809,7 +21147,7 @@ declare namespace Phaser { setToTop(): this; /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -20818,11 +21156,11 @@ declare namespace Phaser { setToBack(): this; /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -20830,11 +21168,11 @@ declare namespace Phaser { setAbove(gameObject: Phaser.GameObjects.GameObject): this; /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -21114,7 +21452,7 @@ declare namespace Phaser { /** * Adds a Blur effect. - * + * * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a * smooth blur resembling that of viewing the image through a translucent screen, distinctly different @@ -21131,12 +21469,12 @@ declare namespace Phaser { /** * Adds a Bokeh effect. - * + * * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. - * + * * See also Tilt Shift. * @param radius The radius of the bokeh effect. Default 0.5. * @param amount The amount of the bokeh effect. Default 1. @@ -21448,11 +21786,11 @@ declare namespace Phaser { /** * Adds a Tilt Shift effect. - * + * * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature * effect by blurring everything except a small area of the image. This effect is achieved by blurring the * top and bottom elements, while keeping the center area in focus. - * + * * See also Bokeh. * @param radius The radius of the bokeh effect. * @param amount The amount of the bokeh effect. @@ -21819,7 +22157,7 @@ declare namespace Phaser { interface GetBounds { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21829,7 +22167,7 @@ declare namespace Phaser { getCenter(output?: O, includeParent?: boolean): O; /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21839,7 +22177,7 @@ declare namespace Phaser { getTopLeft(output?: O, includeParent?: boolean): O; /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21849,7 +22187,7 @@ declare namespace Phaser { getTopCenter(output?: O, includeParent?: boolean): O; /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21859,7 +22197,7 @@ declare namespace Phaser { getTopRight(output?: O, includeParent?: boolean): O; /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21869,7 +22207,7 @@ declare namespace Phaser { getLeftCenter(output?: O, includeParent?: boolean): O; /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21879,7 +22217,7 @@ declare namespace Phaser { getRightCenter(output?: O, includeParent?: boolean): O; /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21889,7 +22227,7 @@ declare namespace Phaser { getBottomLeft(output?: O, includeParent?: boolean): O; /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -21899,7 +22237,7 @@ declare namespace Phaser { getBottomCenter(output?: O, includeParent?: boolean): O; /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22001,10 +22339,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -22023,12 +22361,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -22078,7 +22416,7 @@ declare namespace Phaser { displayOriginY: number; /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -22132,7 +22470,7 @@ declare namespace Phaser { pathRotationOffset: number; /** * Set the Path that this PathFollower should follow. - * + * * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. * @param path The Path this PathFollower is following. It can only follow one Path at a time. * @param config Settings for the PathFollower. @@ -22182,7 +22520,7 @@ declare namespace Phaser { stopFollow(): this; /** * Internal update handler that advances this PathFollower along the path. - * + * * Called automatically by the Scene step, should not typically be called directly. */ pathUpdate(): void; @@ -22298,12 +22636,12 @@ declare namespace Phaser { interface ScrollFactor { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -22316,12 +22654,12 @@ declare namespace Phaser { scrollFactorX: number; /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -22338,10 +22676,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -22372,7 +22710,7 @@ declare namespace Phaser { interface Size { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -22380,7 +22718,7 @@ declare namespace Phaser { width: number; /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -22388,28 +22726,28 @@ declare namespace Phaser { height: number; /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -22418,12 +22756,12 @@ declare namespace Phaser { setSizeToFrame(frame?: Phaser.Textures.Frame | boolean): this; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -22465,11 +22803,11 @@ declare namespace Phaser { frame: Phaser.Textures.Frame; /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -22480,14 +22818,14 @@ declare namespace Phaser { setTexture(key: string | Phaser.Textures.Texture, frame?: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -22517,26 +22855,26 @@ declare namespace Phaser { isCropped: boolean; /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -22548,7 +22886,7 @@ declare namespace Phaser { setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -22557,14 +22895,14 @@ declare namespace Phaser { setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -22633,11 +22971,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -22687,7 +23025,7 @@ declare namespace Phaser { /** * Build a JSON representation of the given Game Object. - * + * * This is typically extended further by Game Object specific implementations. */ interface ToJSON { @@ -22711,7 +23049,7 @@ declare namespace Phaser { y: number; /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -22723,7 +23061,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -22738,19 +23076,19 @@ declare namespace Phaser { scaleY: number; /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -22772,9 +23110,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -22817,7 +23155,7 @@ declare namespace Phaser { setY(value?: number): this; /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -22846,9 +23184,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -22886,7 +23224,7 @@ declare namespace Phaser { * the camera or display list transform pipeline. * * It is represented like so: - * + * * ``` * | a | c | tx | * | b | d | ty | @@ -22895,7 +23233,7 @@ declare namespace Phaser { */ class TransformMatrix { /** - * + * * @param a The Scale X value. Default 1. * @param b The Skew Y value. Default 0. * @param c The Skew X value. Default 0. @@ -23012,7 +23350,7 @@ declare namespace Phaser { /** * Multiply this Matrix by the given Matrix. - * + * * If an `out` Matrix is given then the results will be stored in it. * If it is not given, this matrix will be updated in place instead. * Use an `out` Matrix if you do not wish to mutate this matrix. @@ -23024,7 +23362,7 @@ declare namespace Phaser { /** * Multiply this Matrix by the matrix given, including the offset. - * + * * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. * The offsetY is added to the ty value: `offsetX * b + offsetY * d + ty`. * @param src The source Matrix to copy from. @@ -23108,7 +23446,7 @@ declare namespace Phaser { /** * Copy the values in this Matrix to the array given. - * + * * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. * @param out The array to copy the matrix values in to. * @returns An array where elements 0 to 5 contain the values from this matrix. @@ -23129,7 +23467,7 @@ declare namespace Phaser { /** * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. - * + * * The result must be applied in the following order to reproduce the current matrix: * * translate -> rotate -> scaleundefined @@ -23151,7 +23489,7 @@ declare namespace Phaser { /** * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of * the current matrix with its transformation applied. - * + * * Can be used to translate points from world to local space. * @param x The x position to translate. * @param y The y position to translate. @@ -23195,7 +23533,7 @@ declare namespace Phaser { /** * Returns the X component of this matrix multiplied by the given values. - * + * * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. * @param x The x value. * @param y The y value. @@ -23206,7 +23544,7 @@ declare namespace Phaser { /** * Returns the Y component of this matrix multiplied by the given values. - * + * * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. * @param x The x value. * @param y The y value. @@ -23239,13 +23577,13 @@ declare namespace Phaser { interface Visible { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -23257,23 +23595,23 @@ declare namespace Phaser { /** * A Container Game Object. - * + * * A Container, as the name implies, can 'contain' other types of Game Object. * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it. * By default it will be removed from the Display List and instead added to the Containers own internal list. - * + * * The position of the Game Object automatically becomes relative to the position of the Container. - * + * * The transform point of a Container is 0x0 (in local space) and that cannot be changed. The children you add to the * Container should be positioned with this value in mind. I.e. you should treat 0x0 as being the center of * the Container, and position children positively and negative around it as required. - * + * * When the Container is rendered, all of its children are rendered as well, in the order in which they exist * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`. - * + * * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will * automatically influence all children as well. - * + * * Containers can include other Containers for deeply nested transforms. * * Containers can have masks set on them and can be used as a mask too. @@ -23283,16 +23621,16 @@ declare namespace Phaser { * * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. - * + * * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, * or the input area will become misaligned. - * + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure * your game to work around this. - * + * * It's important to understand the impact of using Containers. They add additional processing overhead into * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true * for input events. You also lose the ability to set the display depth of Container children in the same @@ -23301,7 +23639,7 @@ declare namespace Phaser { */ class Container extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -23316,10 +23654,10 @@ declare namespace Phaser { /** * Does this Container exclusively manage its children? - * + * * The default is `true` which means a child added to this Container cannot * belong in another Container, which includes the Scene display list. - * + * * If you disable this then this Container will no longer exclusively manage its children. * This allows you to create all kinds of interesting graphical effects, such as replicating * Game Objects without reparenting them all over the Scene. @@ -23349,19 +23687,19 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Container. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Container. - * + * * When a camera scrolls it will change the location at which this Container is rendered on-screen. * It does not change the Containers actual position values. - * + * * For a Container, setting this value will only update the Container itself, not its children. * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Container. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -23371,19 +23709,19 @@ declare namespace Phaser { /** * The vertical scroll factor of this Container. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Container. - * + * * When a camera scrolls it will change the location at which this Container is rendered on-screen. * It does not change the Containers actual position values. - * + * * For a Container, setting this value will only update the Container itself, not its children. * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Container. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -23417,10 +23755,10 @@ declare namespace Phaser { /** * Does this Container exclusively manage its children? - * + * * The default is `true` which means a child added to this Container cannot * belong in another Container, which includes the Scene display list. - * + * * If you disable this then this Container will no longer exclusively manage its children. * This allows you to create all kinds of interesting graphical effects, such as replicating * Game Objects without reparenting them all over the Scene. @@ -23436,13 +23774,13 @@ declare namespace Phaser { * Gets the bounds of this Container. It works by iterating all children of the Container, * getting their respective bounds, and then working out a min-max rectangle from that. * It does not factor in if the children render or not, all are included. - * + * * Some children are unable to return their bounds, such as Graphics objects, in which case * they are skipped. - * + * * Depending on the quantity of children in this Container it could be a really expensive call, * so cache it and only poll it as needed. - * + * * The values are stored and returned in a Rectangle object. * @param output A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created. * @returns The values stored in the output object. @@ -23468,7 +23806,7 @@ declare namespace Phaser { /** * Adds the given Game Object, or array of Game Objects, to this Container. - * + * * Each Game Object must be unique within the Container. * * If you try to add a Layer, it will throw an error. @@ -23479,9 +23817,9 @@ declare namespace Phaser { /** * Adds the given Game Object, or array of Game Objects, to this Container at the specified position. - * + * * Existing Game Objects in the Container are shifted up. - * + * * Each Game Object must be unique within the Container. * @param child The Game Object, or array of Game Objects, to add to the Container. * @param index The position to insert the Game Object/s at. Default 0. @@ -23530,12 +23868,12 @@ declare namespace Phaser { /** * Gets the first Game Object in this Container. - * + * * You can also specify a property and value to search for, in which case it will return the first * Game Object in this Container with a matching property and / or value. - * + * * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set. - * + * * You can limit the search to the `startIndex` - `endIndex` range. * @param property The property to test on each Game Object in the Container. * @param value The value to test the property against. Must pass a strict (`===`) comparison check. @@ -23547,15 +23885,15 @@ declare namespace Phaser { /** * Returns all Game Objects in this Container. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. - * + * * For example: `getAll('body')` would return only Game Objects that have a body property. - * + * * You can also specify a value to compare the property to: - * + * * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`. - * + * * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50 Game Objects. @@ -23570,9 +23908,9 @@ declare namespace Phaser { /** * Returns the total number of Game Objects in this Container that have a property * matching the given value. - * + * * For example: `count('visible', true)` would count all the elements that have their visible property set. - * + * * You can optionally limit the operation to the `startIndex` - `endIndex` range. * @param property The property to check. * @param value The value to check. @@ -23593,9 +23931,9 @@ declare namespace Phaser { /** * Moves a Game Object to a new position within this Container. - * + * * The Game Object must already be a child of this Container. - * + * * The Game Object is removed from its old position and inserted into the new one. * Therefore the Container size does not change. Other children will change position accordingly. * @param child The Game Object to move. @@ -23607,7 +23945,7 @@ declare namespace Phaser { /** * Moves a Game Object above another one within this Container. * If the Game Object is already above the other, it isn't moved. - * + * * These 2 Game Objects must already be children of this Container. * @param child1 The Game Object to move above base Game Object. * @param child2 The base Game Object. @@ -23618,7 +23956,7 @@ declare namespace Phaser { /** * Moves a Game Object below another one within this Container. * If the Game Object is already below the other, it isn't moved. - * + * * These 2 Game Objects must already be children of this Container. * @param child1 The Game Object to move below base Game Object. * @param child2 The base Game Object. @@ -23628,9 +23966,9 @@ declare namespace Phaser { /** * Removes the given Game Object, or array of Game Objects, from this Container. - * + * * The Game Objects must already be children of this Container. - * + * * You can also optionally call `destroy` on each Game Object that is removed from the Container. * @param child The Game Object, or array of Game Objects, to be removed from the Container. * @param destroyChild Optionally call `destroy` on each child successfully removed from this Container. Default false. @@ -23640,7 +23978,7 @@ declare namespace Phaser { /** * Removes the Game Object at the given position in this Container. - * + * * You can also optionally call `destroy` on the Game Object, if one is found. * @param index The index of the Game Object to be removed. * @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false. @@ -23650,7 +23988,7 @@ declare namespace Phaser { /** * Removes the Game Objects between the given positions in this Container. - * + * * You can also optionally call `destroy` on each Game Object that is removed from the Container. * @param startIndex An optional start index to search from. Default 0. * @param endIndex An optional end index to search up to (but not included) Default Container.length. @@ -23661,7 +23999,7 @@ declare namespace Phaser { /** * Removes all Game Objects from this Container. - * + * * You can also optionally call `destroy` on each Game Object that is removed from the Container. * @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false. * @returns This Container instance. @@ -23722,7 +24060,7 @@ declare namespace Phaser { /** * Returns `true` if the given Game Object is a direct child of this Container. - * + * * This check does not scan nested Containers. * @param child The Game Object to check for within this Container. * @returns True if the Game Object is an immediate child of this Container, otherwise false. @@ -23731,7 +24069,7 @@ declare namespace Phaser { /** * Sets the property to the given value on all Game Objects in this Container. - * + * * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50 Game Objects. @@ -23745,10 +24083,10 @@ declare namespace Phaser { /** * Passes all Game Objects in this Container to the given callback. - * + * * A copy of the Container is made before passing each entry to your callback. * This protects against the callback itself modifying the Container. - * + * * If you know for sure that the callback will not change the size of this Container * then you can use the more performant `Container.iterate` method instead. * @param callback The function to call. @@ -23760,7 +24098,7 @@ declare namespace Phaser { /** * Passes all Game Objects in this Container to the given callback. - * + * * Only use this method when you absolutely know that the Container will not be modified during * the iteration, i.e. by removing or adding to its contents. * @param callback The function to call. @@ -23772,16 +24110,16 @@ declare namespace Phaser { /** * Sets the scroll factor of this Container and optionally all of its children. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -23800,28 +24138,28 @@ declare namespace Phaser { /** * Returns the first Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly first: Phaser.GameObjects.GameObject | null; /** * Returns the last Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly last: Phaser.GameObjects.GameObject | null; /** * Returns the next Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly next: Phaser.GameObjects.GameObject | null; /** * Returns the previous Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly previous: Phaser.GameObjects.GameObject | null; @@ -24075,7 +24413,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -24084,21 +24422,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -24108,21 +24446,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -24134,7 +24472,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -24143,7 +24481,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -24152,30 +24490,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -24198,13 +24536,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -24235,7 +24573,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -24245,11 +24583,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -24258,11 +24596,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -24282,10 +24620,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -24306,12 +24644,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -24338,7 +24676,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -24352,7 +24690,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -24370,20 +24708,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -24408,9 +24746,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -24459,7 +24797,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -24492,9 +24830,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -24525,14 +24863,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -24543,63 +24881,63 @@ declare namespace Phaser { /** * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. - * + * * In order for DOM Elements to display you have to enable them by adding the following to your game * configuration object: - * + * * ```javascript * dom { * createContainer: true * } * ``` - * + * * You must also have a parent container for Phaser. This is specified by the `parent` property in the * game config. - * + * * When these two things are added, Phaser will automatically create a DOM Container div that is positioned * over the top of the game canvas. This div is sized to match the canvas, and if the canvas size changes, * as a result of settings within the Scale Manager, the dom container is resized accordingly. - * + * * If you have not already done so, you have to provide a `parent` in the Game Configuration, or the DOM * Container will fail to be created. - * + * * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing * Element that you wish to be placed under the control of Phaser. For example: - * + * * ```javascript * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); * ``` - * + * * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. - * + * * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control * alignment and positioning of the elements next to regular game content. - * + * * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other * methods available in this class to help construct your elements. - * + * * Once the element has been created you can then control it like you would any other Game Object. You can set its * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have * a DOM Element, then a Sprite, then another DOM Element behind it. - * + * * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. - * + * * DOM Game Objects can be added to a Phaser Container, however you should only nest them **one level deep**. * Any further down the chain and they will ignore all root container properties. - * + * * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. - * + * * Note that you should only have DOM Elements in a Scene with a _single_ Camera. If you require multiple cameras, * use parallel scenes to achieve this. - * + * * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and @@ -24608,7 +24946,7 @@ declare namespace Phaser { */ class DOMElement extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this DOM Element in the world. Default 0. * @param y The vertical position of this DOM Element in the world. Default 0. @@ -24639,7 +24977,7 @@ declare namespace Phaser { * updated when its rendered. If, for some reason, you don't want any of these changed other than the * CSS transform, then set this flag to `true`. When `true` only the CSS Transform is applied and it's * up to you to keep track of and set the other properties as required. - * + * * This can be handy if, for example, you've a nested DOM Element and you don't want the opacity to be * picked-up by any of its children. */ @@ -24647,14 +24985,14 @@ declare namespace Phaser { /** * The angle, in radians, by which to skew the DOM Element on the horizontal axis. - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform */ skewX: number; /** * The angle, in radians, by which to skew the DOM Element on the vertical axis. - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform */ skewY: number; @@ -24666,7 +25004,7 @@ declare namespace Phaser { * angle of rotation, in the unit defined by the `rotate3dAngle` property (degrees by default). * * For more details see the following MDN page: - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d */ rotate3d: Phaser.Math.Vector4; @@ -24674,14 +25012,14 @@ declare namespace Phaser { /** * The unit that represents the 3D rotation values. By default this is `deg` for degrees, but can * be changed to any supported unit. See this page for further details: - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d */ rotate3dAngle: string; /** * Sets the CSS `pointerEvents` attribute on the DOM Element during rendering. - * + * * This is 'auto' by default. Changing it may have unintended side-effects with * internal Phaser input handling, such as dragging, so only change this if you * understand the implications. @@ -24690,39 +25028,39 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * For a DOM Element this property is read-only. - * + * * The property `displayWidth` holds the computed bounds of this DOM Element, factoring in scaling. */ readonly width: number; /** * The native (un-scaled) height of this Game Object. - * + * * For a DOM Element this property is read-only. - * + * * The property `displayHeight` holds the computed bounds of this DOM Element, factoring in scaling. */ readonly height: number; /** * The computed display width of this Game Object, based on the `getBoundingClientRect` DOM call. - * + * * The property `width` holds the un-scaled width of this DOM Element. */ readonly displayWidth: number; /** * The computed display height of this Game Object, based on the `getBoundingClientRect` DOM call. - * + * * The property `height` holds the un-scaled height of this DOM Element. */ readonly displayHeight: number; /** * Sets the horizontal and vertical skew values of this DOM Element. - * + * * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform * @param x The angle, in radians, by which to skew the DOM Element on the horizontal axis. Default 0. * @param y The angle, in radians, by which to skew the DOM Element on the vertical axis. Default x. @@ -24735,9 +25073,9 @@ declare namespace Phaser { * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined * by the value of this property. - * + * * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective - * + * * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** * @param value The perspective value, in pixels, that determines the distance between the z plane and the user. * @returns This DOM Element instance. @@ -24749,9 +25087,9 @@ declare namespace Phaser { * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined * by the value of this property. - * + * * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective - * + * * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** */ perspective: number; @@ -24759,14 +25097,14 @@ declare namespace Phaser { /** * Adds one or more native DOM event listeners onto the underlying Element of this Game Object. * The event is then dispatched via this Game Objects standard event emitter. - * + * * For example: - * + * * ```javascript * var div = this.add.dom(x, y, element); - * + * * div.addListener('click'); - * + * * div.on('click', handler); * ``` * @param events The DOM event/s to listen for. You can specify multiple events by separating them with spaces. @@ -24784,22 +25122,22 @@ declare namespace Phaser { /** * Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object, * so you can control it. The `tagName` should be a string and is passed to `document.createElement`: - * + * * ```javascript * this.add.dom().createElement('div'); * ``` - * + * * For more details on acceptable tag names see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement - * + * * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` * value as well. Here is an example of a DOMString: - * + * * ```javascript * this.add.dom().createElement('div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); * ``` - * + * * And using a style object: - * + * * ```javascript * var style = { * 'background-color': 'lime'; @@ -24807,10 +25145,10 @@ declare namespace Phaser { * 'height': '100px'; * 'font': '48px Arial'; * }; - * + * * this.add.dom().createElement('div', style, 'Phaser'); * ``` - * + * * If this Game Object already has an Element, it is removed from the DOM entirely first. * Any event listeners you may have previously created will need to be re-created after this call. * @param tagName A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method. @@ -24823,34 +25161,34 @@ declare namespace Phaser { /** * Binds a new DOM Element to this Game Object. If this Game Object already has an Element it is removed from the DOM * entirely first. Any event listeners you may have previously created will need to be re-created on the new element. - * + * * The `element` argument you pass to this method can be either a string tagName: - * + * * ```javascript *

Phaser

- * + * * this.add.dom().setElement('heading'); * ``` - * + * * Or a reference to an Element instance: - * + * * ```javascript *

Phaser

- * + * * var h1 = document.getElementById('heading'); - * + * * this.add.dom().setElement(h1); * ``` - * + * * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` * value as well. Here is an example of a DOMString: - * + * * ```javascript * this.add.dom().setElement(h1, 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); * ``` - * + * * And using a style object: - * + * * ```javascript * var style = { * 'background-color': 'lime'; @@ -24858,7 +25196,7 @@ declare namespace Phaser { * 'height': '100px'; * 'font': '48px Arial'; * }; - * + * * this.add.dom().setElement(h1, style, 'Phaser'); * ``` * @param element If a string it is passed to `getElementById()`, or it should be a reference to an existing Element. @@ -24872,29 +25210,29 @@ declare namespace Phaser { * Takes a block of html from the HTML Cache, that has previously been preloaded into the game, and then * creates a DOM Element from it. The loaded HTML is set as the `innerHTML` property of the created * element. - * + * * Assume the following html is stored in a file called `loginform.html`: - * + * * ```html * * * ``` - * + * * Which is loaded into your game using the cache key 'login': - * + * * ```javascript * this.load.html('login', 'assets/loginform.html'); * ``` - * + * * You can create a DOM Element from it using the cache key: - * + * * ```javascript * this.add.dom().createFromCache('login'); * ``` - * + * * The optional `elementType` argument controls the container that is created, into which the loaded html is inserted. * The default is a plain `div` object, but any valid tagName can be given. - * + * * If this Game Object already has an Element, it is removed from the DOM entirely first. * Any event listeners you may have previously created will need to be re-created after this call. * @param key The key of the html cache entry to use for this DOM Element. @@ -24906,23 +25244,23 @@ declare namespace Phaser { /** * Takes a string of html and then creates a DOM Element from it. The HTML is set as the `innerHTML` * property of the created element. - * + * * ```javascript * let form = ` * * * `; * ``` - * + * * You can create a DOM Element from it using the string: - * + * * ```javascript * this.add.dom().createFromHTML(form); * ``` - * + * * The optional `elementType` argument controls the type of container that is created, into which the html is inserted. * The default is a plain `div` object, but any valid tagName can be given. - * + * * If this Game Object already has an Element, it is removed from the DOM entirely first. * Any event listeners you may have previously created will need to be re-created after this call. * @param html A string of html to be set as the `innerHTML` property of the created element. @@ -24939,7 +25277,7 @@ declare namespace Phaser { removeElement(): this; /** - * Internal method that sets the `displayWidth` and `displayHeight` properties, and the `clientWidth` + * Internal method that sets the `displayWidth` and `displayHeight` properties, and the `clientWidth` * and `clientHeight` values into the `width` and `height` properties respectively. * * This is called automatically whenever a new element is created or set.undefined @@ -24960,7 +25298,7 @@ declare namespace Phaser { /** * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through * them, looking for the first one that has a matching id. It then returns this child if found, or `null` if not. - * + * * Be aware that class and id names are case-sensitive. * @param id The id to search the children for. * @returns The first matching child DOM Element, or `null` if not found. @@ -24970,7 +25308,7 @@ declare namespace Phaser { /** * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through * them, looking for the first one that has a matching name. It then returns this child if found, or `null` if not. - * + * * Be aware that class and id names are case-sensitive. * @param name The name to search the children for. * @returns The first matching child DOM Element, or `null` if not found. @@ -24986,7 +25324,7 @@ declare namespace Phaser { /** * Sets the `innerText` property of the DOM Element node and updates the internal sizes. - * + * * Note that only certain types of Elements can have `innerText` set on them. * @param text A DOMString representing the rendered text content of the element. * @returns This DOM Element instance. @@ -25247,7 +25585,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -25256,21 +25594,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -25280,21 +25618,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -25306,13 +25644,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -25343,7 +25681,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -25353,11 +25691,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -25366,11 +25704,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -25413,7 +25751,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -25448,12 +25786,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -25467,12 +25805,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -25490,10 +25828,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -25525,7 +25863,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -25539,7 +25877,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -25557,20 +25895,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -25595,9 +25933,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -25646,7 +25984,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -25679,9 +26017,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -25712,14 +26050,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -25731,163 +26069,163 @@ declare namespace Phaser { namespace Events { /** * The Game Object Added to Scene Event. - * + * * This event is dispatched when a Game Object is added to a Scene. - * + * * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. */ const ADDED_TO_SCENE: string; /** * The Game Object Destroy Event. - * + * * This event is dispatched when a Game Object instance is being destroyed. - * + * * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. */ const DESTROY: string; /** * The Game Object Removed from Scene Event. - * + * * This event is dispatched when a Game Object is removed from a Scene. - * + * * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. */ const REMOVED_FROM_SCENE: string; /** * The Video Game Object Complete Event. - * + * * This event is dispatched when a Video finishes playback by reaching the end of its duration. It * is also dispatched if a video marker sequence is being played and reaches the end. - * + * * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, * so never technically 'complete'. - * + * * If a video is stopped from playback, via the `Video.stop` method, it will emit the * `VIDEO_STOP` event instead of this one. - * + * * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. */ const VIDEO_COMPLETE: string; /** * The Video Game Object Created Event. - * + * * This event is dispatched when the texture for a Video has been created. This happens * when enough of the video source has been loaded that the browser is able to render a * frame from it. - * + * * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. */ const VIDEO_CREATED: string; /** * The Video Game Object Error Event. - * + * * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * + * * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. */ const VIDEO_ERROR: string; /** * The Video Game Object Locked Event. - * + * * This event is dispatched when a Video was attempted to be played, but the browser prevented it * from doing so due to the Media Engagement Interaction policy. - * + * * If you get this event you will need to wait for the user to interact with the browser before * the video will play. This is a browser security measure to prevent autoplaying videos with * audio. An interaction includes a mouse click, a touch, or a key press. - * + * * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. */ const VIDEO_LOCKED: string; /** * The Video Game Object Loop Event. - * + * * This event is dispatched when a Video that is currently playing has looped. This only * happens if the `loop` parameter was specified, or the `setLoop` method was called, * and if the video has a fixed duration. Video streams, for example, cannot loop, as * they have no duration. - * + * * Looping is based on the result of the Video `timeupdate` event. This event is not * frame-accurate, due to the way browsers work, so please do not rely on this loop * event to be time or frame precise. - * + * * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. */ const VIDEO_LOOP: string; /** * The Video Game Object Metadata Event. - * + * * This event is dispatched when a Video has access to the metadata. - * + * * Listen for it from a Video Game Object instance using `Video.on('metadata', listener)`. */ const VIDEO_METADATA: string; /** * The Video Game Object Playing Event. - * + * * The playing event is fired after playback is first started, * and whenever it is restarted. For example it is fired when playback * resumes after having been paused or delayed due to lack of data. - * + * * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. */ const VIDEO_PLAYING: string; /** * The Video Game Object Play Event. - * + * * This event is dispatched when a Video begins playback. For videos that do not require * interaction unlocking, this is usually as soon as the `Video.play` method is called. * However, for videos that require unlocking, it is fired once playback begins after * they've been unlocked. - * + * * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. */ const VIDEO_PLAY: string; /** * The Video Game Object Seeked Event. - * + * * This event is dispatched when a Video completes seeking to a new point in its timeline. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. */ const VIDEO_SEEKED: string; /** * The Video Game Object Seeking Event. - * + * * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. */ const VIDEO_SEEKING: string; /** * The Video Game Object Stalled Event. - * + * * This event is dispatched by a Video Game Object when the video playback stalls. - * + * * This can happen if the video is buffering. - * + * * If will fire for any of the following native DOM events: - * + * * `stalled` * `suspend` * `waiting` - * + * * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. - * + * * Note that being stalled isn't always a negative thing. A video can be stalled if it * has downloaded enough data in to its buffer to not need to download any more until * the current batch of frames have rendered. @@ -25896,45 +26234,45 @@ declare namespace Phaser { /** * The Video Game Object Stopped Event. - * + * * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * + * * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. */ const VIDEO_STOP: string; /** * The Video Game Object Texture Ready Event. - * + * * This event is dispatched by a Video Game Object when it has finished creating its texture. - * + * * This happens when the video has finished loading enough data for its first frame. - * + * * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, * then you should listen for this event first, before creating the Sprites that use it. - * + * * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. */ const VIDEO_TEXTURE: string; /** * The Video Game Object Unlocked Event. - * + * * This event is dispatched when a Video that was prevented from playback due to the browsers * Media Engagement Interaction policy, is unlocked by a user gesture. - * + * * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. */ const VIDEO_UNLOCKED: string; /** * The Video Game Object Unsupported Event. - * + * * This event is dispatched by a Video Game Object if the media source * (which may be specified as a MediaStream, MediaSource, Blob, or File, * for example) doesn't represent a supported media format. - * + * * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. */ const VIDEO_UNSUPPORTED: string; @@ -25944,12 +26282,12 @@ declare namespace Phaser { /** * An Extern Game Object is a special type of Game Object that allows you to pass * rendering off to a 3rd party. - * + * * When you create an Extern and place it in the display list of a Scene, the renderer will * process the list as usual. When it finds an Extern it will flush the current batch * and prepare a transform matrix which your render function can * take advantage of, if required. - * + * * The WebGL context is then left in a 'clean' state, ready for you to bind your own shaders, * or draw to it, whatever you wish to do. This should all take place in the `render` method. * The correct way to deploy an Extern object is to create a class that extends it, then @@ -25971,7 +26309,7 @@ declare namespace Phaser { */ class Extern extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. */ constructor(scene: Phaser.Scene); @@ -26246,7 +26584,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -26292,21 +26630,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -26316,21 +26654,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -26342,13 +26680,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -26379,7 +26717,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -26389,11 +26727,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -26402,11 +26740,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -26527,7 +26865,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -26562,12 +26900,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -26581,12 +26919,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -26604,10 +26942,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -26624,7 +26962,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -26633,7 +26971,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -26642,30 +26980,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -26675,12 +27013,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -26714,11 +27052,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -26730,14 +27068,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -26806,11 +27144,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -26878,7 +27216,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -26892,7 +27230,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -26910,20 +27248,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -26948,9 +27286,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -26999,7 +27337,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -27032,9 +27370,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -27065,14 +27403,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -28089,10 +28427,10 @@ declare namespace Phaser { * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics * object it will be empty. - * + * * To draw to it you must first specify a line style or fill style (or both), draw shapes using paths, and finally * fill or stroke them. For example: - * + * * ```javascript * graphics.lineStyle(5, 0xFF00FF, 1.0); * graphics.beginPath(); @@ -28101,21 +28439,21 @@ declare namespace Phaser { * graphics.closePath(); * graphics.strokePath(); * ``` - * + * * There are also many helpful methods that draw and fill/stroke common shapes for you. - * + * * ```javascript * graphics.lineStyle(5, 0xFF00FF, 1.0); * graphics.fillStyle(0xFFFFFF, 1.0); * graphics.fillRect(50, 50, 400, 200); * graphics.strokeRect(50, 50, 400, 200); * ``` - * + * * When a Graphics object is rendered it will render differently based on if the game is running under Canvas or WebGL. * Under Canvas it will use the HTML Canvas context drawing operations to draw the path. * Under WebGL the graphics data is decomposed into polygons. Both of these are expensive processes, especially with * complex shapes. - * + * * If your Graphics object doesn't change much (or at all) once you've drawn your shape to it, then you will help * performance by calling {@link Phaser.GameObjects.Graphics#generateTexture}. This will 'bake' the Graphics object into * a Texture, and return it. You can then use this Texture for Sprites or other display objects. If your Graphics object @@ -28132,7 +28470,7 @@ declare namespace Phaser { */ class Graphics extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { /** - * + * * @param scene The Scene to which this Graphics object belongs. * @param options Options that set the position and default style of this Graphics object. */ @@ -28225,15 +28563,15 @@ declare namespace Phaser { /** * Sets a gradient fill style. This is a WebGL only feature. - * + * * The gradient color values represent the 4 corners of an untransformed rectangle. * The gradient is used to color all filled shapes and paths drawn after calling this method. * If you wish to turn a gradient off, call `fillStyle` and provide a new single fill color. - * + * * When filling a triangle only the first 3 color values provided are used for the 3 points of a triangle. - * + * * This feature is best used only on rectangles and triangles. All other shapes will give strange results. - * + * * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used * will be filled with a gradient on its own. There is no ability to gradient fill a shape or path as a single * entity at this time. @@ -28251,13 +28589,13 @@ declare namespace Phaser { /** * Sets a gradient line style. This is a WebGL only feature. - * + * * The gradient color values represent the 4 corners of an untransformed rectangle. * The gradient is used to color all stroked shapes and paths drawn after calling this method. * If you wish to turn a gradient off, call `lineStyle` and provide a new single line color. - * + * * This feature is best used only on single lines. All other shapes will give strange results. - * + * * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used * will be filled with a gradient on its own. There is no ability to gradient stroke a shape or path as a single * entity at this time. @@ -28291,7 +28629,7 @@ declare namespace Phaser { /** * Fill the current path. - * + * * This is an alias for `Graphics.fillPath` and does the same thing. * It was added to match the CanvasRenderingContext 2D API.undefined * @returns This Game Object. @@ -28306,7 +28644,7 @@ declare namespace Phaser { /** * Stroke the current path. - * + * * This is an alias for `Graphics.strokePath` and does the same thing. * It was added to match the CanvasRenderingContext 2D API.undefined * @returns This Game Object. @@ -28403,7 +28741,7 @@ declare namespace Phaser { /** * Fill the given point. - * + * * Draws a square at the given position, 1 pixel in size by default. * @param point The point to fill. * @param size The size of the square to draw. Default 1. @@ -28413,7 +28751,7 @@ declare namespace Phaser { /** * Fill a point at the given position. - * + * * Draws a square at the given position, 1 pixel in size by default. * @param x The x coordinate of the point. * @param y The y coordinate of the point. @@ -28479,7 +28817,7 @@ declare namespace Phaser { /** * Draw a line from the current drawing position to the given position. - * + * * Moves the current drawing position to the given position. * @param x The x coordinate to draw the line to. * @param y The y coordinate to draw the line to. @@ -28497,9 +28835,9 @@ declare namespace Phaser { /** * Stroke the shape represented by the given array of points. - * + * * Pass `closeShape` to automatically close the shape by joining the last to the first point. - * + * * Pass `closePath` to automatically close the path before it is stroked. * @param points The points to stroke. * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. @@ -28511,9 +28849,9 @@ declare namespace Phaser { /** * Fill the shape represented by the given array of points. - * + * * Pass `closeShape` to automatically close the shape by joining the last to the first point. - * + * * Pass `closePath` to automatically close the path before it is filled. * @param points The points to fill. * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. @@ -28563,16 +28901,16 @@ declare namespace Phaser { /** * Draw an arc. - * + * * This method can be used to create circles, or parts of circles. - * + * * Make sure you call `beginPath` before starting the arc unless you wish for the arc to automatically * close when filled or stroked. - * + * * Use the optional `overshoot` argument increase the number of iterations that take place when * the arc is rendered in WebGL. This is useful if you're drawing an arc with an especially thick line, * as it will allow the arc to fully join-up. Try small values at first, i.e. 0.01. - * + * * Call {@link Phaser.GameObjects.Graphics#fillPath} or {@link Phaser.GameObjects.Graphics#strokePath} after calling * this method to draw the arc. * @param x The x coordinate of the center of the circle. @@ -28589,10 +28927,10 @@ declare namespace Phaser { /** * Creates a pie-chart slice shape centered at `x`, `y` with the given radius. * You must define the start and end angle of the slice. - * + * * Setting the `anticlockwise` argument to `true` creates a shape similar to Pacman. * Setting it to `false` creates a shape like a slice of pie. - * + * * This method will begin a new path and close the path at the end of it. * To display the actual slice you need to call either `strokePath` or `fillPath` after it. * @param x The horizontal center of the slice. @@ -28616,7 +28954,7 @@ declare namespace Phaser { /** * Restores the most recently saved state of the Graphics by popping from the state stack. - * + * * Use {@link Phaser.GameObjects.Graphics#save} to save the current state, and call this afterwards to restore that state. * * If there is no saved state, this command does nothing.undefined @@ -28626,10 +28964,10 @@ declare namespace Phaser { /** * Inserts a translation command into this Graphics objects command buffer. - * + * * All objects drawn _after_ calling this method will be translated * by the given amount. - * + * * This does not change the position of the Graphics object itself, * only of the objects drawn by it after calling this method. * @param x The horizontal translation to apply. @@ -28640,10 +28978,10 @@ declare namespace Phaser { /** * Inserts a scale command into this Graphics objects command buffer. - * + * * All objects drawn _after_ calling this method will be scaled * by the given amount. - * + * * This does not change the scale of the Graphics object itself, * only of the objects drawn by it after calling this method. * @param x The horizontal scale to apply. @@ -28654,10 +28992,10 @@ declare namespace Phaser { /** * Inserts a rotation command into this Graphics objects command buffer. - * + * * All objects drawn _after_ calling this method will be rotated * by the given amount. - * + * * This does not change the rotation of the Graphics object itself, * only of the objects drawn by it after calling this method. * @param radians The rotation angle, in radians. @@ -28673,13 +29011,13 @@ declare namespace Phaser { /** * Generate a texture from this Graphics object. - * + * * If `key` is a string it'll generate a new texture using it and add it into the * Texture Manager (assuming no key conflict happens). * * If `key` is a Canvas it will draw the Graphics to that canvas context. Note that it will NOT * automatically upload it to the GPU in WebGL mode. - * + * * Please understand that the texture is created via the Canvas API of the browser, therefore some * Graphics features, such as `fillGradientStyle`, will not appear on the resulting texture, * as they're unsupported by the Canvas API. @@ -28939,7 +29277,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -28948,21 +29286,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -28972,21 +29310,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -28998,13 +29336,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -29035,7 +29373,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -29045,11 +29383,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -29058,11 +29396,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -29128,10 +29466,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -29152,12 +29490,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -29251,7 +29589,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -29265,7 +29603,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -29283,20 +29621,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -29321,9 +29659,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -29372,7 +29710,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -29405,9 +29743,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -29438,14 +29776,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -29454,12 +29792,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -29473,12 +29811,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -29496,10 +29834,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -29525,12 +29863,12 @@ declare namespace Phaser { * especially useful for frequently spawned objects such as bullets, particles, or enemies. * * Group membership is non-exclusive. A Game Object can belong to several groups, one group, or none. - * + * * Groups themselves aren't displayable, and can't be positioned, rotated, scaled, or hidden. */ class Group extends Phaser.Events.EventEmitter { /** - * + * * @param scene The scene this group belongs to. * @param children Game Objects to add to this group; or the `config` argument. * @param config Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. @@ -29583,7 +29921,7 @@ declare namespace Phaser { /** * A default texture key to use when creating new group members. - * + * * This is used in {@link Phaser.GameObjects.Group#create} * but not in {@link Phaser.GameObjects.Group#createMultiple}. */ @@ -29628,7 +29966,7 @@ declare namespace Phaser { /** * Creates a new Game Object and adds it to this group, unless the group {@link Phaser.GameObjects.Group#isFull is full}. - * + * * Calls {@link Phaser.GameObjects.Group#createCallback}. * @param x The horizontal position of the new Game Object in the world. Default 0. * @param y The vertical position of the new Game Object in the world. Default 0. @@ -29642,9 +29980,9 @@ declare namespace Phaser { /** * Creates several Game Objects and adds them to this group. - * + * * If the group becomes {@link Phaser.GameObjects.Group#isFull}, no further Game Objects are created. - * + * * Calls {@link Phaser.GameObjects.Group#createMultipleCallback} and {@link Phaser.GameObjects.Group#createCallback}. * @param config Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn. * @returns The newly created Game Objects. @@ -29667,7 +30005,7 @@ declare namespace Phaser { /** * Adds a Game Object to this group. - * + * * Calls {@link Phaser.GameObjects.Group#createCallback}. * @param child The Game Object to add. * @param addToScene Also add the Game Object to the scene. Default false. @@ -29677,7 +30015,7 @@ declare namespace Phaser { /** * Adds several Game Objects to this group. - * + * * Calls {@link Phaser.GameObjects.Group#createCallback}. * @param children The Game Objects to add. * @param addToScene Also add the Game Objects to the scene. Default false. @@ -29687,7 +30025,7 @@ declare namespace Phaser { /** * Removes a member of this Group and optionally removes it from the Scene and / or destroys it. - * + * * Calls {@link Phaser.GameObjects.Group#removeCallback}. * @param child The Game Object to remove. * @param removeFromScene Optionally remove the Group member from the Scene it belongs to. Default false. @@ -29698,7 +30036,7 @@ declare namespace Phaser { /** * Removes all members of this Group and optionally removes them from the Scene and / or destroys them. - * + * * Does not call {@link Phaser.GameObjects.Group#removeCallback}. * @param removeFromScene Optionally remove each Group member from the Scene. Default false. * @param destroyChild Optionally call destroy on the removed Group members. Default false. @@ -29727,9 +30065,9 @@ declare namespace Phaser { /** * Returns all children in this Group that match the given criteria based on the `property` and `value` arguments. - * + * * For example: `getMatching('visible', true)` would return only children that have their `visible` property set. - * + * * Optionally, you can specify a start and end index. For example if the Group has 100 elements, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50. @@ -29744,7 +30082,7 @@ declare namespace Phaser { /** * Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. @@ -29761,7 +30099,7 @@ declare namespace Phaser { /** * Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param nth The nth matching Group member to search for. @@ -29779,7 +30117,7 @@ declare namespace Phaser { /** * Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. @@ -29796,7 +30134,7 @@ declare namespace Phaser { /** * Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param nth The nth matching Group member to search for. @@ -29814,7 +30152,7 @@ declare namespace Phaser { /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, * assigns `x` and `y`, and returns the member. - * + * * If no inactive member is found and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * The new Game Object will have its active state set to `true`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. @@ -29830,7 +30168,7 @@ declare namespace Phaser { /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `true`, * assigns `x` and `y`, and returns the member. - * + * * If no active member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. @@ -29846,7 +30184,7 @@ declare namespace Phaser { /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, * assigns `x` and `y`, and returns the member. - * + * * If no inactive member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. * The new Game Object will have an active state set to `true`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. @@ -29988,7 +30326,7 @@ declare namespace Phaser { /** * Iterate through the group members changing the position of each element to be that of the element that came before * it in the array (or after it if direction = 1) - * + * * The first group member position is set to x/y. * @param x The x coordinate to place the first item in the array at. * @param y The y coordinate to place the first item in the array at. @@ -30142,12 +30480,12 @@ declare namespace Phaser { /** * Empties this Group of all children and removes it from the Scene. - * + * * Does not call {@link Phaser.GameObjects.Group#removeCallback}. - * + * * Children of this Group will _not_ be removed from the Scene by calling this method * unless you specify the `removeFromScene` parameter. - * + * * Children of this Group will also _not_ be destroyed by calling this method * unless you specify the `destroyChildren` parameter. * @param destroyChildren Also {@link Phaser.GameObjects.GameObject#destroy} each Group member. Default false. @@ -30159,7 +30497,7 @@ declare namespace Phaser { /** * An Image Game Object. - * + * * An Image is a light-weight Game Object useful for the display of static images in your game, * such as logos, backgrounds, scenery or other non-animated elements. Images can have input * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an @@ -30167,7 +30505,7 @@ declare namespace Phaser { */ class Image extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -30408,7 +30746,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -30454,21 +30792,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -30478,21 +30816,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -30504,13 +30842,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -30541,7 +30879,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -30551,11 +30889,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -30564,11 +30902,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -30655,7 +30993,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30666,7 +31004,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30677,7 +31015,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30688,7 +31026,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30699,7 +31037,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30710,7 +31048,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30721,7 +31059,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30732,7 +31070,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30743,7 +31081,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -30825,10 +31163,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -30849,12 +31187,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -30900,7 +31238,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -31002,12 +31340,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -31021,12 +31359,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -31044,10 +31382,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -31064,7 +31402,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -31073,7 +31411,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -31082,30 +31420,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -31115,12 +31453,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -31161,26 +31499,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -31193,7 +31531,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -31203,14 +31541,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -31279,11 +31617,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -31351,7 +31689,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -31365,7 +31703,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -31383,20 +31721,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -31421,9 +31759,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -31472,7 +31810,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -31505,9 +31843,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -31538,14 +31876,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -31556,28 +31894,28 @@ declare namespace Phaser { /** * A Layer Game Object. - * + * * A Layer is a special type of Game Object that acts as a Display List. You can add any type of Game Object * to a Layer, just as you would to a Scene. Layers can be used to visually group together 'layers' of Game * Objects: - * + * * ```javascript * const spaceman = this.add.sprite(150, 300, 'spaceman'); * const bunny = this.add.sprite(400, 300, 'bunny'); * const elephant = this.add.sprite(650, 300, 'elephant'); - * + * * const layer = this.add.layer(); - * + * * layer.add([ spaceman, bunny, elephant ]); * ``` - * + * * The 3 sprites in the example above will now be managed by the Layer they were added to. Therefore, * if you then set `layer.setVisible(false)` they would all vanish from the display. - * + * * You can also control the depth of the Game Objects within the Layer. For example, calling the * `setDepth` method of a child of a Layer will allow you to adjust the depth of that child _within the * Layer itself_, rather than the whole Scene. The Layer, too, can have its depth set as well. - * + * * The Layer class also offers many different methods for manipulating the list, such as the * methods `moveUp`, `moveDown`, `sendToBack`, `bringToTop` and so on. These allow you to change the * display list position of the Layers children, causing it to adjust the order in which they are @@ -31586,10 +31924,10 @@ declare namespace Phaser { * Layers have no position or size within the Scene. This means you cannot enable a Layer for * physics or input, or change the position, rotation or scale of a Layer. They also have no scroll * factor, texture, tint, origin, crop or bounds. - * + * * If you need those kind of features then you should use a Container instead. Containers can be added * to Layers, but Layers cannot be added to Containers. - * + * * However, you can set the Alpha, Blend Mode, Depth, Mask and Visible state of a Layer. These settings * will impact all children being rendered by the Layer. * @@ -31601,7 +31939,7 @@ declare namespace Phaser { */ class Layer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param children An optional array of Game Objects to add to this Layer. */ @@ -31609,9 +31947,9 @@ declare namespace Phaser { /** * A reference to the Scene to which this Game Object belongs. - * + * * Game Objects can only belong to one Scene. - * + * * You should consider this property as being read-only. You cannot move a * Game Object to another Scene by simply changing it. */ @@ -31634,7 +31972,7 @@ declare namespace Phaser { /** * A Layer cannot be enabled for input. - * + * * This method does nothing and is kept to ensure * the Layer has the same shape as a Game Object.undefined * @returns This GameObject. @@ -31643,7 +31981,7 @@ declare namespace Phaser { /** * A Layer cannot be enabled for input. - * + * * This method does nothing and is kept to ensure * the Layer has the same shape as a Game Object.undefined * @returns This GameObject. @@ -31652,7 +31990,7 @@ declare namespace Phaser { /** * A Layer cannot be enabled for input. - * + * * This method does nothing and is kept to ensure * the Layer has the same shape as a Game Object.undefined * @returns This GameObject. @@ -32078,14 +32416,14 @@ declare namespace Phaser { /** * Destroys this Layer removing it from the Display List and Update List and * severing all ties to parent resources. - * + * * Also destroys all children of this Layer. If you do not wish for the * children to be destroyed, you should move them from this Layer first. - * + * * Use this to remove this Layer from your game if you don't ever plan to use it again. * As long as no reference to it exists within your own code it should become free for * garbage collection by the browser. - * + * * If you just want to temporarily disable an object then look at using the * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. * @param fromScene `True` if this Game Object is being destroyed by the Scene, `false` if not. Default false. @@ -32331,7 +32669,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -32340,21 +32678,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -32364,21 +32702,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -32390,13 +32728,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -32427,7 +32765,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -32437,11 +32775,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -32450,11 +32788,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -32474,10 +32812,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -32498,12 +32836,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -32515,14 +32853,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -32533,7 +32871,7 @@ declare namespace Phaser { /** * A 2D Light. - * + * * These are created by the {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`. * * Any Game Objects with the Lighting Component, and `setLighting(true)`, @@ -32542,12 +32880,12 @@ declare namespace Phaser { * If they don't, the Lights will use the default normal map, a flat surface. * * They can also simply be used to represent a point light for your own purposes. - * + * * Lights cannot be added to Containers. They are designed to exist in the root of a Scene. */ class Light extends Phaser.Geom.Circle implements Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { /** - * + * * @param x The horizontal position of the light. * @param y The vertical position of the light. * @param radius The radius of the light. @@ -32722,7 +33060,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -32757,12 +33095,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -32776,12 +33114,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -32799,10 +33137,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -32819,14 +33157,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -32881,31 +33219,31 @@ declare namespace Phaser { /** * Creates a new Point Light Game Object and adds it to the Scene. - * + * * Note: This method will only be available if the Point Light Game Object has been built into Phaser. - * + * * The Point Light Game Object provides a way to add a point light effect into your game, * without the expensive shader processing requirements of the traditional Light Game Object. - * + * * The difference is that the Point Light renders using a custom shader, designed to give the * impression of a point light source, of variable radius, intensity and color, in your game. * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their * normal maps for calculations. This makes them extremely fast to render compared to Lights * and perfect for special effects, such as flickering torches or muzzle flashes. - * + * * For maximum performance you should batch Point Light Game Objects together. This means * ensuring they follow each other consecutively on the display list. Ideally, use a Layer * Game Object and then add just Point Lights to it, so that it can batch together the rendering * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in * your game then it's perfectly safe to mix them into the display list as normal. However, if * you're using a large number of them, please consider how they are mixed into the display list. - * + * * The renderer will automatically cull Point Lights. Those with a radius that does not intersect * with the Camera will be skipped in the rendering list. This happens automatically and the * culled state is refreshed every frame, for every camera. - * + * * The origin of a Point Light is always 0.5 and it cannot be changed. - * + * * Point Lights are a WebGL only feature and do not have a Canvas counterpart. * @param x The horizontal position of this Point Light in the world. * @param y The vertical position of this Point Light in the world. @@ -32936,7 +33274,7 @@ declare namespace Phaser { /** * Get all lights that can be seen by the given Camera. - * + * * It will automatically cull lights that are outside the world view of the Camera. * * If more lights are returned than supported by the renderer, the lights are then culled @@ -33007,7 +33345,7 @@ declare namespace Phaser { /** * Destroy the Lights Manager. - * + * * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}. */ destroy(): void; @@ -33018,13 +33356,13 @@ declare namespace Phaser { * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for rendering objects with dynamic lighting. * * Available from within a Scene via `this.lights`. - * + * * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method: - * + * * ```javascript * // Enable the Lights Manager because it is disabled by default * this.lights.enable(); - * + * * // Create a Light at [400, 300] with a radius of 200 * this.lights.addLight(400, 300, 200); * ``` @@ -33037,7 +33375,7 @@ declare namespace Phaser { */ class LightsPlugin extends Phaser.GameObjects.LightsManager { /** - * + * * @param scene The Scene that this Lights Plugin belongs to. */ constructor(scene: Phaser.Scene); @@ -33061,7 +33399,7 @@ declare namespace Phaser { /** * Destroy the Lights Plugin. - * + * * Cleans up all references. */ destroy(): void; @@ -33073,13 +33411,13 @@ declare namespace Phaser { * can be stretched both horizontally and vertically, but that retains * fixed-sized corners. The dimensions of the corners are set via the * parameters to this class. - * + * * This is extremely useful for UI and button like elements, where you need * them to expand to accommodate the content without distorting the texture. - * + * * The texture you provide for this Game Object should be based on the * following layout structure: - * + * * ``` * A B * +---+----------------------+---+ @@ -33092,19 +33430,19 @@ declare namespace Phaser { * D | 7 | 8 | 9 | * +---+----------------------+---+ * ``` - * + * * When changing this objects width and / or height: - * + * * areas 1, 3, 7 and 9 (the corners) will remain unscaled * areas 2 and 8 will be stretched horizontally only * areas 4 and 6 will be stretched vertically only * area 5 will be stretched both horizontally and vertically - * + * * You can also create a 3 slice Game Object: - * + * * This works in a similar way, except you can only stretch it horizontally. * Therefore, it requires less configuration: - * + * * ``` * A B * +---+----------------------+---+ @@ -33113,23 +33451,23 @@ declare namespace Phaser { * | | | | * +---+----------------------+---+ * ``` - * + * * When changing this objects width (you cannot change its height) - * + * * areas 1 and 3 will remain unscaled * area 2 will be stretched horizontally - * + * * The above configuration concept is adapted from the Pixi NineSlicePlane. - * + * * To specify a 3 slice object instead of a 9 slice you should only * provide the `leftWidth` and `rightWidth` parameters. To create a 9 slice * you must supply all parameters. - * + * * The _minimum_ width this Game Object can be is the total of * `leftWidth` + `rightWidth`. The _minimum_ height this Game Object * can be is the total of `topHeight` + `bottomHeight`. * If you need to display this object at a smaller size, you can scale it. - * + * * In terms of performance, using a 3 slice Game Object is the equivalent of * having 3 Sprites in a row. Using a 9 slice Game Object is the equivalent * of having 9 Sprites in a row. The vertices of this object are all batched @@ -33147,7 +33485,7 @@ declare namespace Phaser { */ class NineSlice extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of the center of this Game Object in the world. * @param y The vertical position of the center of this Game Object in the world. @@ -33167,7 +33505,7 @@ declare namespace Phaser { /** * An array of Vertex objects that correspond to the quads that make-up * this Nine Slice Game Object. They are stored in the following order: - * + * * Top Left - Indexes 0 - 5 * Top Center - Indexes 6 - 11 * Top Right - Indexes 12 - 17 @@ -33177,12 +33515,12 @@ declare namespace Phaser { * Bottom Left - Indexes 36 - 41 * Bottom Center - Indexes 42 - 47 * Bottom Right - Indexes 48 - 53 - * + * * Each quad is represented by 6 Vertex instances. - * + * * This array will contain 18 elements for a 3 slice object * and 54 for a nine slice object. - * + * * You should never modify this array once it has been populated. */ vertices: Phaser.GameObjects.NineSliceVertex[]; @@ -33199,7 +33537,7 @@ declare namespace Phaser { /** * The size of the top horizontal bar (C). - * + * * If this is a 3 slice object this property will be set to the * height of the texture being used. */ @@ -33207,7 +33545,7 @@ declare namespace Phaser { /** * The size of the bottom horizontal bar (D). - * + * * If this is a 3 slice object this property will be set to zero. */ readonly bottomHeight: number; @@ -33254,10 +33592,10 @@ declare namespace Phaser { /** * Resets the width, height and slices for this NineSlice Game Object. - * + * * This allows you to modify the texture being used by this object and then reset the slice configuration, * to avoid having to destroy this Game Object in order to use it for a different game element. - * + * * Please note that you cannot change a 9-slice to a 3-slice or vice versa. * @param width The width of the Nine Slice Game Object. You can adjust the width post-creation. Default 256. * @param height The height of the Nine Slice Game Object. If this is a 3 slice object the height will be fixed to the height of the texture and cannot be changed. Default 256. @@ -33296,7 +33634,7 @@ declare namespace Phaser { /** * Internally updates the position coordinates across all vertices of the * given quad offset. - * + * * You should not typically need to call this method directly, but it * is left public should an extended class require it. * @param offset The offset in the vertices array of the quad to update. @@ -33310,7 +33648,7 @@ declare namespace Phaser { /** * Internally updates the UV coordinates across all vertices of the * given quad offset, based on the frame size. - * + * * You should not typically need to call this method directly, but it * is left public should an extended class require it. * @param offset The offset in the vertices array of the quad to update. @@ -33339,7 +33677,7 @@ declare namespace Phaser { * * To modify the tint color once set, either call this method again with new values or use the * `tint` property. - * + * * To remove a tint call `clearTint`, or call this method with no parameters. * @param color The tint being applied to the entire Game Object. Default 0xffffff. * @returns This Game Object instance. @@ -33374,10 +33712,10 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * Setting this value will adjust the way in which this Nine Slice * object scales horizontally, if configured to do so. - * + * * The _minimum_ width this Game Object can be is the total of * `leftWidth` + `rightWidth`. If you need to display this object * at a smaller size, you can also scale it. @@ -33386,14 +33724,14 @@ declare namespace Phaser { /** * The displayed height of this Game Object. - * + * * Setting this value will adjust the way in which this Nine Slice * object scales vertically, if configured to do so. - * + * * The _minimum_ height this Game Object can be is the total of * `topHeight` + `bottomHeight`. If you need to display this object * at a smaller size, you can also scale it. - * + * * If this is a 3-slice object, you can only stretch it horizontally * and changing the height will be ignored. */ @@ -33401,32 +33739,32 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object. - * + * * For a Nine Slice Game Object this means it will be stretched (or shrunk) horizontally * and vertically depending on the dimensions given to this method, in accordance with * how it has been configured for the various corner sizes. - * + * * If this is a 3-slice object, you can only stretch it horizontally * and changing the height will be ignored. - * + * * If you have enabled this Game Object for input, changing the size will also change the * size of the hit area. * @param width The width of this Game Object. @@ -33437,7 +33775,7 @@ declare namespace Phaser { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. * @param width The width of this Game Object. * @param height The height of this Game Object. @@ -33463,7 +33801,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -33721,7 +34059,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -33730,21 +34068,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -33754,21 +34092,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -33780,13 +34118,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -33817,7 +34155,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -33827,11 +34165,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -33840,11 +34178,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -33853,7 +34191,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33864,7 +34202,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33875,7 +34213,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33886,7 +34224,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33897,7 +34235,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33908,7 +34246,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33919,7 +34257,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33930,7 +34268,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33941,7 +34279,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -33977,10 +34315,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -34001,12 +34339,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -34126,12 +34464,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -34145,12 +34483,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -34168,10 +34506,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -34198,11 +34536,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -34214,14 +34552,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -34247,7 +34585,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -34261,7 +34599,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -34279,20 +34617,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -34317,9 +34655,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -34368,7 +34706,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -34401,9 +34739,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -34434,14 +34772,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -41130,28 +41468,28 @@ declare namespace Phaser { */ class EmitterColorOp extends Phaser.GameObjects.Particles.EmitterOp { /** - * + * * @param key The name of the property. */ constructor(key: string); /** * An array containing the red color values. - * + * * Populated during the `setMethods` method. */ r: number[]; /** * An array containing the green color values. - * + * * Populated during the `setMethods` method. */ g: number[]; /** * An array containing the blue color values. - * + * * Populated during the `setMethods` method. */ b: number[]; @@ -41182,7 +41520,7 @@ declare namespace Phaser { /** * An `onEmit` callback for an eased property. - * + * * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterColorOp#easeValueUpdate}. * @param particle The particle. * @param key The name of the property. @@ -41206,16 +41544,16 @@ declare namespace Phaser { /** * This class is responsible for taking control over a single property * in the Particle class and managing its emission and updating functions. - * + * * Particles properties such as `x`, `y`, `scaleX`, `lifespan` and others all use * EmitterOp instances to manage them, as they can be given in a variety of * formats: from simple values, to functions, to dynamic callbacks. - * + * * See the `ParticleEmitter` class for more details on emitter op configuration. */ class EmitterOp { /** - * + * * @param key The name of the property. * @param defaultValue The default value of the property. * @param emitOnly Whether the property can only be modified when a Particle is emitted. Default false. @@ -41229,7 +41567,7 @@ declare namespace Phaser { /** * The current value of this property. - * + * * This can be a simple value, an array, a function or an onEmit * configuration object. */ @@ -41237,7 +41575,7 @@ declare namespace Phaser { /** * The default value of this property. - * + * * This can be a simple value, an array, a function or an onEmit * configuration object. */ @@ -41267,7 +41605,7 @@ declare namespace Phaser { /** * The start value for this property to ease between. - * + * * If an interpolation this holds a reference to the number data array. */ start: number | number[]; @@ -41295,10 +41633,10 @@ declare namespace Phaser { /** * Whether this property can only be modified when a Particle is emitted. - * + * * Set to `true` to allow only {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} callbacks to be set and * affect this property. - * + * * Set to `false` to allow both {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks to be set and affect this property. */ @@ -41321,7 +41659,7 @@ declare namespace Phaser { /** * The onEmit method type of this EmitterOp. - * + * * Set as part of `setMethod` and cached here to avoid * re-setting when only the value changes. */ @@ -41329,7 +41667,7 @@ declare namespace Phaser { /** * Load the property from a Particle Emitter configuration object. - * + * * Optionally accepts a new property key to use, replacing the current one. * @param config Settings for the Particle Emitter that owns this property. * @param newKey The new key to use for this property, if any. @@ -41476,7 +41814,7 @@ declare namespace Phaser { /** * An `onEmit` callback for an eased property. - * + * * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate}. * @param particle The particle. * @param key The name of the property. @@ -41497,7 +41835,7 @@ declare namespace Phaser { /** * Destroys this EmitterOp instance and all of its references. - * + * * Called automatically when the ParticleEmitter that owns this * EmitterOp is destroyed. */ @@ -41508,15 +41846,15 @@ declare namespace Phaser { /** * The Gravity Well Particle Processor applies a force on the particles to draw * them towards, or repel them from, a single point. - * + * * The force applied is inversely proportional to the square of the distance * from the particle to the point, in accordance with Newton's law of gravity. - * + * * This simulates the effect of gravity over large distances (as between planets, for example). */ class GravityWell extends Phaser.GameObjects.Particles.ParticleProcessor { /** - * + * * @param x The x coordinate of the Gravity Well, in world space. Default 0. * @param y The y coordinate of the Gravity Well, in world space. Default 0. * @param power The strength of the gravity force - larger numbers produce a stronger force. Default 0. @@ -41582,14 +41920,14 @@ declare namespace Phaser { */ class Particle { /** - * + * * @param emitter The Emitter to which this Particle belongs. */ constructor(emitter: Phaser.GameObjects.Particles.ParticleEmitter); /** * The Emitter to which this Particle belongs. - * + * * A Particle can only belong to a single Emitter and is created, updated and destroyed by it. */ emitter: Phaser.GameObjects.Particles.ParticleEmitter; @@ -41616,7 +41954,7 @@ declare namespace Phaser { /** * The coordinates of this Particle in world space. - * + * * Updated as part of `computeVelocity`. */ worldPosition: Phaser.Math.Vector2; @@ -41721,9 +42059,9 @@ declare namespace Phaser { /** * A reference to the Scene to which this Game Object belongs. - * + * * Game Objects can only belong to one Scene. - * + * * You should consider this property as being read-only. You cannot move a * Game Object to another Scene by simply changing it. */ @@ -41731,11 +42069,11 @@ declare namespace Phaser { /** * The Animation State component of this Particle. - * + * * This component provides features to apply animations to this Particle. * It is responsible for playing, loading, queuing animations for later playback, * mixing between animations and setting the current animation frame to this Particle. - * + * * It is created only if the Particle's Emitter has at least one Animation. */ anims: Phaser.Animations.AnimationState | null; @@ -41748,7 +42086,7 @@ declare namespace Phaser { /** * The Event Emitter proxy. - * + * * Passes on all parameters to the `ParticleEmitter` to emit directly. * @param event The event name. * @param a1 Optional argument 1. @@ -41791,7 +42129,7 @@ declare namespace Phaser { /** * The main update method for this Particle. - * + * * Updates its life values, computes the velocity and repositions the Particle. * @param delta The delta time in ms. * @param step The delta value divided by 1000. @@ -41820,7 +42158,7 @@ declare namespace Phaser { /** * Gets the bounds of this particle as a Geometry Rectangle, factoring in any * transforms of the parent emitter and anything else above it in the display list. - * + * * Once calculated the bounds can be accessed via the `Particle.bounds` property. * @param matrix Optional transform matrix to apply to this particle. * @returns A Rectangle containing the transformed bounds of this particle. @@ -41838,21 +42176,21 @@ declare namespace Phaser { /** * The Particle Bounds Processor. - * + * * Defines a rectangular region, in world space, within which particle movement * is restrained. - * + * * Use the properties `collideLeft`, `collideRight`, `collideTop` and * `collideBottom` to control if a particle will rebound off the sides * of this boundary, or not. - * + * * This happens when the particles worldPosition x/y coordinate hits the boundary. - * + * * The strength of the rebound is determined by the `Particle.bounce` property. */ class ParticleBounds extends Phaser.GameObjects.Particles.ParticleProcessor { /** - * + * * @param x The x position (top-left) of the bounds, in world space. * @param y The y position (top-left) of the bounds, in world space. * @param width The width of the bounds. @@ -41904,157 +42242,157 @@ declare namespace Phaser { /** * A Particle Emitter is a special kind of Game Object that controls a pool of {@link Phaser.GameObjects.Particles.Particle Particles}. - * + * * Particle Emitters are created via a configuration object. The properties of this object * can be specified in a variety of formats, giving you plenty of scope over the values they * return, leading to complex visual effects. Here are the different forms of configuration * value you can give: - * + * * ## An explicit static value: - * + * * ```js * x: 400 * ``` - * + * * The x value will always be 400 when the particle is spawned. - * + * * ## A random value: - * + * * ```js * x: [ 100, 200, 300, 400 ] * ``` - * + * * The x value will be one of the 4 elements in the given array, picked at random on emission. - * + * * ## A custom callback: - * + * * ```js * x: (particle, key, t, value) => { * return value + 50; * } * ``` - * + * * The x value is the result of calling this function. This is only used when the * particle is emitted, so it provides its initial starting value. It is not used * when the particle is updated (see the onUpdate callback for that) - * + * * ## A start / end object: - * + * * This allows you to control the change in value between the given start and * end parameters over the course of the particles lifetime: - * + * * ```js * scale: { start: 0, end: 1 } * ``` - * + * * The particle scale will start at 0 when emitted and ease to a scale of 1 * over the course of its lifetime. You can also specify the ease function * used for this change (the default is Linear): - * + * * ```js * scale: { start: 0, end: 1, ease: 'bounce.out' } * ``` - * + * * ## A start / end random object: - * + * * The start and end object can have an optional `random` parameter. * This forces it to pick a random value between the two values and use * this as the starting value, then easing to the 'end' parameter over * its lifetime. - * + * * ```js * scale: { start: 4, end: 0.5, random: true } * ``` - * + * * The particle will start with a random scale between 0.5 and 4 and then * scale to the end value over its lifetime. You can combine the above * with the `ease` parameter as well to control the value easing. - * + * * ## An interpolation object: - * + * * You can provide an array of values which will be used for interpolation * during the particles lifetime. You can also define the interpolation * function to be used. There are three provided: `linear` (the default), * `bezier` and `catmull`, or you can provide your own function. - * + * * ```js * x: { values: [ 50, 500, 200, 800 ], interpolation: 'catmull' } * ``` - * + * * The particle scale will interpolate from 50 when emitted to 800 via the other * points over the course of its lifetime. You can also specify an ease function * used to control the rate of change through the values (the default is Linear): - * + * * ```js * x: { values: [ 50, 500, 200, 800 ], interpolation: 'catmull', ease: 'bounce.out } * ``` - * + * * ## A stepped emitter object: - * + * * The `steps` parameter allows you to control the placement of sequential * particles across the start-end range: - * + * * ```js * x: { steps: 32, start: 0, end: 576 } * ``` - * + * * Here we have a range of 576 (start to end). This is divided into 32 steps. - * + * * The first particle will emit at the x position of 0. The next will emit * at the next 'step' along, which would be 18. The following particle will emit * at the next step, which is 36, and so on. Because the range of 576 has been * divided by 32, creating 18 pixels steps. When a particle reaches the 'end' * value the next one will start from the beginning again. - * + * * ## A stepped emitter object with yoyo: - * + * * You can add the optional `yoyo` property to a stepped object: - * + * * ```js * x: { steps: 32, start: 0, end: 576, yoyo: true } * ``` - * + * * As with the stepped emitter, particles are emitted in sequence, from 'start' * to 'end' in step sized jumps. Normally, when a stepped emitter reaches the * end it snaps around to the start value again. However, if you provide the 'yoyo' * parameter then when it reaches the end it will reverse direction and start * emitting back down to 'start' again. Depending on the effect you require this * can often look better. - * + * * ## A min / max object: - * + * * This allows you to pick a random float value between the min and max properties: - * + * * ```js * x: { min: 100, max: 700 } * ``` - * + * * The x value will be a random float between min and max. - * + * * You can force it select an integer by setting the 'int' flag: - * + * * ```js * x: { min: 100, max: 700, int: true } * ``` - * + * * Or, you could use the 'random' array approach (see below) - * + * * ## A random object: - * + * * This allows you to pick a random integer value between the first and second array elements: - * + * * ```js * x: { random: [ 100, 700 ] } * ``` - * + * * The x value will be a random integer between 100 and 700 as it takes the first * element in the 'random' array as the 'min' value and the 2nd element as the 'max' value. - * + * * ## Custom onEmit and onUpdate callbacks: - * + * * If the above won't give you the effect you're after, you can provide your own * callbacks that will be used when the particle is both emitted and updated: - * + * * ```js * x: { * onEmit: (particle, key, t, value) => { @@ -42065,15 +42403,15 @@ declare namespace Phaser { * } * } * ``` - * + * * You can provide either one or both functions. The `onEmit` is called at the * start of the particles life and defines the value of the property on birth. - * + * * The `onUpdate` function is called every time the Particle Emitter updates * until the particle dies. Both must return a value. - * + * * The properties are: - * + * * particle - A reference to the Particle instance. * key - The string based key of the property, i.e. 'x' or 'lifespan'. * t - The current normalized lifetime of the particle, between 0 (birth) and 1 (death). @@ -42086,7 +42424,7 @@ declare namespace Phaser { * * Prior to v3.60 Phaser used a `ParticleEmitterManager`. This was removed in v3.60 * and now calling `this.add.particles` returns a `ParticleEmitter` instance instead. - * + * * In order to streamline memory and the display list we have removed the * `ParticleEmitterManager` entirely. When you call `this.add.particles` you're now * creating a `ParticleEmitter` instance, which is being added directly to the @@ -42094,11 +42432,11 @@ declare namespace Phaser { * scaled, rotated, positioned, added to a Container, etc. It now extends the * `GameObject` base class, meaning it's also an event emitter, which allowed us * to create some handy new events for particles. - * + * * So, to create an emitter, you now give it an xy coordinate, a texture and an * emitter configuration object (you can also set this later, but most commonly * you'd do it on creation). I.e.: - * + * * ```js * const emitter = this.add.particles(100, 300, 'flares', { * frame: 'red', @@ -42106,14 +42444,14 @@ declare namespace Phaser { * speed: 150 * }); * ``` - * + * * This will create a 'red flare' emitter at 100 x 300. - * + * * Please update your code to ensure it adheres to the new function signatures. */ class ParticleEmitter extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -42129,9 +42467,9 @@ declare namespace Phaser { /** * An internal object holding the configuration for the Emitter. - * + * * These are populated as part of the Emitter configuration parsing. - * + * * You typically do not access them directly, but instead use the * `ParticleEmitter.setConfig` or `ParticleEmitter.updateConfig` methods. */ @@ -42139,9 +42477,9 @@ declare namespace Phaser { /** * An internal object holding all of the EmitterOp instances. - * + * * These are populated as part of the Emitter configuration parsing. - * + * * You typically do not access them directly, but instead use the * provided getters and setters on this class, such as `ParticleEmitter.speedX` etc. */ @@ -42171,7 +42509,7 @@ declare namespace Phaser { /** * Whether moveToX and moveToY are set. Set automatically during configuration. - * + * * When true the particles move toward the moveToX and moveToY coordinates and arrive at the end of their life. * Emitter angle, speedX, and speedY are ignored. */ @@ -42201,7 +42539,7 @@ declare namespace Phaser { * Set to hard limit the amount of particle objects this emitter is allowed to create * in total. This is the number of `Particle` instances it can create, not the number * of 'alive' particles. - * + * * 0 means unlimited. */ maxParticles: number; @@ -42209,7 +42547,7 @@ declare namespace Phaser { /** * The maximum number of alive and rendering particles this emitter will update. * When this limit is reached, a particle needs to die before another can be emitted. - * + * * 0 means no limits. */ maxAliveParticles: number; @@ -42220,14 +42558,14 @@ declare namespace Phaser { * reached. It will then enter a 'stopped' state, firing the `STOP` * event. Note that entering a stopped state doesn't mean all the particles * have finished, just that it's not emitting any further ones. - * + * * To know when the final particle expires, listen for the COMPLETE event. - * + * * Use this if you wish to launch an exact number of particles and then stop * your emitter afterwards. - * + * * The counter is reset each time the `ParticleEmitter.start` method is called. - * + * * 0 means the emitter will not stop based on total emitted particles. */ stopAfter: number; @@ -42235,15 +42573,15 @@ declare namespace Phaser { /** * The number of milliseconds this emitter will emit particles for when in flow mode, * before it stops emission. A value of 0 (the default) means there is no duration. - * + * * When the duration expires the `STOP` event is emitted. Note that entering a * stopped state doesn't mean all the particles have finished, just that it's * not emitting any further ones. - * + * * To know when the final particle expires, listen for the COMPLETE event. - * + * * The counter is reset each time the `ParticleEmitter.start` method is called. - * + * * 0 means the emitter will not stop based on duration. */ duration: number; @@ -42259,18 +42597,18 @@ declare namespace Phaser { /** * Controls if the emitter is currently emitting a particle flow (when frequency >= 0). - * + * * Already alive particles will continue to update until they expire. - * + * * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#start} and {@link Phaser.GameObjects.Particles.ParticleEmitter#stop}. */ emitting: boolean; /** * Newly emitted particles are added to the top of the particle list, i.e. rendered above those already alive. - * + * * Set to false to send them to the back. - * + * * Also see the `sortOrder` property for more complex particle sorting. */ particleBringToTop: boolean; @@ -42282,9 +42620,9 @@ declare namespace Phaser { /** * An array containing Particle Emission Zones. These can be either EdgeZones or RandomZones. - * + * * Particles are emitted from a randomly selected zone from this array. - * + * * Prior to Phaser v3.60 an Emitter could only have one single Emission Zone. * In 3.60 they can now have an array of Emission Zones. */ @@ -42293,7 +42631,7 @@ declare namespace Phaser { /** * An array containing Particle Death Zone objects. A particle is immediately killed as soon as its x/y coordinates * intersect with any of the configured Death Zones. - * + * * Prior to Phaser v3.60 an Emitter could only have one single Death Zone. * In 3.60 they can now have an array of Death Zones. */ @@ -42303,14 +42641,14 @@ declare namespace Phaser { * An optional Rectangle object that is used during rendering to cull Particles from * display. For example, if your particles are limited to only move within a 300x300 * sized area from their origin, then you can set this Rectangle to those dimensions. - * + * * The renderer will check to see if the `viewBounds` Rectangle intersects with the * Camera bounds during the render step and if not it will skip rendering the Emitter * entirely. - * + * * This allows you to create many emitters in a Scene without the cost of * rendering if the contents aren't visible. - * + * * Note that the Emitter will not perform any checks to see if the Particles themselves * are outside of these bounds, or not. It will simply check the bounds against the * camera. Use the `getBounds` method with the `advance` parameter to help define @@ -42378,7 +42716,7 @@ declare namespace Phaser { * Optionally sort the particles before they render based on this * property. The property must exist on the `Particle` class, such * as `y`, `lifeT`, `scaleX`, etc. - * + * * When set this overrides the `particleBringToTop` setting. * * To reset this and disable sorting, set this property to an empty string. @@ -42453,7 +42791,7 @@ declare namespace Phaser { /** * Resets the internal counter trackers. - * + * * You shouldn't ever need to call this directly. * @param frequency The frequency counter. * @param on Set the complete flag. @@ -42484,7 +42822,7 @@ declare namespace Phaser { /** * Sets a pattern for assigning texture frames to emitted particles. The `frames` configuration can be any of: - * + * * frame: 0 * frame: 'red' * frame: [ 0, 1, 2, 3 ] @@ -42505,11 +42843,11 @@ declare namespace Phaser { /** * Sets a pattern for assigning animations to emitted particles. The `anims` configuration can be any of: - * + * * anim: 'red' * anim: [ 'red', 'green', 'blue', 'pink', 'white' ] * anim: { anims: [ 'red', 'green', 'blue', 'pink', 'white' ], [cycle: bool], [quantity: int] } - * + * * Call this method at least once before any particles are created, or set `anim` in the Particle Emitter's configuration when creating the Emitter. * @param anims One or more animations, or a configuration object. * @param pickRandom Whether animations should be assigned at random from `anims`. If a config object is given, this parameter is ignored. Default true. @@ -42527,23 +42865,23 @@ declare namespace Phaser { /** * Creates a Particle Bounds processor and adds it to this Emitter. - * + * * This processor will check to see if any of the active Particles hit * the defined boundary, as specified by a Rectangle shape in world-space. - * + * * If so, they are 'rebounded' back again by having their velocity adjusted. - * + * * The strength of the rebound is controlled by the `Particle.bounce` * property. - * + * * You should be careful to ensure that you emit particles within a bounds, * if set, otherwise it will lead to unpredictable visual results as the * particles are hastily repositioned. - * + * * The Particle Bounds processor is returned from this method. If you wish * to modify the area you can directly change its `bounds` property, along * with the `collideLeft` etc values. - * + * * To disable the bounds you can either set its `active` property to `false`, * or if you no longer require it, call `ParticleEmitter.removeParticleProcessor`. * @param x The x-coordinate of the left edge of the boundary, or an object representing a rectangle. @@ -42560,7 +42898,7 @@ declare namespace Phaser { /** * Sets the initial radial speed of emitted particles. - * + * * Changes the emitter to radial mode. * @param x The horizontal speed of the emitted Particles. * @param y The vertical speed of emitted Particles. If not set it will use the `x` value. Default x. @@ -42570,7 +42908,7 @@ declare namespace Phaser { /** * Sets the vertical and horizontal scale of the emitted particles. - * + * * You can also set the scale of the entire emitter via `setScale`. * @param x The horizontal scale of the emitted Particles. Default 1. * @param y The vertical scale of emitted Particles. If not set it will use the `x` value. Default x. @@ -42588,7 +42926,7 @@ declare namespace Phaser { /** * Sets the opacity (alpha) of emitted particles. - * + * * You can also set the alpha of the entire emitter via `setAlpha`. * @param value A value between 0 (transparent) and 1 (opaque). * @returns This Particle Emitter. @@ -42597,7 +42935,7 @@ declare namespace Phaser { /** * Sets the color tint of emitted particles. - * + * * This is a WebGL only feature. * @param value A value between 0 and 0xffffff. * @returns This Particle Emitter. @@ -42606,7 +42944,7 @@ declare namespace Phaser { /** * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. - * + * * The value is given in degrees using Phaser's right-handed coordinate system. * @param value The angle of the initial velocity of emitted particles, in degrees. * @returns This Particle Emitter. @@ -42638,15 +42976,15 @@ declare namespace Phaser { /** * Adds a new Particle Death Zone to this Emitter. - * + * * A particle is immediately killed as soon as its x/y coordinates intersect * with any of the configured Death Zones. - * + * * The `source` can be a Geometry Shape, such as a Circle, Rectangle or Triangle. * Any valid object from the `Phaser.Geometry` namespace is allowed, as long as * it supports a `contains` function. You can set the `type` to be either `onEnter` * or `onLeave`. - * + * * A single Death Zone instance can only exist once within this Emitter, but can belong * to multiple Emitters. * @param config A Death Zone configuration object, a Death Zone instance, a valid Geometry object or an array of them. @@ -42669,14 +43007,14 @@ declare namespace Phaser { /** * Adds a new Particle Emission Zone to this Emitter. - * + * * An {@link Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. * Its {@link Phaser.Types.GameObjects.Particles.EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; * or any object with a suitable {@link Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback getPoints} method. - * + * * A {@link Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig RandomZone} places the particles randomly within its interior. * Its {@link Phaser.GameObjects.Particles.Zones.RandomZone#source source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback getRandomPoint} method. - * + * * An Emission Zone can only exist once within this Emitter. * @param zone An Emission Zone configuration object, a RandomZone or EdgeZone instance, or an array of them. * @returns An array of the Emission Zones that were added to this Emitter. @@ -42700,7 +43038,7 @@ declare namespace Phaser { * Takes the given particle and sets its x/y coordinates to match the next available * emission zone, if any have been configured. This method is called automatically * as part of the `Particle.fire` process. - * + * * The Emit Zones are iterated in sequence. Once a zone has had a particle emitted * from it, then the next zone is used and so on, in a loop. * @param particle The particle to set the emission zone for. @@ -42720,10 +43058,10 @@ declare namespace Phaser { * Changes the currently active Emission Zone. The zones should have already * been added to this Emitter either via the emitter config, or the * `addEmitZone` method. - * + * * Call this method by passing either a numeric zone index value, or * the zone instance itself. - * + * * Prior to v3.60 an Emitter could only have a single Emit Zone and this * method was how you set it. From 3.60 and up it now performs a different * function and swaps between all available active zones. @@ -42734,7 +43072,7 @@ declare namespace Phaser { /** * Adds a Particle Processor, such as a Gravity Well, to this Emitter. - * + * * It will start processing particles from the next update as long as its `active` * property is set. * @param processor The Particle Processor to add to this Emitter Manager. @@ -42744,9 +43082,9 @@ declare namespace Phaser { /** * Removes a Particle Processor from this Emitter. - * + * * The Processor must belong to this Emitter to be removed. - * + * * It is not destroyed when removed, allowing you to move it to another Emitter Manager, * so if you no longer require it you should call its `destroy` method directly. * @param processor The Particle Processor to remove from this Emitter Manager. @@ -42769,7 +43107,7 @@ declare namespace Phaser { /** * Creates inactive particles and adds them to this emitter's pool. - * + * * If `ParticleEmitter.maxParticles` is set it will limit the * value passed to this method to make sure it's not exceeded. * @param count The number of particles to create. @@ -42847,10 +43185,10 @@ declare namespace Phaser { * Enables emitting, sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitting} to `true`, and resets the flow counter. * * If this emitter is in flow mode (frequency >= 0; the default), the particle flow will start (or restart). - * + * * If this emitter is in explode mode (frequency = -1), nothing will happen. * Use {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} or {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} instead. - * + * * Calling this method will emit the `START` event. * @param advance Advance this number of ms in time through the emitter. Default 0. * @param duration Limit this emitter to only emit particles for the given number of ms. Setting this parameter will override any duration already set in the Emitter configuration object. Default 0. @@ -42862,7 +43200,7 @@ declare namespace Phaser { * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#emitting off} the emitter and * stops it from emitting further particles. Currently alive particles will remain * active until they naturally expire unless you set the `kill` parameter to `true`. - * + * * Calling this method will emit the `STOP` event. When the final particle has * expired the `COMPLETE` event will be emitted. * @param kill Kill all particles immediately (true), or leave them to die after their lifespan expires? (false, the default) Default false. @@ -42884,15 +43222,15 @@ declare namespace Phaser { /** * Set the property by which active particles are sorted prior to be rendered. - * + * * It allows you to control the rendering order of the particles. - * + * * This can be any valid property of the `Particle` class, such as `y`, `alpha` * or `lifeT`. - * + * * The 'alive' particles array is sorted in place each game frame. Setting a * sort property will override the `particleBringToTop` setting. - * + * * If you wish to use your own sorting function, see `setSortCallback` instead. * @param property The property on the `Particle` class to sort by. * @param ascending Should the particles be sorted in ascending or descending order? Default true. @@ -42902,16 +43240,16 @@ declare namespace Phaser { /** * Sets a callback to be used to sort the particles before rendering each frame. - * + * * This allows you to define your own logic and behavior in the callback. - * + * * The callback will be sent two parameters: the two Particles being compared, * and must adhere to the criteria of the `compareFn` in `Array.sort`: - * + * * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description - * + * * Call this method with no parameters to reset the sort callback. - * + * * Setting your own callback will override both the `particleBringToTop` and * `sortProperty` settings of this Emitter. * @param callback The callback to invoke when the particles are sorted. Leave undefined to reset to the default. @@ -42935,7 +43273,7 @@ declare namespace Phaser { /** * Puts the emitter in flow mode (frequency >= 0) and starts (or restarts) a particle flow. - * + * * To resume a flow at the current frequency and quantity, use {@link Phaser.GameObjects.Particles.ParticleEmitter#start} instead. * @param frequency The time interval (>= 0) of each flow cycle, in ms. * @param count The number of particles to emit at each flow cycle. Default 1. @@ -42974,13 +43312,13 @@ declare namespace Phaser { /** * Fast forwards this Particle Emitter and all of its particles. - * + * * Works by running the Emitter `preUpdate` handler in a loop until the `time` * has been reached at `delta` steps per loop. - * + * * All callbacks and emitter related events that would normally be fired * will still be invoked. - * + * * You can make an emitter 'fast forward' via the emitter config using the * `advance` property. Set this value to the number of ms you wish the * emitter to be fast-forwarded by. Or, call this method post-creation. @@ -43000,7 +43338,7 @@ declare namespace Phaser { /** * Takes either a Rectangle Geometry object or an Arcade Physics Body and tests * to see if it intersects with any currently alive Particle in this Emitter. - * + * * Overlapping particles are returned in an array, where you can perform further * processing on them. If nothing overlaps then the array will be empty. * @param target A Rectangle or Arcade Physics Body to check for intersection against all alive particles. @@ -43014,13 +43352,13 @@ declare namespace Phaser { * created and not yet rendered, then calling this method will return a Rectangle * with a max safe integer for dimensions. Use the `advance` parameter to * avoid this. - * + * * Typically it takes a few seconds for a flow Emitter to 'warm up'. You can * use the `advance` and `delta` parameters to force the Emitter to * 'fast forward' in time to try and allow the bounds to be more accurate, * as it will calculate the bounds based on the particle bounds across all * timesteps, giving a better result. - * + * * You can also use the `padding` parameter to increase the size of the * bounds. Emitters with a lot of randomness in terms of direction or lifespan * can often return a bounds smaller than their possible maximum. By using @@ -43041,9 +43379,9 @@ declare namespace Phaser { /** * The x coordinate the particles are emitted from. - * + * * This is relative to the Emitters x coordinate and that of any parent. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43061,7 +43399,7 @@ declare namespace Phaser { /** * The horizontal acceleration applied to emitted particles, in pixels per second squared. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43069,7 +43407,7 @@ declare namespace Phaser { /** * The vertical acceleration applied to emitted particles, in pixels per second squared. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43093,12 +43431,12 @@ declare namespace Phaser { /** * The initial speed of emitted particles, in pixels per second. - * + * * If using this as a getter it will return the `speedX` value. - * + * * If using it as a setter it will update both `speedX` and `speedY` to the * given value. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43106,7 +43444,7 @@ declare namespace Phaser { /** * The initial horizontal speed of emitted particles, in pixels per second. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43114,7 +43452,7 @@ declare namespace Phaser { /** * The initial vertical speed of emitted particles, in pixels per second. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43122,7 +43460,7 @@ declare namespace Phaser { /** * The x coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43130,7 +43468,7 @@ declare namespace Phaser { /** * The y coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43140,7 +43478,7 @@ declare namespace Phaser { * The amount of velocity particles will use when rebounding off the * emitter bounds, if set. A value of 0 means no bounce. A value of 1 * means a full rebound. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43148,9 +43486,9 @@ declare namespace Phaser { /** * The horizontal scale of emitted particles. - * + * * This is relative to the Emitters scale and that of any parent. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43158,9 +43496,9 @@ declare namespace Phaser { /** * The vertical scale of emitted particles. - * + * * This is relative to the Emitters scale and that of any parent. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43180,9 +43518,9 @@ declare namespace Phaser { * it as an array of color values. The Particle will then interpolate * through these colors over the course of its lifespan. Setting this * will override any `tint` value that may also be given. - * + * * This is a WebGL only feature. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43192,7 +43530,7 @@ declare namespace Phaser { * Controls the easing function used when you have created an * Emitter that uses the `color` property to interpolate the * tint of Particles over their lifetime. - * + * * Setting this has no effect if you haven't also applied a * `particleColor` to this Emitter. */ @@ -43211,7 +43549,7 @@ declare namespace Phaser { * The `tint` value will be overridden if a `color` array is provided. * * This is a WebGL only feature. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43222,7 +43560,7 @@ declare namespace Phaser { * between 0 and 1. Particles with alpha zero are invisible * and are therefore not rendered, but are still processed * by the Emitter. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43232,7 +43570,7 @@ declare namespace Phaser { * The lifespan of the emitted particles. This value is given * in milliseconds and defaults to 1000ms (1 second). When a * particle reaches this amount it is killed. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43243,7 +43581,7 @@ declare namespace Phaser { * given in degrees. This allows you to control the direction * of the emitter. If you wish instead to change the rotation * of the particles themselves, see the `particleRotate` property. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43254,7 +43592,7 @@ declare namespace Phaser { * The value is given in degrees and uses a right-handed * coordinate system, where 0 degrees points to the right, 90 degrees * points down and -90 degrees points up. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43263,9 +43601,9 @@ declare namespace Phaser { /** * The number of particles that are emitted each time an emission * occurs, i.e. from one 'explosion' or each frame in a 'flow' cycle. - * + * * The default is 1. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43276,7 +43614,7 @@ declare namespace Phaser { * the particles start updating. This allows you to emit particles * that appear 'static' or still on-screen and then, after this value, * begin to move. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43287,10 +43625,10 @@ declare namespace Phaser { * its life before it will be removed. This allows you to 'hold' a * particle on the screen once it has reached its final state * before it then vanishes. - * + * * Note that all particle updates will cease, including changing * alpha, scale, movement or animation. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43298,21 +43636,21 @@ declare namespace Phaser { /** * The internal flow counter. - * + * * Treat this property as read-only. */ flowCounter: number; /** * The internal frame counter. - * + * * Treat this property as read-only. */ frameCounter: number; /** * The internal animation counter. - * + * * Treat this property as read-only. */ animCounter: number; @@ -43326,42 +43664,42 @@ declare namespace Phaser { /** * The internal stop counter. - * + * * Treat this property as read-only. */ stopCounter: number; /** * The internal complete flag. - * + * * Treat this property as read-only. */ completeFlag: boolean; /** * The internal zone index. - * + * * Treat this property as read-only. */ zoneIndex: number; /** * The internal zone total. - * + * * Treat this property as read-only. */ zoneTotal: number; /** * The current frame index. - * + * * Treat this property as read-only. */ currentFrame: number; /** * The current animation index. - * + * * Treat this property as read-only. */ currentAnim: number; @@ -43610,7 +43948,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -43619,21 +43957,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -43643,21 +43981,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -43669,13 +44007,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -43706,7 +44044,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -43716,11 +44054,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -43729,11 +44067,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -43799,10 +44137,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -43823,12 +44161,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -43907,12 +44245,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -43926,12 +44264,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -43949,10 +44287,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -43979,11 +44317,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -43995,14 +44333,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -44028,7 +44366,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -44042,7 +44380,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -44060,20 +44398,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -44098,9 +44436,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -44149,7 +44487,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -44182,9 +44520,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -44215,14 +44553,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -44236,12 +44574,12 @@ declare namespace Phaser { * * You should extend it and add the functionality required for your processor, * including tidying up any resources this may create in the `destroy` method. - * + * * See the GravityWell for an example of a processor. */ class ParticleProcessor { /** - * + * * @param x The x coordinate of the Particle Processor, in world space. Default 0. * @param y The y coordinate of the Particle Processor, in world space. Default 0. * @param active The active state of this Particle Processor. Default true. @@ -44267,7 +44605,7 @@ declare namespace Phaser { /** * The active state of the Particle Processor. - * + * * An inactive Particle Processor will be skipped for processing by * its parent Emitter. */ @@ -44286,7 +44624,7 @@ declare namespace Phaser { /** * Destroys this Particle Processor by removing all external references. - * + * * This is called automatically when the owning Particle Emitter is destroyed. */ destroy(): void; @@ -44356,15 +44694,15 @@ declare namespace Phaser { namespace Zones { /** * A Death Zone. - * + * * A Death Zone is a special type of zone that will kill a Particle as soon as it either enters, or leaves, the zone. - * + * * The zone consists of a `source` which could be a Geometric shape, such as a Rectangle or Ellipse, or your own * object as long as it includes a `contains` method for which the Particles can be tested against. */ class DeathZone { /** - * + * * @param source An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. * @param killOnEnter Should the Particle be killed when it enters the zone? `true` or leaves it? `false` */ @@ -44409,7 +44747,7 @@ declare namespace Phaser { */ class EdgeZone { /** - * + * * @param source An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. * @param quantity The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * @param stepRate The distance between each particle. When set, `quantity` is implied and should be set to 0. @@ -44457,12 +44795,12 @@ declare namespace Phaser { /** * The total number of particles this zone will emit before the Emitter * transfers control over to the next zone in its emission zone list. - * + * * By default this is -1, meaning it will never pass over from this * zone to another one. You can call the `ParticleEmitter.setEmitZone` * method to change it, or set this value to something else via the * config, or directly at runtime. - * + * * A value of 1 would mean the zones rotate in order, but it can * be set to any integer value. */ @@ -44514,7 +44852,7 @@ declare namespace Phaser { */ class RandomZone { /** - * + * * @param source An object instance with a `getRandomPoint(point)` method. */ constructor(source: Phaser.Types.GameObjects.Particles.RandomZoneSource); @@ -44527,12 +44865,12 @@ declare namespace Phaser { /** * The total number of particles this zone will emit before the Emitter * transfers control over to the next zone in its emission zone list. - * + * * By default this is -1, meaning it will never pass over from this * zone to another one. You can call the `ParticleEmitter.setEmitZone` * method to change it, or set this value to something else via the * config, or directly at runtime. - * + * * A value of 1 would mean the zones rotate in order, but it can * be set to any integer value. */ @@ -44566,7 +44904,7 @@ declare namespace Phaser { */ class PathFollower extends Phaser.GameObjects.Sprite implements Phaser.GameObjects.Components.PathFollower { /** - * + * * @param scene The Scene to which this PathFollower belongs. * @param path The Path this PathFollower is following. It can only follow one Path at a time. * @param x The horizontal position of this Game Object in the world. @@ -44604,7 +44942,7 @@ declare namespace Phaser { /** * Internal update handler that advances this PathFollower along the path. - * + * * Called automatically by the Scene step, should not typically be called directly. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. @@ -44843,7 +45181,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -44889,21 +45227,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -44913,21 +45251,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -44939,13 +45277,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -44976,7 +45314,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -44986,11 +45324,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -44999,11 +45337,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -45090,7 +45428,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45101,7 +45439,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45112,7 +45450,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45123,7 +45461,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45134,7 +45472,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45145,7 +45483,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45156,7 +45494,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45167,7 +45505,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45178,7 +45516,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45260,10 +45598,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -45284,12 +45622,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -45335,7 +45673,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -45437,12 +45775,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -45456,12 +45794,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -45479,10 +45817,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -45499,7 +45837,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -45508,7 +45846,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -45517,30 +45855,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -45550,12 +45888,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -45596,26 +45934,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -45628,7 +45966,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -45638,14 +45976,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -45714,11 +46052,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -45786,7 +46124,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -45800,7 +46138,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -45818,20 +46156,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -45856,9 +46194,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -45907,7 +46245,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -45940,9 +46278,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -45973,14 +46311,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -46006,7 +46344,7 @@ declare namespace Phaser { /** * Set the Path that this PathFollower should follow. - * + * * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. * @param path The Path this PathFollower is following. It can only follow one Path at a time. * @param config Settings for the PathFollower. @@ -46063,7 +46401,7 @@ declare namespace Phaser { /** * Internal update handler that advances this PathFollower along the path. - * + * * Called automatically by the Scene step, should not typically be called directly. */ pathUpdate(): void; @@ -46073,31 +46411,31 @@ declare namespace Phaser { /** * The Point Light Game Object provides a way to add a point light effect into your game, * without the expensive shader processing requirements of the traditional Light Game Object. - * + * * The difference is that the Point Light renders using a custom shader, designed to give the * impression of a point light source, of variable radius, intensity and color, in your game. * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their * normal maps for calculations. This makes them extremely fast to render compared to Lights * and perfect for special effects, such as flickering torches or muzzle flashes. - * + * * For maximum performance you should batch Point Light Game Objects together. This means * ensuring they follow each other consecutively on the display list. Ideally, use a Layer * Game Object and then add just Point Lights to it, so that it can batch together the rendering * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in * your game then it's perfectly safe to mix them into the display list as normal. However, if * you're using a large number of them, please consider how they are mixed into the display list. - * + * * The renderer will automatically cull Point Lights. Those with a radius that does not intersect * with the Camera will be skipped in the rendering list. This happens automatically and the * culled state is refreshed every frame, for every camera. - * + * * The origin of a Point Light is always 0.5 and it cannot be changed. - * + * * Point Lights are a WebGL only feature and do not have a Canvas counterpart. */ class PointLight extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Point Light belongs. A Point Light can only belong to one Scene at a time. * @param x The horizontal position of this Point Light in the world. * @param y The vertical position of this Point Light in the world. @@ -46117,16 +46455,16 @@ declare namespace Phaser { /** * The intensity of the Point Light. - * + * * The colors of the light are multiplied by this value during rendering. */ intensity: number; /** * The attenuation of the Point Light. - * + * * This value controls the force with which the light falls-off from the center of the light. - * + * * Use small float-based values, i.e. 0.1. */ attenuation: number; @@ -46396,7 +46734,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -46405,21 +46743,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -46429,21 +46767,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -46455,13 +46793,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -46492,7 +46830,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -46502,11 +46840,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -46515,11 +46853,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -46528,7 +46866,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46539,7 +46877,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46550,7 +46888,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46561,7 +46899,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46572,7 +46910,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46583,7 +46921,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46594,7 +46932,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46605,7 +46943,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46616,7 +46954,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46652,10 +46990,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -46676,12 +47014,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -46760,12 +47098,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -46779,12 +47117,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -46802,10 +47140,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -46837,7 +47175,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -46851,7 +47189,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -46869,20 +47207,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -46907,9 +47245,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -46958,7 +47296,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -46991,9 +47329,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -47024,14 +47362,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -47043,34 +47381,34 @@ declare namespace Phaser { /** * A Render Texture is a combination of Dynamic Texture and an Image Game Object, that uses the * Dynamic Texture to display itself with. - * + * * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of * Game Objects directly to it. - * + * * You can take many complex objects and draw them to this one texture, which can then be used as the * base texture for other Game Objects, such as Sprites. Should you then update this texture, all * Game Objects using it will instantly be updated as well, reflecting the changes immediately. - * + * * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke * expensive GPU uploads on each change. - * + * * In versions of Phaser before 3.60 a Render Texture was the only way you could create a texture * like this, that had the ability to be drawn on. But in 3.60 we split the core functions out to * the Dynamic Texture class as it made a lot more sense for them to reside in there. As a result, * the Render Texture is now a light-weight shim that sits on-top of an Image Game Object and offers * proxy methods to the features available from a Dynamic Texture. - * + * * **When should you use a Render Texture vs. a Dynamic Texture?** - * + * * You should use a Dynamic Texture if the texture is going to be used by multiple Game Objects, * or you want to use it across multiple Scenes, because textures are globally stored. - * + * * You should use a Dynamic Texture if the texture isn't going to be displayed in-game, but is * instead going to be used for something like a mask or shader. - * + * * You should use a Render Texture if you need to display the texture in-game on a single Game Object, * as it provides the convenience of wrapping an Image and Dynamic Texture together for you. - * + * * Under WebGL1, a FrameBuffer, which is what this Dynamic Texture uses internally, cannot be anti-aliased. * This means that when drawing objects such as Shapes or Graphics instances to this texture, they may appear * to be drawn with no aliasing around the edges. This is a technical limitation of WebGL1. To get around it, @@ -47090,7 +47428,7 @@ declare namespace Phaser { */ class RenderTexture extends Phaser.GameObjects.Image { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -47102,12 +47440,12 @@ declare namespace Phaser { /** * An internal Camera that can be used to move around this Render Texture. - * + * * Control it just like you would any Scene Camera. The difference is that it only impacts * the placement of Game Objects that you then draw to this texture. - * + * * You can scroll, zoom and rotate this Camera. - * + * * This property is a reference to `RenderTexture.texture.camera`. */ camera: Phaser.Cameras.Scene2D.BaseCamera; @@ -47133,13 +47471,13 @@ declare namespace Phaser { /** * Sets the internal size of this Render Texture, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. You could also call the `resize` method, as that * will resize the underlying texture. - * + * * If you have enabled this Game Object for input, changing the size will also change the * size of the hit area, unless you have defined a custom hit area. * @param width The width of this Game Object. @@ -47150,12 +47488,12 @@ declare namespace Phaser { /** * Resizes the Render Texture to the new dimensions given. - * + * * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. * In Canvas it will resize the underlying canvas element. - * + * * Both approaches will erase everything currently drawn to the Render Texture. - * + * * Calling this will then invoke the `setSize` method, setting the internal size of this Game Object * to the values given to this method. * @@ -47172,28 +47510,28 @@ declare namespace Phaser { /** * Stores a copy of this Render Texture in the Texture Manager using the given key. - * + * * After doing this, any texture based Game Object, such as a Sprite, can use the contents of this * Render Texture by using the texture key: - * + * * ```javascript * var rt = this.add.renderTexture(0, 0, 128, 128); - * + * * // Draw something to the Render Texture - * + * * rt.saveTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Updating the contents of this Render Texture will automatically update _any_ Game Object * that is using it as a texture. Calling `saveTexture` again will not save another copy * of the same texture, it will just rename the key of the existing copy. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame from a Render Texture. - * + * * If you destroy this Render Texture, any Game Object using it via the Texture Manager will * stop rendering. Ensure you remove the texture from the Texture Manager and any Game Objects * using it first, before destroying this Render Texture. @@ -47230,10 +47568,10 @@ declare namespace Phaser { /** * Fills this Render Texture with the given color. - * + * * By default it will fill the entire texture, however you can set it to fill a specific * rectangular area by using the x, y, width and height arguments. - * + * * The color should be given in hex format, i.e. 0xff0000 for red, 0x00ff00 for green, etc. * @param rgb The color to fill this Render Texture with, such as 0xff0000 for red. * @param alpha The alpha value used by the fill. Default 1. @@ -47261,9 +47599,9 @@ declare namespace Phaser { * x and y coordinates. You can use the optional 'config' argument to provide * lots more options about how the stamp is applied, including the alpha, * tint, angle, scale and origin. - * + * * By default, the frame will stamp on the x/y coordinates based on its center. - * + * * If you wish to stamp from the top-left, set the config `originX` and * `originY` properties both to zero. * @@ -47294,7 +47632,7 @@ declare namespace Phaser { * Draws the given object, or an array of objects, to this RenderTexture. * * It can accept any of the following: - * + * * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. * * Tilemap Layers. * * A Group. The contents of which will be iterated and drawn in turn. @@ -47303,7 +47641,7 @@ declare namespace Phaser { * * Another Dynamic Texture, or a Render Texture. * * A Texture Frame instance. * * A string. This is used to look-up the texture from the Texture Manager. - * + * * Note 1: You cannot draw a Render Texture to itself. * * Note 2: GameObjects will use the camera, while textures and frames will not. @@ -47312,14 +47650,14 @@ declare namespace Phaser { * If passing in a Group or Container it will only draw children that return `true` * when their `willRender()` method is called. I.e. a Container with 10 children, * 5 of which have `visible=false` will only draw the 5 visible ones. - * + * * If passing in an array of Game Objects it will draw them all, regardless if * they pass a `willRender` check or not. - * + * * You can pass in a string in which case it will look for a texture in the Texture * Manager matching that string, and draw the base frame. If you need to specify * exactly which frame to draw then use the method `drawFrame` instead. - * + * * You can pass in the `x` and `y` coordinates to draw the objects at. The use of * the coordinates differ based on what objects are being drawn. If the object is * a Group, Container or Display List, the coordinates are _added_ to the positions @@ -47353,11 +47691,11 @@ declare namespace Phaser { * It uses a `TileSprite` internally to draw the frame repeatedly. * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * You can optionally provide a position, width, height, alpha and tint value to apply to * the frames before they are drawn. The position controls the top-left where the repeating * fill will start from. The width and height control the size of the filled area. - * + * * The position can be negative if required, but the dimensions cannot. * * This method respects the camera settings of the Dynamic Texture. @@ -47398,16 +47736,16 @@ declare namespace Phaser { /** * Takes a snapshot of the given area of this Render Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Render Texture see the `snapshot` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Render Texture has, so please be careful how you employ this in your game. * @param x The x coordinate to grab from. @@ -47423,16 +47761,16 @@ declare namespace Phaser { /** * Takes a snapshot of the whole of this Render Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture a portion of this Render Texture see the `snapshotArea` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Render Texture has, so please be careful how you employ this in your game. * @param callback The Function to invoke after the snapshot image is created. @@ -47444,12 +47782,12 @@ declare namespace Phaser { /** * Takes a snapshot of the given pixel from this Render Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Render Texture see the `snapshot` method. * To capture a portion of this Render Texture see the `snapshotArea` method. - * + * * Unlike the two other snapshot methods, this one will send your callback a `Color` object * containing the color data for the requested pixel. It doesn't need to create an internal * Canvas or Image object, so is a lot faster to execute, using less memory than the other snapshot methods. @@ -47697,7 +48035,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -47743,21 +48081,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -47767,21 +48105,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -47793,13 +48131,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -47830,7 +48168,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -47840,11 +48178,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -47853,11 +48191,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -47944,7 +48282,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -47955,7 +48293,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -47966,7 +48304,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -47977,7 +48315,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -47988,7 +48326,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -47999,7 +48337,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48010,7 +48348,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48021,7 +48359,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48032,7 +48370,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48114,10 +48452,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -48138,12 +48476,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -48189,7 +48527,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -48291,12 +48629,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -48310,12 +48648,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -48333,10 +48671,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -48353,7 +48691,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -48362,7 +48700,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -48371,30 +48709,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -48434,26 +48772,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -48466,7 +48804,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -48476,14 +48814,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -48552,11 +48890,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -48624,7 +48962,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -48638,7 +48976,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -48656,20 +48994,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -48694,9 +49032,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -48745,7 +49083,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -48778,9 +49116,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -48811,14 +49149,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -48829,7 +49167,7 @@ declare namespace Phaser { /** * A Rope Game Object. - * + * * The Rope object is WebGL only and does not have a Canvas counterpart. * * A Rope is a special kind of Game Object that has a texture that is stretched along its entire length, @@ -48852,7 +49190,7 @@ declare namespace Phaser { */ class Rope extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -48876,35 +49214,35 @@ declare namespace Phaser { * Each point should be given as a Vector2Like object (i.e. a Vector2 or object with public x/y properties). * * The point coordinates are given in local space, where 0 x 0 is the start of the Rope strip. - * + * * You can modify the contents of this array directly in real-time to create interesting effects. * If you do so, be sure to call `setDirty` _after_ modifying this array, so that the vertices data is * updated before the next render. Alternatively, you can use the `setPoints` method instead. - * + * * Should you need to change the _size_ of this array, then you should always use the `setPoints` method. */ points: Phaser.Types.Math.Vector2Like[]; /** * An array containing the vertices data for this Rope. - * + * * This data is calculated automatically in the `updateVertices` method, based on the points provided. */ vertices: Float32Array; /** * An array containing the uv data for this Rope. - * + * * This data is calculated automatically in the `setPoints` method, based on the points provided. */ uv: Float32Array; /** * An array containing the color data for this Rope. - * + * * Colors should be given as numeric RGB values, such as 0xff0000. * You should provide _two_ color values for every point in the Rope, one for the top and one for the bottom of each quad. - * + * * You can modify the contents of this array directly in real-time, however, should you need to change the _size_ * of the array, then you should use the `setColors` method instead. */ @@ -48912,10 +49250,10 @@ declare namespace Phaser { /** * An array containing the alpha data for this Rope. - * + * * Alphas should be given as float values, such as 0.5. * You should provide _two_ alpha values for every point in the Rope, one for the top and one for the bottom of each quad. - * + * * You can modify the contents of this array directly in real-time, however, should you need to change the _size_ * of the array, then you should use the `setAlphas` method instead. */ @@ -48942,7 +49280,7 @@ declare namespace Phaser { /** * Are the Rope vertices aligned horizontally, in a strip, or vertically, in a column? - * + * * This property is set during instantiation and cannot be changed directly. * See the `setVertical` and `setHorizontal` methods. */ @@ -48950,19 +49288,19 @@ declare namespace Phaser { /** * You can optionally choose to render the vertices of this Rope to a Graphics instance. - * + * * Achieve this by setting the `debugCallback` and the `debugGraphic` properties. - * + * * You can do this in a single call via the `Rope.setDebug` method, which will use the * built-in debug function. You can also set it to your own callback. The callback * will be invoked _once per render_ and sent the following parameters: - * + * * `debugCallback(src, meshLength, verts)` - * + * * `src` is the Rope instance being debugged. * `meshLength` is the number of mesh vertices in total. * `verts` is an array of the translated vertex coordinates. - * + * * To disable rendering, set this property back to `null`. */ debugCallback: Function; @@ -49011,7 +49349,7 @@ declare namespace Phaser { /** * Sets the alignment of the points in this Rope to be horizontal, in a strip format. - * + * * Calling this method will reset this Rope. The current points, vertices, colors and alpha * values will be reset to those values given as parameters. * @param points An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. @@ -49023,7 +49361,7 @@ declare namespace Phaser { /** * Sets the alignment of the points in this Rope to be vertical, in a column format. - * + * * Calling this method will reset this Rope. The current points, vertices, colors and alpha * values will be reset to those values given as parameters. * @param points An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. @@ -49052,20 +49390,20 @@ declare namespace Phaser { /** * Set the alpha values used by the Rope during rendering. - * + * * You can provide the values in a number of ways: - * + * * 1) One single numeric value: `setAlphas(0.5)` - This will set a single alpha for the whole Rope. * 2) Two numeric values: `setAlphas(1, 0.5)` - This will set a 'top' and 'bottom' alpha value across the whole Rope. * 3) An array of values: `setAlphas([ 1, 0.5, 0.2 ])` - * + * * If you provide an array of values and the array has exactly the same number of values as `points` in the Rope, it * will use each alpha value per rope segment. - * + * * If the provided array has a different number of values than `points` then it will use the values in order, from * the first Rope segment and on, until it runs out of values. This allows you to control the alpha values at all * vertices in the Rope. - * + * * Note this method is called `setAlphas` (plural) and not `setAlpha`. * @param alphas Either a single alpha value, or an array of values. If nothing is provided alpha is reset to 1. * @param bottomAlpha An optional bottom alpha value. See the method description for details. @@ -49075,17 +49413,17 @@ declare namespace Phaser { /** * Set the color values used by the Rope during rendering. - * + * * Colors are used to control the level of tint applied across the Rope texture. - * + * * You can provide the values in a number of ways: - * + * * * One single numeric value: `setColors(0xff0000)` - This will set a single color tint for the whole Rope. * * An array of values: `setColors([ 0xff0000, 0x00ff00, 0x0000ff ])` - * + * * If you provide an array of values and the array has exactly the same number of values as `points` in the Rope, it * will use each color per rope segment. - * + * * If the provided array has a different number of values than `points` then it will use the values in order, from * the first Rope segment and on, until it runs out of values. This allows you to control the color values at all * vertices in the Rope. @@ -49096,16 +49434,16 @@ declare namespace Phaser { /** * Sets the points used by this Rope. - * + * * The points should be provided as an array of Vector2, or vector2-like objects (i.e. those with public x/y properties). - * + * * Each point corresponds to one segment of the Rope. The more points in the array, the more segments the rope has. - * + * * Point coordinates are given in local-space, not world-space, and are directly related to the size of the texture * this Rope object is using. - * + * * For example, a Rope using a 512 px wide texture, split into 4 segments (128px each) would use the following points: - * + * * ```javascript * rope.setPoints([ * { x: 0, y: 0 }, @@ -49114,15 +49452,15 @@ declare namespace Phaser { * { x: 384, y: 0 } * ]); * ``` - * + * * Or, you can provide an integer to do the same thing: - * + * * ```javascript * rope.setPoints(4); * ``` - * + * * Which will divide the Rope into 4 equally sized segments based on the frame width. - * + * * Note that calling this method with a different number of points than the Rope has currently will * _reset_ the color and alpha values, unless you provide them as arguments to this method. * @param points An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. Default 2. @@ -49148,7 +49486,7 @@ declare namespace Phaser { /** * Updates the vertices based on the Rope points. - * + * * This method is called automatically during rendering if `Rope.dirty` is `true`, which is set * by the `setPoints` and `setDirty` methods. You should flag the Rope as being dirty if you modify * the Rope points directly.undefined @@ -49158,25 +49496,25 @@ declare namespace Phaser { /** * This method enables rendering of the Rope vertices to the given Graphics instance. - * + * * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, * otherwise the Graphics instance you provide to debug will fill-up with draw calls, * eventually crashing the browser. This is not done automatically to allow you to debug * draw multiple Rope objects to a single Graphics instance. - * + * * The Rope class has a built-in debug rendering callback `Rope.renderDebugVerts`, however * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. - * + * * The callback is invoked _once per render_ and sent the following parameters: - * + * * `callback(src, meshLength, verts)` - * + * * `src` is the Rope instance being debugged. * `meshLength` is the number of mesh vertices in total. * `verts` is an array of the translated vertex coordinates. - * + * * If using your own callback you do not have to provide a Graphics instance to this method. - * + * * To disable debug rendering, to either your own callback or the built-in one, call this method * with no arguments. * @param graphic The Graphic instance to render to if using the built-in callback. @@ -49187,7 +49525,7 @@ declare namespace Phaser { /** * The built-in Rope vertices debug rendering method. - * + * * See `Rope.setDebug` for more details. * @param src The Rope object being rendered. * @param meshLength The number of vertices in the mesh. @@ -49197,7 +49535,7 @@ declare namespace Phaser { /** * The horizontally flipped state of the Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. @@ -49206,7 +49544,7 @@ declare namespace Phaser { /** * The vertically flipped state of the Game Object. - * + * * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. @@ -49452,7 +49790,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -49461,21 +49799,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -49485,21 +49823,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -49511,13 +49849,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -49548,7 +49886,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -49558,11 +49896,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -49571,11 +49909,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -49655,10 +49993,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -49679,12 +50017,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -49763,7 +50101,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -49772,7 +50110,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -49781,30 +50119,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -49814,12 +50152,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -49853,11 +50191,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -49869,14 +50207,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -49902,7 +50240,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -49916,7 +50254,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -49934,20 +50272,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -49972,9 +50310,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -50023,7 +50361,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -50056,9 +50394,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -50089,14 +50427,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -50105,12 +50443,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -50124,12 +50462,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -50147,10 +50485,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -50242,16 +50580,16 @@ declare namespace Phaser { /** * A flag that indicates if this Shader has been set to render to a texture instead of the display list. - * + * * This property is `true` if you have called `Shader.setRenderToTexture`, otherwise it's `false`. - * + * * A Shader that is rendering to a texture _does not_ appear on the display list. */ readonly renderToTexture: boolean; /** * A reference to the Phaser.Textures.Texture that has been stored in the Texture Manager for this Shader. - * + * * This property is only set if you have called `Shader.setRenderToTexture` with a key, otherwise it is `null`. */ texture: Phaser.Textures.Texture; @@ -50334,15 +50672,15 @@ declare namespace Phaser { * store it in `Shader.texture`, * and save it into the Texture Manager, allowing you to then use it for * any texture-based Game Object, such as a Sprite or Image: - * + * * ```javascript * var shader = this.add.shader('myShader', x, y, width, height); - * + * * shader.setRenderToTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Note that it stores an active reference to this Shader. That means as this shader updates, * so does the texture and any object using it to render with. Also, if you destroy this * shader, be sure to clear any objects that may have been using it as a texture too. @@ -50720,7 +51058,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -50729,7 +51067,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -50738,30 +51076,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -50784,13 +51122,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -50821,7 +51159,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -50831,11 +51169,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -50844,11 +51182,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -50857,7 +51195,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50868,7 +51206,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50879,7 +51217,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50890,7 +51228,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50901,7 +51239,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50912,7 +51250,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50923,7 +51261,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50934,7 +51272,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -50945,7 +51283,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51004,7 +51342,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -51039,12 +51377,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -51058,12 +51396,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -51081,10 +51419,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -51116,7 +51454,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -51130,7 +51468,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -51148,20 +51486,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -51186,9 +51524,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -51237,7 +51575,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -51270,9 +51608,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -51303,14 +51641,1008 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + */ + class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.PostPipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param type The internal type of the Shape. + * @param data The data of the source shape geometry, if any. + */ + constructor(scene: Phaser.Scene, type?: string, data?: any); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + */ + readonly geom: any; + + /** + * Holds the polygon path data for filled rendering. + */ + readonly pathData: number[]; + + /** + * Holds the earcut polygon path index data for filled rendering. + */ + readonly pathIndexes: number[]; + + /** + * The fill color used by this Shape. + */ + fillColor: number; + + /** + * The fill alpha value used by this Shape. + */ + fillAlpha: number; + + /** + * The stroke color used by this Shape. + */ + strokeColor: number; + + /** + * The stroke alpha value used by this Shape. + */ + strokeAlpha: number; + + /** + * The stroke line width used by this Shape. + */ + lineWidth: number; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + */ + isFilled: boolean; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + */ + isStroked: boolean; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + */ + closePath: boolean; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * @param color The color used to fill this shape. If not provided the Shape will not be filled. + * @param alpha The alpha value used when filling this shape, if a fill color is given. Default 1. + */ + setFillStyle(color?: number, alpha?: number): this; + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * @param lineWidth The width of line to stroke with. If not provided or undefined the Shape will not be stroked. + * @param color The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param alpha The alpha value used when stroking this shape, if a stroke color is given. Default 1. + */ + setStrokeStyle(lineWidth?: number, color?: number, alpha?: number): this; + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * @param value Set to `true` if the Shape should be closed when stroked, otherwise `false`. + */ + setClosePath(value: boolean): this; + + /** + * Sets the display size of this Shape. + * + * Calling this will adjust the scale. + * @param width The display width of this Shape. + * @param height The display height of this Shape. + */ + setDisplaySize(width: number, height: number): this; + + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * The radius of the rectangle if this is set to use rounded corners. + * + * Do not modify this property. Instead, call the method `setRounded` to set the + * radius of the rounded corners. + */ + readonly radius: number; + + /** + * Does this Rectangle have rounded corners? + * + * Do not modify this property. Instead, call the method `setRounded` to set the + * radius state of this rectangle. + */ + readonly isRounded: boolean; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * @param value The alpha value applied across the whole Game Object. Default 1. + */ + setAlpha(value?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string | number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * NORMAL + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string, a CONST or a number. + */ + setBlendMode(value: string | Phaser.BlendModes | number): this; + + /** + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. + */ + setDepth(value: number): this; + + /** + * Sets this Game Object to be at the top of the display list, or the top of its parent container. + * + * Being at the top means it will render on-top of everything else. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + */ + setToTop(): this; + + /** + * Sets this Game Object to the back of the display list, or the back of its parent container. + * + * Being at the back means it will render below everything else. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + */ + setToBack(): this; + + /** + * Move this Game Object so that it appears above the given Game Object. + * + * This means it will render immediately after the other object in the display list. + * + * Both objects must belong to the same display list, or parent container. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * @param gameObject The Game Object that this Game Object will be moved to be above. + */ + setAbove(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Move this Game Object so that it appears below the given Game Object. + * + * This means it will render immediately under the other object in the display list. + * + * Both objects must belong to the same display list, or parent container. + * + * This method does not change this Game Objects `depth` value, it simply alters its list position. + * @param gameObject The Game Object that this Game Object will be moved to be below. + */ + setBelow(gameObject: Phaser.GameObjects.GameObject): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * + * The returned point is calculated in local space and does not factor in any parent Containers, + * unless the `includeParent` argument is set to `true`. + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one, or a Dynamic Texture. + * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable texture-based Game Object. + * @param maskObject The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. + * @param x If creating a Game Object, the horizontal position in the world. + * @param y If creating a Game Object, the vertical position in the world. + * @param texture If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. + * @param frame If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. + */ + createBitmapMask(maskObject?: Phaser.GameObjects.GameObject | Phaser.Textures.DynamicTexture, x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number | Phaser.Textures.Frame): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics | Phaser.GameObjects.Shape): Phaser.Display.Masks.GeometryMask; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + * Set this value with `setOrigin()`. + */ + readonly originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + * Set this value with `setOrigin()`. + */ + readonly originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is set in to the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPipeline(resetData?: boolean): boolean; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string | null; + + /** + * Does this Game Object have any Post Pipelines set? + */ + hasPostPipeline: boolean; + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + */ + postPipelines: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + postPipelineData: object; + + /** + * The Pre FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.preFX.addBloom(); + * ``` + * + * Only the following Game Objects support Pre FX: + * + * * Image + * * Sprite + * * TileSprite + * * Text + * * RenderTexture + * * Video + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + */ + preFX: Phaser.GameObjects.Components.FX | null; + + /** + * The Post FX component of this Game Object. + * + * This component allows you to apply a variety of built-in effects to this Game Object, such + * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, + * for example: + * + * ```js + * const player = this.add.sprite(); + * player.postFX.addBloom(); + * ``` + * + * All FX are WebGL only and do not have Canvas counterparts. + * + * Please see the FX Class for more details and available methods. + * + * This property is always `null` until the `initPostPipeline` method is called. + */ + postFX: Phaser.GameObjects.Components.FX; + + /** + * This should only be called during the instantiation of the Game Object. + * + * It is called by default by all core Game Objects and doesn't need + * calling again. + * + * After that, use `setPostPipeline`. + * @param preFX Does this Game Object support Pre FX? Default false. + */ + initPostPipeline(preFX?: boolean): void; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also set the `postPipelineData` property, if the parameter is given. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is set in to the `postPipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `postPipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `postPipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPostPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `postPipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; + + /** + * Removes all Pre and Post FX Controllers from this Game Object. + * + * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. + * + * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. + */ + clearFX(): this; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * A property indicating that a Game Object has this component. + */ + readonly hasTransformComponent: boolean; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: number; + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + + /** + * 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. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. Default 1. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x?: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Gets the world position of this Game Object, factoring in any parent Containers. + * @param point A Vector2, or point-like object, to store the result in. + * @param tempMatrix A temporary matrix to hold the Game Object's values. + * @param parentMatrix A temporary matrix to hold parent values. + */ + getWorldPoint(point?: Phaser.Math.Vector2, tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Math.Vector2; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -61723,20 +63055,20 @@ declare namespace Phaser { * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. */ class Star extends Phaser.GameObjects.Shape { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -62026,7 +63358,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -62035,21 +63367,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -62059,21 +63391,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -62085,13 +63417,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -62122,7 +63454,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -62132,11 +63464,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -62145,11 +63477,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -62158,7 +63490,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62169,7 +63501,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62180,7 +63512,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62191,7 +63523,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62202,7 +63534,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62213,7 +63545,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62224,7 +63556,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62235,7 +63567,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62246,7 +63578,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -62282,10 +63614,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -62306,12 +63638,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -62357,7 +63689,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -62459,12 +63791,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -62478,12 +63810,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -62501,10 +63833,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -62536,7 +63868,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -62550,7 +63882,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -62568,20 +63900,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -62606,9 +63938,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -62657,7 +63989,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -62690,9 +64022,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -62723,14 +64055,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -62744,16 +64076,16 @@ declare namespace Phaser { * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. */ class Triangle extends Phaser.GameObjects.Shape { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -63019,7 +64351,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -63028,21 +64360,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -63052,21 +64384,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -63078,13 +64410,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -63115,7 +64447,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -63125,11 +64457,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -63138,11 +64470,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -63151,7 +64483,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63162,7 +64494,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63173,7 +64505,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63184,7 +64516,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63195,7 +64527,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63206,7 +64538,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63217,7 +64549,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63228,7 +64560,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63239,7 +64571,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63275,10 +64607,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -63299,12 +64631,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -63350,7 +64682,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -63452,12 +64784,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -63471,12 +64803,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -63494,10 +64826,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -63529,7 +64861,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -63543,7 +64875,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -63561,20 +64893,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -63599,9 +64931,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -63650,7 +64982,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -63683,9 +65015,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -63716,14 +65048,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -63734,18 +65066,18 @@ declare namespace Phaser { /** * A Sprite Game Object. - * + * * A Sprite Game Object is used for the display of both static and animated images in your game. * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled * and animated. - * + * * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. */ class Sprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -63756,7 +65088,7 @@ declare namespace Phaser { /** * The Animation State component of this Sprite. - * + * * This component provides features to apply animations to this Sprite. * It is responsible for playing, loading, queuing animations for later playback, * mixing between animations and setting the current animation frame to this Sprite. @@ -63788,15 +65120,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -63804,37 +65136,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).play('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. @@ -63844,15 +65176,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite, in reverse. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -63860,37 +65192,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).playReverse('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. @@ -63900,18 +65232,18 @@ declare namespace Phaser { /** * Waits for the specified delay, in milliseconds, then starts playback of the given animation. - * + * * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. - * + * * If an animation is already running and a new animation is given to this method, it will wait for * the given delay before starting the new animation. - * + * * If no animation is currently running, the given one begins after the delay. - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * Prior to Phaser 3.50 this method was called 'delayedPlay'. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param delay The delay, in milliseconds, to wait before starting the animation playing. @@ -63922,12 +65254,12 @@ declare namespace Phaser { /** * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback * of the given animation. - * + * * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an * idle animation to a walking animation, by making them blend smoothly into each other. - * + * * If no animation is currently running, the given one will start immediately. - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. @@ -63939,20 +65271,20 @@ declare namespace Phaser { /** * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. - * + * * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, * or have the `stop` method called directly on it. - * + * * An animation set to repeat forever will never enter a completed state. - * + * * You can chain a new animation at any point, including before the current one starts playing, during it, * or when it ends (via its `animationcomplete` event). - * + * * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained * animations without impacting the animation they're playing. - * + * * Call this method with no arguments to reset all currently chained animations. - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. @@ -63963,7 +65295,7 @@ declare namespace Phaser { /** * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. - * + * * If no animation is playing, no event will be dispatched. * * If there is another animation queued (via the `chain` method) then it will start playing immediately.undefined @@ -63973,11 +65305,11 @@ declare namespace Phaser { /** * Stops the current animation from playing after the specified time delay, given in milliseconds. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param delay The number of milliseconds to wait before stopping this animation. @@ -63987,11 +65319,11 @@ declare namespace Phaser { /** * Stops the current animation from playing after the given number of repeats. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param repeatCount How many times should the animation repeat before stopping? Default 1. @@ -64002,11 +65334,11 @@ declare namespace Phaser { /** * Stops the current animation from playing when it next sets the given frame. * If this frame doesn't exist within the animation it will not stop it from playing. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param frame The frame to check before stopping this animation. @@ -64252,7 +65584,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -64298,21 +65630,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -64322,21 +65654,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -64348,13 +65680,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -64385,7 +65717,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -64395,11 +65727,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -64408,11 +65740,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -64499,7 +65831,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64510,7 +65842,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64521,7 +65853,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64532,7 +65864,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64543,7 +65875,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64554,7 +65886,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64565,7 +65897,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64576,7 +65908,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64587,7 +65919,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64669,10 +66001,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -64693,12 +66025,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -64744,7 +66076,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -64846,12 +66178,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -64865,12 +66197,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -64888,10 +66220,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -64908,7 +66240,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -64917,7 +66249,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -64926,30 +66258,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -64959,12 +66291,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -65005,26 +66337,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -65037,7 +66369,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -65047,14 +66379,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -65123,11 +66455,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -65195,7 +66527,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -65209,7 +66541,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -65227,20 +66559,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -65265,9 +66597,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -65316,7 +66648,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -65349,9 +66681,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -65382,14 +66714,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -68073,34 +69405,34 @@ declare namespace Phaser { /** * A Text Game Object. - * + * * Text objects work by creating their own internal hidden Canvas and then renders text to it using * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered * to your game during the render pass. - * + * * Because it uses the Canvas API you can take advantage of all the features this offers, such as * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts * loaded externally, such as Google or TypeKit Web fonts. - * + * * **Important:** The font name must be quoted if it contains certain combinations of digits or * special characters, either when creating the Text object, or when setting the font via `setFont` * or `setFontFamily`, e.g.: - * + * * ```javascript * this.add.text(0, 0, 'Hello World', { fontFamily: 'Georgia, "Goudy Bookletter 1911", Times, serif' }); * ``` - * + * * ```javascript * this.add.text(0, 0, 'Hello World', { font: '"Press Start 2P"' }); * ``` - * + * * You can only display fonts that are currently loaded and available to the browser: therefore fonts must * be pre-loaded. Phaser does not do this for you, so you will require the use of a 3rd party font loader, * or have the fonts readily available in the CSS on the page in which your Phaser game resides. * * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts * across mobile browsers. - * + * * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of @@ -68109,7 +69441,7 @@ declare namespace Phaser { */ class Text extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Crop, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -68135,7 +69467,7 @@ declare namespace Phaser { /** * The Text Style object. - * + * * Manages the style of this Text object. */ style: Phaser.GameObjects.TextStyle; @@ -68172,7 +69504,7 @@ declare namespace Phaser { * The line spacing value. * This value is added to the font height to calculate the overall line height. * Only has an effect if this Text object contains multiple lines of text. - * + * * If you update this property directly, instead of using the `setLineSpacing` method, then * be sure to call `updateText` after, or you won't see the change reflected in the Text object. */ @@ -68181,7 +69513,7 @@ declare namespace Phaser { /** * Adds / Removes spacing between characters. * Can be a negative or positive number. - * + * * If you update this property directly, instead of using the `setLetterSpacing` method, then * be sure to call `updateText` after, or you won't see the change reflected in the Text object. */ @@ -68234,7 +69566,7 @@ declare namespace Phaser { /** * Set the text to display. - * + * * An array of strings will be joined with `\n` line breaks. * @param value The string, or array of strings, to be set as the content of this Text object. * @returns This Text object. @@ -68243,7 +69575,7 @@ declare namespace Phaser { /** * Appends the given text to the content already being displayed by this Text object. - * + * * An array of strings will be joined with `\n` line breaks. * @param value The string, or array of strings, to be appended to the existing content of this Text object. * @param addCR Insert a carriage-return before the string value. Default true. @@ -68260,22 +69592,22 @@ declare namespace Phaser { /** * Set the font. - * + * * If a string is given, the font family is set. - * + * * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` * properties of that object are set. - * + * * **Important:** The font name must be quoted if it contains certain combinations of digits or * special characters: - * + * * ```javascript * Text.setFont('"Press Start 2P"'); * ``` - * + * * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all * quoted properly, too: - * + * * ```javascript * Text.setFont('Georgia, "Goudy Bookletter 1911", Times, serif'); * ``` @@ -68286,17 +69618,17 @@ declare namespace Phaser { /** * Set the font family. - * + * * **Important:** The font name must be quoted if it contains certain combinations of digits or * special characters: - * + * * ```javascript * Text.setFontFamily('"Press Start 2P"'); * ``` - * + * * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all * quoted properly, too: - * + * * ```javascript * Text.setFontFamily('Georgia, "Goudy Bookletter 1911", Times, serif'); * ``` @@ -68321,7 +69653,7 @@ declare namespace Phaser { /** * Set a fixed width and height for the text. - * + * * Pass in `0` for either of these parameters to disable fixed width or height respectively. * @param width The fixed width to set. `0` disables fixed width. * @param height The fixed height to set. `0` disables fixed height. @@ -68338,10 +69670,10 @@ declare namespace Phaser { /** * Set the fill style to be used by the Text object. - * + * * This can be any valid CanvasRenderingContext2D fillStyle value, such as * a color (in hex, rgb, rgba, hsl or named values), a gradient or a pattern. - * + * * See the [MDN fillStyle docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle) for more details. * @param color The text fill style. Can be any valid CanvasRenderingContext `fillStyle` value. * @returns This Text object. @@ -68434,9 +69766,9 @@ declare namespace Phaser { /** * Set the alignment of the text in this Text object. - * + * * The argument can be one of: `left`, `right`, `center` or `justify`. - * + * * Alignment only works if the Text object has more than one line of text. * @param align The text alignment for multi-line text. Default 'left'. * @returns This Text object. @@ -68457,7 +69789,7 @@ declare namespace Phaser { /** * Sets the line spacing value. - * + * * This value is _added_ to the height of the font when calculating the overall line height. * This only has an effect if this Text object consists of multiple lines of text. * @param value The amount to add to the font height to achieve the overall line height. @@ -68467,11 +69799,11 @@ declare namespace Phaser { /** * Sets the letter spacing value. - * + * * This will add, or remove spacing between each character of this Text Game Object. The value can be * either positive or negative. Positive values increase the space between each character, whilst negative * values decrease it. Note that some fonts are spaced naturally closer together than others. - * + * * Please understand that enabling this feature will cause Phaser to render each character in this Text object * one by one, rather than use a draw for the whole string. This makes it extremely expensive when used with * either long strings, or lots of strings in total. You will be better off creating bitmap font text if you @@ -68775,7 +70107,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -68821,21 +70153,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -68845,21 +70177,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -68871,30 +70203,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -68934,26 +70266,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates cannot exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -68966,13 +70298,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -69003,7 +70335,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -69013,11 +70345,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -69026,11 +70358,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -69117,7 +70449,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69128,7 +70460,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69139,7 +70471,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69150,7 +70482,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69161,7 +70493,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69172,7 +70504,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69183,7 +70515,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69194,7 +70526,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69205,7 +70537,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -69241,10 +70573,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -69265,12 +70597,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -69316,7 +70648,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -69418,12 +70750,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -69437,12 +70769,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -69460,10 +70792,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -69538,11 +70870,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -69610,7 +70942,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -69624,7 +70956,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -69642,20 +70974,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -69680,9 +71012,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -69731,7 +71063,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -69764,9 +71096,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -69797,14 +71129,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -69815,14 +71147,14 @@ declare namespace Phaser { /** * A TextStyle class manages all of the style settings for a Text object. - * + * * Text Game Objects create a TextStyle instance automatically, which is * accessed via the `Text.style` property. You do not normally need to * instantiate one yourself. */ class TextStyle { /** - * + * * @param text The Text object that this TextStyle is styling. * @param style The style settings to set. */ @@ -69917,7 +71249,7 @@ declare namespace Phaser { /** * The fixed height of the text. - * + * * `0` means no fixed height. */ fixedHeight: number; @@ -70019,9 +71351,9 @@ declare namespace Phaser { /** * Set the font. - * + * * If a string is given, the font family is set. - * + * * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` * properties of that object are set. * @param font The font family or font settings to set. @@ -70060,7 +71392,7 @@ declare namespace Phaser { /** * Set a fixed width and height for the text. - * + * * Pass in `0` for either of these parameters to disable fixed width or height respectively. * @param width The fixed width to set. * @param height The fixed height to set. @@ -70091,10 +71423,10 @@ declare namespace Phaser { /** * Set the resolution used by the Text object. - * + * * It allows for much clearer text on High DPI devices, at the cost of memory because * it uses larger internal Canvas textures for the Text. - * + * * Please use with caution, as the more high res Text you have, the more memory it uses up. * @param value The resolution for this Text object to use. * @returns The parent Text object. @@ -70162,7 +71494,7 @@ declare namespace Phaser { /** * Set the width (in pixels) to use for wrapping lines. - * + * * Pass in null to remove wrapping by width. * @param width The maximum width of a line in pixels. Set to null to remove wrapping. * @param useAdvancedWrap Whether or not to use the advanced wrapping @@ -70174,7 +71506,7 @@ declare namespace Phaser { /** * Set a custom callback for wrapping lines. - * + * * Pass in null to remove wrapping by callback. * @param callback A custom function that will be responsible for wrapping the * text. It will receive two arguments: text (the string to wrap), textObject (this Text @@ -70187,9 +71519,9 @@ declare namespace Phaser { /** * Set the alignment of the text in this Text object. - * + * * The argument can be one of: `left`, `right`, `center` or `justify`. - * + * * Alignment only works if the Text object has more than one line of text. * @param align The text alignment for multi-line text. Default 'left'. * @returns The parent Text object. @@ -70224,10 +71556,10 @@ declare namespace Phaser { /** * A TileSprite is a Sprite that has a repeating texture. - * + * * The texture can be scrolled and scaled independently of the TileSprite itself. Textures will automatically wrap and * are designed so that you can create game backdrops using seamless textures as a source. - * + * * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will @@ -70243,7 +71575,7 @@ declare namespace Phaser { */ class TileSprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -70329,9 +71661,9 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * The Frame has to belong to the current Texture being used. - * + * * It can be either a string or an index. * @param frame The name or index of the frame within the Texture. * @returns This Game Object instance. @@ -70648,7 +71980,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -70694,21 +72026,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -70718,21 +72050,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -70744,7 +72076,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -70753,7 +72085,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -70762,18 +72094,18 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; @@ -70792,13 +72124,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -70829,7 +72161,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -70839,11 +72171,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -70852,11 +72184,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -70943,7 +72275,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70954,7 +72286,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70965,7 +72297,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70976,7 +72308,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70987,7 +72319,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70998,7 +72330,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -71009,7 +72341,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -71020,7 +72352,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -71031,7 +72363,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -71113,10 +72445,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -71137,12 +72469,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -71188,7 +72520,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -71290,12 +72622,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -71309,12 +72641,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -71332,10 +72664,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -71436,11 +72768,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -71508,7 +72840,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -71522,7 +72854,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -71540,20 +72872,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -71578,9 +72910,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -71629,7 +72961,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -71662,9 +72994,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -71695,14 +73027,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -71713,33 +73045,33 @@ declare namespace Phaser { /** * A Video Game Object. - * + * * This Game Object is capable of handling playback of a video file, video stream or media stream. - * + * * You can optionally 'preload' the video into the Phaser Video Cache: - * + * * ```javascript * preload () { * this.load.video('ripley', 'assets/aliens.mp4'); * } - * + * * create () { * this.add.video(400, 300, 'ripley'); * } * ``` - * + * * You don't have to 'preload' the video. You can also play it directly from a URL: - * + * * ```javascript * create () { * this.add.video(400, 300).loadURL('assets/aliens.mp4'); * } * ``` - * + * * To all intents and purposes, a video is a standard Game Object, just like a Sprite. And as such, you can do * all the usual things to it, such as scaling, rotating, cropping, tinting, making interactive, giving a * physics body, etc. - * + * * Transparent videos are also possible via the WebM file format. Providing the video file has was encoded with * an alpha channel, and providing the browser supports WebM playback (not all of them do), then it will render * in-game with full transparency. @@ -71751,45 +73083,45 @@ declare namespace Phaser { * * Playback is handled entirely via the Request Video Frame API, which is supported by most modern browsers. * A polyfill is provided for older browsers. - * + * * ### Autoplaying Videos - * + * * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. * The policies that control autoplaying are vast and vary between browser. You can, and should, read more about * it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', true); * } * ``` - * + * * The 3rd parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for further details. - * + * * Or: - * + * * ```javascript * create () { * this.add.video(400, 300).loadURL('assets/aliens.mp4', true); * } * ``` - * + * * You can set the `noAudio` parameter to `true` even if the video does contain audio. It will still allow the video * to play immediately, but the audio will not start. * * More details about video playback and the supported media formats can be found on MDN: - * + * * https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement * https://developer.mozilla.org/en-US/docs/Web/Media/Formats */ class Video extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -71799,30 +73131,30 @@ declare namespace Phaser { /** * A reference to the HTML Video Element this Video Game Object is playing. - * + * * Will be `undefined` until a video is loaded for playback. */ video: HTMLVideoElement | null; /** * The Phaser Texture this Game Object is using to render the video to. - * + * * Will be `undefined` until a video is loaded for playback. */ videoTexture: Phaser.Textures.Texture | null; /** * A reference to the TextureSource backing the `videoTexture` Texture object. - * + * * Will be `undefined` until a video is loaded for playback. */ videoTextureSource: Phaser.Textures.TextureSource | null; /** * A Phaser `CanvasTexture` instance that holds the most recent snapshot taken from the video. - * + * * This will only be set if the `snapshot` or `snapshotArea` methods have been called. - * + * * Until those methods are called, this property will be `undefined`. */ snapshotTexture: Phaser.Textures.CanvasTexture | null; @@ -71854,19 +73186,19 @@ declare namespace Phaser { /** * This read-only property returns `true` if the video is currently stalled, i.e. it has stopped * playing due to a lack of data, or too much data, but hasn't yet reached the end of the video. - * + * * This is set if the Video DOM element emits any of the following events: - * + * * `stalled` * `suspend` * `waiting` - * + * * And is cleared if the Video DOM element emits the `playing` event, or handles * a requestVideoFrame call. - * + * * Listen for the Phaser Event `VIDEO_STALLED` to be notified and inspect the event * to see which DOM event caused it. - * + * * Note that being stalled isn't always a negative thing. A video can be stalled if it * has downloaded enough data in to its buffer to not need to download any more until * the current batch of frames have rendered. @@ -71883,15 +73215,15 @@ declare namespace Phaser { * If the browser supports the Request Video Frame API then this * property will hold the metadata that is returned from * the callback each time it is invoked. - * + * * See https://wicg.github.io/video-rvfc/#video-frame-metadata-callback * for a complete list of all properties that will be in this object. * Likely of most interest is the `mediaTime` property: - * + * * The media presentation timestamp (PTS) in seconds of the frame presented * (e.g. its timestamp on the video.currentTime timeline). MAY have a zero * value for live-streams or WebRTC applications. - * + * * If the browser doesn't support the API then this property will be undefined. */ metadata: VideoFrameCallbackMetadata; @@ -71915,14 +73247,14 @@ declare namespace Phaser { /** * The key of the current video as stored in the Video cache. - * + * * If the video did not come from the cache this will be an empty string. */ readonly cacheKey: string; /** * Is the video currently seeking? - * + * * This is set to `true` when the `seeking` event is fired, * and set to `false` when the `seeked` event is fired. */ @@ -71944,10 +73276,10 @@ declare namespace Phaser { /** * Loads a Video from the Video Cache, ready for playback with the `Video.play` method. - * + * * If a video is already playing, this method allows you to change the source of the current video element. * It works by first stopping the current video and then starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. @@ -71960,7 +73292,7 @@ declare namespace Phaser { * This method allows you to change the source of the current video element. It works by first stopping the * current video, if playing. Then deleting the video texture, if one has been created. Finally, it makes a * new video texture and starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. @@ -71983,10 +73315,10 @@ declare namespace Phaser { /** * Loads a Video from the given URL, ready for playback with the `Video.play` method. - * + * * If a video is already playing, this method allows you to change the source of the current video element. * It works by first stopping the current video and then starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. @@ -72009,10 +73341,10 @@ declare namespace Phaser { /** * Internal method that loads a Video from the given URL, ready for playback with the * `Video.play` method. - * + * * Normally you don't call this method directly, but instead use the `Video.loadURL` method, * or the `Video.load` method if you have preloaded the video. - * + * * Calling this method will skip checking if the browser supports the given format in * the URL, where-as the other two methods enforce these checks. * @param url The absolute or relative URL to load the video file from. Set to `null` if passing in a MediaStream object. @@ -72025,12 +73357,12 @@ declare namespace Phaser { /** * This method handles the Request Video Frame callback. - * + * * It is called by the browser when a new video frame is ready to be displayed. - * + * * It's also responsible for the creation of the video texture, if it doesn't * already exist. If it does, it updates the texture as required. - * + * * For more details about the Request Video Frame callback, see: * https://web.dev/requestvideoframecallback-rvfc * @param now The current time in milliseconds. @@ -72040,26 +73372,26 @@ declare namespace Phaser { /** * Starts this video playing. - * + * * If the video is already playing, or has been queued to play with `changeSource` then this method just returns. - * + * * Videos can only autoplay if the browser has been unlocked. This happens if you have interacted with the browser, i.e. * by clicking on it or pressing a key, or due to server settings. The policies that control autoplaying are vast and * vary between browser. You can read more here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is loaded, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', true); * } * ``` - * + * * The 3rd parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for details. - * + * * If you need audio in your videos, then you'll have to consider the fact that the video cannot start playing until the * user has interacted with the browser, into your game flow. * @param loop Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. Default false. @@ -72101,10 +73433,10 @@ declare namespace Phaser { /** * Creates the video.play promise and adds the success and error handlers to it. - * + * * Not all browsers support the video.play promise, so this method will fall back to * the old-school way of handling the video.play call. - * + * * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play#browser_compatibility for details. * @param catchError Should the error be caught and the video marked as failed to play? Default true. */ @@ -72112,14 +73444,14 @@ declare namespace Phaser { /** * Adds a sequence marker to this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds. - * + * * You can then play back specific markers via the `playMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * @param key A unique name to give this marker. * @param markerIn The time, in seconds, representing the start of this marker. @@ -72130,13 +73462,13 @@ declare namespace Phaser { /** * Plays a pre-defined sequence in this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds and * specified via the `addMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * @param key The name of the marker sequence to play. * @param loop Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. Default false. @@ -72146,7 +73478,7 @@ declare namespace Phaser { /** * Removes a previously set marker from this video. - * + * * If the marker is currently playing it will _not_ stop playback. * @param key The name of the marker to remove. * @returns This Video Game Object for method chaining. @@ -72156,7 +73488,7 @@ declare namespace Phaser { /** * Takes a snapshot of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a width and height. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * @param width The width of the resulting CanvasTexture. @@ -72168,7 +73500,7 @@ declare namespace Phaser { /** * Takes a snapshot of the specified area of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a different `destWidth` and `destHeight`. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * @param x The horizontal location of the top-left of the area to grab from. Default 0. @@ -72183,27 +73515,27 @@ declare namespace Phaser { /** * Stores a copy of this Videos `snapshotTexture` in the Texture Manager using the given key. - * + * * This texture is created when the `snapshot` or `snapshotArea` methods are called. - * + * * After doing this, any texture based Game Object, such as a Sprite, can use the contents of the * snapshot by using the texture key: - * + * * ```javascript * var vid = this.add.video(0, 0, 'intro'); - * + * * vid.snapshot(); - * + * * vid.saveSnapshotTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Updating the contents of the `snapshotTexture`, for example by calling `snapshot` again, * will automatically update _any_ Game Object that is using it as a texture. * Calling `saveSnapshotTexture` again will not save another copy of the same texture, * it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. @@ -72225,7 +73557,7 @@ declare namespace Phaser { /** * Called when the video emits a `playing` event. - * + * * This is the legacy handler for browsers that don't support Promise based playback. */ legacyPlayHandler(): void; @@ -72249,12 +73581,12 @@ declare namespace Phaser { /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -72270,7 +73602,7 @@ declare namespace Phaser { /** * Called when the video completes playback, i.e. reaches an `ended` state. - * + * * This will never happen if the video is coming from a live stream, where the duration is `Infinity`. */ completeHandler(): void; @@ -72278,14 +73610,14 @@ declare namespace Phaser { /** * Seeks to a given point in the video. The value is given as a float between 0 and 1, * where 0 represents the start of the video and 1 represents the end. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * If you wish to seek based on time instead, use the `Video.setCurrentTime` method. - * + * * Unfortunately, the DOM video element does not guarantee frame-accurate seeking. * This has been an ongoing subject of discussion: https://github.com/w3c/media-and-entertainment/issues/4 * @param value The point in the video to seek to. A value between 0 and 1. @@ -72295,7 +73627,7 @@ declare namespace Phaser { /** * A double-precision floating-point value indicating the current playback time in seconds. - * + * * If the media has not started to play and has not been seeked, this value is the media's initial playback time. * * For a more accurate value, use the `Video.metadata.mediaTime` property instead.undefined @@ -72305,15 +73637,15 @@ declare namespace Phaser { /** * Seeks to a given playback time in the video. The value is given in _seconds_ or as a string. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * You can provide a string prefixed with either a `+` or a `-`, such as `+2.5` or `-2.5`. * In this case it will seek to +/- the value given, relative to the _current time_. - * + * * If you wish to seek based on a duration percentage instead, use the `Video.seekTo` method. * @param value The playback time to seek to in seconds. Can be expressed as a string, such as `+2` to seek 2 seconds ahead from the current time. * @returns This Video Game Object for method chaining. @@ -72322,9 +73654,9 @@ declare namespace Phaser { /** * Returns the current progress of the video as a float. - * + * * Progress is defined as a value between 0 (the start) and 1 (the end). - * + * * Progress can only be returned if the video has a duration. Some videos, * such as those coming from a live stream, do not have a duration. In this * case the method will return -1.undefined @@ -72335,7 +73667,7 @@ declare namespace Phaser { /** * A double-precision floating-point value which indicates the duration (total length) of the media in seconds, * on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN. - * + * * If the media has no known end (such as for live streams of unknown duration, web radio, media incoming from WebRTC, * and so forth), this value is +Infinity. * @@ -72359,14 +73691,14 @@ declare namespace Phaser { /** * Sets the paused state of the currently loaded video. - * + * * If the video is playing, calling this method with `true` will pause playback. * If the video is paused, calling this method with `false` will resume playback. - * + * * If no video is loaded, this method does nothing. - * + * * If the video has not yet been played, `Video.play` will be called with no parameters. - * + * * If the video has ended, this method will do nothing. * @param value The paused value. `true` if the video should be paused, `false` to resume it. Default true. * @returns This Video Game Object for method chaining. @@ -72375,7 +73707,7 @@ declare namespace Phaser { /** * Pauses the current Video, if one is playing. - * + * * If no video is loaded, this method does nothing. * * Call `Video.resume` to resume playback.undefined @@ -72385,7 +73717,7 @@ declare namespace Phaser { /** * Resumes the current Video, if one was previously playing and has been paused. - * + * * If no video is loaded, this method does nothing. * * Call `Video.pause` to pause playback.undefined @@ -72401,7 +73733,7 @@ declare namespace Phaser { /** * Sets the volume of the currently playing video. - * + * * The value given is a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). * @param value A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). Default 1. * @returns This Video Game Object for method chaining. @@ -72416,7 +73748,7 @@ declare namespace Phaser { /** * Sets the playback rate of the current video. - * + * * The value given is a double that indicates the rate at which the media is being played back. * @param rate A double that indicates the rate at which the media is being played back. * @returns This Video Game Object for method chaining. @@ -72431,11 +73763,11 @@ declare namespace Phaser { /** * Sets the loop state of the current video. - * + * * The value given is a boolean which indicates whether the media element will start over when it reaches the end. - * + * * Not all videos can loop, for example live streams. - * + * * Please note that not all browsers support _seamless_ video looping for all encoding formats. * @param value A boolean which indicates whether the media element will start over when it reaches the end. Default true. * @returns This Video Game Object for method chaining. @@ -72457,39 +73789,39 @@ declare namespace Phaser { /** * Stores this Video in the Texture Manager using the given key as a dynamic texture, * which any texture-based Game Object, such as a Sprite, can use as its source: - * + * * ```javascript * const vid = this.add.video(0, 0, 'intro'); - * + * * vid.play(); - * + * * vid.saveTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * If the video is not yet playing then you need to listen for the `TEXTURE_READY` event before * you can use this texture on a Game Object: - * + * * ```javascript * const vid = this.add.video(0, 0, 'intro'); - * + * * vid.play(); - * + * * vid.once('textureready', (video, texture, key) => { - * + * * this.add.image(400, 300, key); - * + * * }); - * + * * vid.saveTexture('doodle'); * ``` - * + * * The saved texture is automatically updated as the video plays. If you pause this video, * or change its source, then the saved texture updates instantly. - * + * * Calling `saveTexture` again will not save another copy of the same texture, it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. @@ -72504,9 +73836,9 @@ declare namespace Phaser { /** * Stops the video playing and clears all internal event listeners. - * + * * If you only wish to pause playback of the video, and resume it a later time, use the `Video.pause` method instead. - * + * * If the video hasn't finished downloading, calling this method will not abort the download. To do that you need to * call `destroy` instead. * @param emitStopEvent Should the `VIDEO_STOP` event be emitted? Default true. @@ -72516,13 +73848,13 @@ declare namespace Phaser { /** * Removes the Video element from the DOM by calling parentNode.removeChild on itself. - * + * * Also removes the autoplay and src attributes and nulls the `Video.video` reference. - * + * * If you loaded an external video via `Video.loadURL` then you should call this function * to clear up once you are done with the instance, but don't want to destroy this * Video Game Object. - * + * * This method is called automatically by `Video.destroy`. */ removeVideoElement(): void; @@ -72759,7 +74091,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -72805,21 +74137,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -72829,21 +74161,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -72855,7 +74187,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -72864,7 +74196,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -72873,30 +74205,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -72919,13 +74251,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -72956,7 +74288,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -72966,11 +74298,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -72979,11 +74311,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -73070,7 +74402,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73081,7 +74413,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73092,7 +74424,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73103,7 +74435,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73114,7 +74446,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73125,7 +74457,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73136,7 +74468,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73147,7 +74479,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73158,7 +74490,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -73240,10 +74572,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -73264,12 +74596,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -73315,7 +74647,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -73417,12 +74749,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -73436,12 +74768,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -73459,10 +74791,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -73496,26 +74828,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -73528,7 +74860,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -73538,14 +74870,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -73614,11 +74946,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -73686,7 +75018,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -73700,7 +75032,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -73718,20 +75050,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -73756,9 +75088,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -73807,7 +75139,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -73840,9 +75172,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -73873,14 +75205,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -73902,7 +75234,7 @@ declare namespace Phaser { */ class Zone extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -74210,13 +75542,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -74247,7 +75579,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -74257,11 +75589,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -74270,11 +75602,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -74283,7 +75615,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74294,7 +75626,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74305,7 +75637,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74316,7 +75648,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74327,7 +75659,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74338,7 +75670,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74349,7 +75681,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74360,7 +75692,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74371,7 +75703,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74430,7 +75762,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -74480,7 +75812,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -74494,7 +75826,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -74512,20 +75844,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -74550,9 +75882,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -74601,7 +75933,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -74634,9 +75966,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -74667,12 +75999,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -74686,12 +76018,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -74709,10 +76041,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -74729,14 +76061,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -74762,7 +76094,7 @@ declare namespace Phaser { */ class Circle { /** - * + * * @param x The x position of the center of the circle. Default 0. * @param y The y position of the center of the circle. Default 0. * @param radius The radius of the circle. Default 0. @@ -75065,7 +76397,7 @@ declare namespace Phaser { */ class Ellipse { /** - * + * * @param x The x position of the center of the ellipse. Default 0. * @param y The y position of the center of the ellipse. Default 0. * @param width The width of the ellipse. Default 0. @@ -75408,9 +76740,9 @@ declare namespace Phaser { * the last point is connected back to the first point. * * If no intersection is found, this function returns `null`. - * + * * If intersection was found, a Vector3 is returned with the following properties: - * + * * The `x` and `y` components contain the point of the intersection. * The `z` component contains the closest distance. * @param line The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. @@ -75423,11 +76755,11 @@ declare namespace Phaser { /** * Checks for the closest point of intersection between a line segment and an array of polygons. - * + * * If no intersection is found, this function returns `null`. - * + * * If intersection was found, a Vector4 is returned with the following properties: - * + * * The `x` and `y` components contain the point of the intersection. * The `z` component contains the closest distance. * The `w` component contains the index of the polygon, in the given array, that triggered the intersection. @@ -75453,11 +76785,11 @@ declare namespace Phaser { * Projects rays out from the given point to each vertex of the polygons. * * If the rays intersect with the polygons, the points of intersection are returned in an array. - * + * * If no intersections are found, the returned array will be empty. - * + * * Each Vector4 intersection result has the following properties: - * + * * The `x` and `y` components contain the point of the intersection. * The `z` component contains the angle of the projected ray, in radians. * The `w` component contains the index of the polygon, in the given array, that triggered the intersection. @@ -75483,7 +76815,7 @@ declare namespace Phaser { /** * Checks if two Rectangles intersect and returns the intersection points as a Point object array. - * + * * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. * @param rectA The first Rectangle to check for intersection. * @param rectB The second Rectangle to check for intersection. @@ -75504,7 +76836,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. - * + * * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. * @param triangle The Triangle to check for intersection. * @param circle The Circle to check for intersection. @@ -75515,7 +76847,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. - * + * * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * @param triangle The Triangle to check with. * @param line The Line to check with. @@ -75526,7 +76858,7 @@ declare namespace Phaser { /** * Checks if two Triangles intersect, and returns the intersection points as a Point object array. - * + * * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". * @param triangleA The first Triangle to check for intersection. * @param triangleB The second Triangle to check for intersection. @@ -75537,7 +76869,7 @@ declare namespace Phaser { /** * Checks for intersection between the line segment and circle. - * + * * Based on code by [Matt DesLauriers](https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md). * @param line The line segment to check. * @param circle The circle to check against the line. @@ -75558,9 +76890,9 @@ declare namespace Phaser { /** * Checks for intersection between the Line and a Rectangle shape, or a rectangle-like * object, with public `x`, `y`, `right` and `bottom` properties, such as a Sprite or Body. - * + * * An intersection is considered valid if: - * + * * The line starts within, or ends within, the Rectangle. * The line segment intersects one of the 4 rectangle edges. * @@ -75592,7 +76924,7 @@ declare namespace Phaser { /** * Checks if two Rectangles intersect. - * + * * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. * As such, the two Rectangles are considered "solid". * A Rectangle with no width or no height will never intersect another Rectangle. @@ -75630,7 +76962,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Circle intersect. - * + * * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. * @param triangle The Triangle to check for intersection. * @param circle The Circle to check for intersection. @@ -75640,7 +76972,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Line intersect. - * + * * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * @param triangle The Triangle to check with. * @param line The Line to check with. @@ -75650,7 +76982,7 @@ declare namespace Phaser { /** * Checks if two Triangles intersect. - * + * * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". * @param triangleA The first Triangle to check for intersection. * @param triangleB The second Triangle to check for intersection. @@ -75737,9 +77069,9 @@ declare namespace Phaser { * * The amounts can be positive or negative. Positive values will increase the length of the line, * while negative ones will decrease it. - * + * * If no `right` value is provided it will extend the length of the line equally in both directions. - * + * * Pass a value of zero to leave the start or end point unchanged. * * The `left` value extends outward from the start point (x1, y1) along the line's direction, and the `right` value extends outward from the end point (x2, y2). @@ -75753,22 +77085,22 @@ declare namespace Phaser { /** * Returns an array of `quantity` Points where each point is taken from the given Line, * spaced out according to the ease function specified. - * + * * ```javascript * const line = new Phaser.Geom.Line(100, 300, 700, 300); * const points = Phaser.Geom.Line.GetEasedPoints(line, 'sine.out', 32) * ``` - * + * * In the above example, the `points` array will contain 32 points spread-out across * the length of `line`, where the position of each point is determined by the `Sine.out` * ease function. - * + * * You can optionally provide a collinear threshold. In this case, the resulting points * are checked against each other, and if they are `< collinearThreshold` distance apart, * they are dropped from the results. This can help avoid lots of clustered points at * far ends of the line with tightly-packed eases such as Quartic. Leave the value set * to zero to skip this check. - * + * * Note that if you provide a collinear threshold, the resulting array may not always * contain `quantity` points. * @param line The Line object. @@ -75800,7 +77132,7 @@ declare namespace Phaser { /** * Calculate the normal of the given line. - * + * * The normal of a line is a vector that points perpendicular from it. * @param line The line to calculate the normal of. * @param out An optional Vector2 object to store the normal in. @@ -75822,10 +77154,10 @@ declare namespace Phaser { * The last endpoint (x2, y2) is not included in the returned points. * * Provide a `quantity` to get an exact number of points along the line. - * + * * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when * providing a `stepRate`. - * + * * See also `GetEasedPoints` for a way to distribute the points across the line according to an ease type or input function. * @param line The line. * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. @@ -75895,9 +77227,9 @@ declare namespace Phaser { /** * Get a number of points along a line's length. - * + * * Provide a `quantity` to get an exact number of points along the line. - * + * * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when * providing a `stepRate`. * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. @@ -76093,7 +77425,7 @@ declare namespace Phaser { */ class Polygon { /** - * + * * @param points List of points defining the perimeter of this Polygon. Several formats are supported: * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` @@ -76131,43 +77463,43 @@ declare namespace Phaser { * This module implements a modified ear slicing algorithm, optimized by z-order curve hashing and extended to * handle holes, twisted polygons, degeneracies and self-intersections in a way that doesn't guarantee correctness * of triangulation, but attempts to always produce acceptable results for practical data. - * + * * Example: - * + * * ```javascript * const triangles = Phaser.Geom.Polygon.Earcut([10,0, 0,50, 60,60, 70,10]); // returns [1,0,3, 3,2,1] * ``` - * + * * Each group of three vertex indices in the resulting array forms a triangle. - * + * * ```javascript * // triangulating a polygon with a hole * earcut([0,0, 100,0, 100,100, 0,100, 20,20, 80,20, 80,80, 20,80], [4]); * // [3,0,4, 5,4,0, 3,4,7, 5,0,1, 2,3,7, 6,5,1, 2,7,6, 6,1,2] - * + * * // triangulating a polygon with 3d coords * earcut([10,0,1, 0,50,2, 60,60,3, 70,10,4], null, 3); * // [1,0,3, 3,2,1] * ``` - * + * * If you pass a single vertex as a hole, Earcut treats it as a Steiner point. - * + * * If your input is a multi-dimensional array (e.g. GeoJSON Polygon), you can convert it to the format * expected by Earcut with `Phaser.Geom.Polygon.Earcut.flatten`: - * + * * ```javascript * var data = earcut.flatten(geojson.geometry.coordinates); * var triangles = earcut(data.vertices, data.holes, data.dimensions); * ``` - * + * * After getting a triangulation, you can verify its correctness with `Phaser.Geom.Polygon.Earcut.deviation`: - * + * * ```javascript * var deviation = earcut.deviation(vertices, holes, dimensions, triangles); * ``` * Returns the relative difference between the total area of triangles and the area of the input polygon. * 0 means the triangulation is fully correct. - * + * * For more information see https://github.com/mapbox/earcut * @param data A flat array of vertex coordinates, like [x0,y0, x1,y1, x2,y2, ...] * @param holeIndices An array of hole indices if any (e.g. [5, 8] for a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11). @@ -76240,15 +77572,15 @@ declare namespace Phaser { /** * Sets this Polygon to the given points. - * + * * The points can be set from a variety of formats: - * + * * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * `setTo` may also be called without any arguments to remove all points. * @param points Points defining the perimeter of this polygon. Please check function description above for the different supported formats. * @returns This Polygon object. @@ -76328,7 +77660,7 @@ declare namespace Phaser { */ class Rectangle { /** - * + * * @param x The X coordinate of the top left corner of the Rectangle. Default 0. * @param y The Y coordinate of the top left corner of the Rectangle. Default 0. * @param width The width of the Rectangle. Default 0. @@ -76432,7 +77764,7 @@ declare namespace Phaser { * Adjusts the target rectangle, changing its width, height and position, * so that it fits inside the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitOutside` function, there may be some space inside the source area not covered. * @param target The target rectangle to adjust. * @param source The source rectangle to envelop the target in. @@ -76444,7 +77776,7 @@ declare namespace Phaser { * Adjusts the target rectangle, changing its width, height and position, * so that it fully covers the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitInside` function, the target rectangle may extend further out than the source. * @param target The target rectangle to adjust. * @param source The source rectangle to envelope the target in. @@ -76470,7 +77802,7 @@ declare namespace Phaser { * Constructs a new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. * * The `points` parameter is an array of Point-like objects: - * + * * ```js * const points = [ * [100, 200], @@ -76512,9 +77844,9 @@ declare namespace Phaser { /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * @param rectangle The Rectangle to get the perimeter point from. * @param position The normalized distance into the Rectangle's perimeter to return. @@ -76544,7 +77876,7 @@ declare namespace Phaser { /** * Increases the size of a Rectangle by a specified amount. - * + * * The center of the Rectangle stays the same. The amounts are added to each side, so the actual increase in width or height is two times bigger than the respective argument. * @param rect The Rectangle to inflate. * @param x How many pixels the left and the right side should be moved by horizontally. @@ -76703,9 +78035,9 @@ declare namespace Phaser { /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * @param position The normalized distance into the Rectangle's perimeter to return. * @param output A Vector2 instance to update with the `x` and `y` coordinates of the point. @@ -76868,7 +78200,7 @@ declare namespace Phaser { */ class Triangle { /** - * + * * @param x1 `x` coordinate of the first point. Default 0. * @param y1 `y` coordinate of the first point. Default 0. * @param x2 `x` coordinate of the second point. Default 0. @@ -76929,7 +78261,7 @@ declare namespace Phaser { /** * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity). - * + * * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio. * @param triangle The Triangle to use. * @param out A Vector2 object to store the coordinates in. @@ -78783,126 +80115,126 @@ declare namespace Phaser { namespace Events { /** * The Input Plugin Boot Event. - * + * * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. */ const BOOT: string; /** * The Input Plugin Destroy Event. - * + * * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. */ const DESTROY: string; /** * The Pointer Drag End Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. */ const DRAG_END: string; /** * The Pointer Drag Enter Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. */ const DRAG_ENTER: string; /** * The Pointer Drag Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. */ const DRAG: string; /** * The Pointer Drag Leave Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. */ const DRAG_LEAVE: string; /** * The Pointer Drag Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. */ const DRAG_OVER: string; /** * The Pointer Drag Start Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. */ const DRAG_START: string; /** * The Pointer Drop Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. */ const DROP: string; /** * The Game Object Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -78910,12 +80242,12 @@ declare namespace Phaser { /** * The Game Object Drag End Event. - * + * * This event is dispatched by an interactive Game Object if a pointer stops dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. */ @@ -78923,12 +80255,12 @@ declare namespace Phaser { /** * The Game Object Drag Enter Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ @@ -78936,12 +80268,12 @@ declare namespace Phaser { /** * The Game Object Drag Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ @@ -78949,12 +80281,12 @@ declare namespace Phaser { /** * The Game Object Drag Leave Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ @@ -78962,15 +80294,15 @@ declare namespace Phaser { /** * The Game Object Drag Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ @@ -78978,15 +80310,15 @@ declare namespace Phaser { /** * The Game Object Drag Start Event. - * + * * This event is dispatched by an interactive Game Object if a pointer starts to drag it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. */ @@ -78994,12 +80326,12 @@ declare namespace Phaser { /** * The Game Object Drop Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. - * + * * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ @@ -79007,22 +80339,22 @@ declare namespace Phaser { /** * The Game Object Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79030,22 +80362,22 @@ declare namespace Phaser { /** * The Game Object Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * @@ -79056,22 +80388,22 @@ declare namespace Phaser { /** * The Game Object Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79079,21 +80411,21 @@ declare namespace Phaser { /** * The Game Object Pointer Down Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79101,21 +80433,21 @@ declare namespace Phaser { /** * The Game Object Pointer Move Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79123,21 +80455,21 @@ declare namespace Phaser { /** * The Game Object Pointer Out Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves out of it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * @@ -79148,21 +80480,21 @@ declare namespace Phaser { /** * The Game Object Pointer Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79170,21 +80502,21 @@ declare namespace Phaser { /** * The Game Object Pointer Up Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is released while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79192,21 +80524,21 @@ declare namespace Phaser { /** * The Game Object Pointer Wheel Event. - * + * * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79214,22 +80546,22 @@ declare namespace Phaser { /** * The Game Object Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79237,22 +80569,22 @@ declare namespace Phaser { /** * The Game Object Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79260,17 +80592,17 @@ declare namespace Phaser { /** * The Input Plugin Game Out Event. - * + * * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now * outside of it, elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. */ const GAME_OUT: string; /** * The Input Plugin Game Over Event. - * + * * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now * over it, having previously been elsewhere on the web page. * @@ -79280,14 +80612,14 @@ declare namespace Phaser { /** * The Input Manager Boot Event. - * + * * This internal event is dispatched by the Input Manager when it boots. */ const MANAGER_BOOT: string; /** * The Input Manager Process Event. - * + * * This internal event is dispatched by the Input Manager when not using the legacy queue system, * and it wants the Input Plugins to update themselves. */ @@ -79295,31 +80627,31 @@ declare namespace Phaser { /** * The Input Manager Update Event. - * + * * This internal event is dispatched by the Input Manager as part of its update step. */ const MANAGER_UPDATE: string; /** * The Input Manager Pointer Lock Change Event. - * + * * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. */ const POINTERLOCK_CHANGE: string; /** * The Pointer Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79327,17 +80659,17 @@ declare namespace Phaser { /** * The Pointer Down Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79345,17 +80677,17 @@ declare namespace Phaser { /** * The Pointer Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79363,17 +80695,17 @@ declare namespace Phaser { /** * The Pointer Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerout', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * @@ -79384,17 +80716,17 @@ declare namespace Phaser { /** * The Pointer Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79402,17 +80734,17 @@ declare namespace Phaser { /** * The Pointer Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79420,17 +80752,17 @@ declare namespace Phaser { /** * The Pointer Up Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79438,17 +80770,17 @@ declare namespace Phaser { /** * The Pointer Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. - * + * * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ @@ -79456,7 +80788,7 @@ declare namespace Phaser { /** * The Input Plugin Pre-Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. */ @@ -79464,14 +80796,14 @@ declare namespace Phaser { /** * The Input Plugin Shutdown Event. - * + * * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. */ const SHUTDOWN: string; /** * The Input Plugin Start Event. - * + * * This internal event is dispatched by the Input Plugin when it has finished setting-up, * signalling to all of its internal systems to start. */ @@ -79479,7 +80811,7 @@ declare namespace Phaser { /** * The Input Plugin Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `update` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. */ @@ -79496,7 +80828,7 @@ declare namespace Phaser { */ class Axis { /** - * + * * @param pad A reference to the Gamepad that this Axis belongs to. * @param index The index of this Axis. */ @@ -79551,7 +80883,7 @@ declare namespace Phaser { */ class Button { /** - * + * * @param pad A reference to the Gamepad that this Button belongs to. * @param index The index of this Button. * @param isPressed Whether or not the button is already being pressed at creation time. This prevents the Button from emitting spurious 'down' events at first update. Default false. @@ -79605,82 +80937,98 @@ declare namespace Phaser { * buttons via the `buttons` array, and axes via the `axes` array. Gamepads are typically * accessed through `this.input.gamepad.pad1` through `pad4` in a Scene. */ - class Gamepad extends Phaser.Events.EventEmitter { + class KeyboardManager { /** - * - * @param manager A reference to the Gamepad Plugin. - * @param pad The Gamepad object, as extracted from GamepadEvent. + * + * @param inputManager A reference to the Input Manager. */ - constructor(manager: Phaser.Input.Gamepad.GamepadPlugin, pad: Phaser.Types.Input.Gamepad.Pad); + constructor(inputManager: Phaser.Input.InputManager); /** - * A reference to the Gamepad Plugin. + * A reference to the Input Manager. */ - manager: Phaser.Input.Gamepad.GamepadPlugin; + manager: Phaser.Input.InputManager; /** - * A reference to the native Gamepad object that is connected to the browser. + * A flag that controls if the non-modified keys, matching those stored in the `captures` array, + * have `preventDefault` called on them or not. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle this property at run-time. */ - pad: any; + preventDefault: boolean; /** - * A string containing some information about the controller. - * - * This is not strictly specified, but in Firefox it will contain three pieces of information - * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and - * product id of the controller, and the name of the controller as provided by the driver. - * In Chrome it will contain the name of the controller as provided by the driver, - * followed by vendor and product 4-digit hexadecimal strings. + * An array of Key Code values that will automatically have `preventDefault` called on them, + * as long as the `KeyboardManager.preventDefault` boolean is set to `true`. + * + * By default the array is empty. + * + * The key must be non-modified when pressed in order to be captured. + * + * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are + * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). + * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. + * However, if the user presses just the r key on its own, it will have its event prevented. + * + * If you wish to stop capturing the keys, for example switching out to a DOM based element, then + * you can toggle the `KeyboardManager.preventDefault` boolean at run-time. + * + * If you need more specific control, you can create Key objects and set the flag on each of those instead. + * + * This array can be populated via the Game Config by setting the `input.keyboard.capture` array, or you + * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. */ - id: string; + captures: number[]; /** - * An integer that is unique for each Gamepad currently connected to the system. - * This can be used to distinguish multiple controllers. - * Note that disconnecting a device and then connecting a new device may reuse the previous index. + * A boolean that controls if the Keyboard Manager is enabled or not. + * Can be toggled on the fly. */ - index: number; + enabled: boolean; /** - * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad. + * The Keyboard Event target, as defined in the Game Config. + * Typically the window in which the game is rendering, but can be any interactive DOM element. */ - buttons: Phaser.Input.Gamepad.Button[]; + target: any; /** - * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any. + * The Key Down Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. */ - axes: Phaser.Input.Gamepad.Axis[]; + onKeyDown: Function; /** - * The Gamepad's Haptic Actuator (Vibration / Rumble support). - * This is highly experimental and only set if both present on the device, - * and exposed by both the hardware and browser. + * The Key Up Event handler. + * This function is sent the native DOM KeyEvent. + * Initially empty and bound in the `startListeners` method. */ - vibration: GamepadHapticActuator; + onKeyUp: Function; /** - * A Vector2 containing the most recent values from the Gamepad's left axis stick. - * This is updated automatically as part of the Gamepad.update cycle. - * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. - * The values are based on the Axis thresholds. - * If the Gamepad does not have a left axis stick, the values will always be zero. + * Starts the Keyboard Event listeners running. + * This is called automatically and does not need to be manually invoked. */ - leftStick: Phaser.Math.Vector2; + startListeners(): void; /** - * A Vector2 containing the most recent values from the Gamepad's right axis stick. - * This is updated automatically as part of the Gamepad.update cycle. - * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. - * The values are based on the Axis thresholds. - * If the Gamepad does not have a right axis stick, the values will always be zero. + * Stops the Key Event listeners. + * This is called automatically and does not need to be manually invoked. */ - rightStick: Phaser.Math.Vector2; + stopListeners(): void; /** * Gets the total number of axis this Gamepad claims to support.undefined * @returns The total number of axes this Gamepad claims to support. */ - getAxisTotal(): number; + addCapture(keycode: string | number | number[] | any[]): void; /** * Gets the value of an axis based on the given index. @@ -79689,14 +81037,12 @@ declare namespace Phaser { * @param index The index of the axes to get the value for. * @returns The value of the axis, between -1 and 1. */ - getAxisValue(index: number): number; + removeCapture(keycode: string | number | number[] | any[]): void; /** - * Sets the threshold value of all axis on this Gamepad. - * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved. - * @param value A value between 0 and 1. + * Removes all keyboard captures and sets the `preventDefault` property to `false`. */ - setAxisThreshold(value: number): void; + clearCaptures(): void; /** * Gets the total number of buttons this Gamepad claims to have.undefined @@ -79728,158 +81074,57 @@ declare namespace Phaser { */ destroy(): void; - /** - * Is this Gamepad currently connected or not? - */ - connected: boolean; - - /** - * A timestamp containing the most recent time this Gamepad was updated. - */ - timestamp: number; - - /** - * Is the Gamepad's Left button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad left button under standard Gamepad mapping. - */ - left: boolean; - - /** - * Is the Gamepad's Right button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad right button under standard Gamepad mapping. - */ - right: boolean; - - /** - * Is the Gamepad's Up button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad up button under standard Gamepad mapping. - */ - up: boolean; - - /** - * Is the Gamepad's Down button being pressed? - * If the Gamepad doesn't have this button it will always return false. - * This is the d-pad down button under standard Gamepad mapping. - */ - down: boolean; - - /** - * Is the Gamepad's bottom button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the X button. - * On an XBox controller it's the A button. - */ - A: boolean; - - /** - * Is the Gamepad's top button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the Triangle button. - * On an XBox controller it's the Y button. - */ - Y: boolean; - - /** - * Is the Gamepad's left button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the Square button. - * On an XBox controller it's the X button. - */ - X: boolean; - - /** - * Is the Gamepad's right button in the right button cluster being pressed? - * If the Gamepad doesn't have this button it will always return false. - * On a Dual Shock controller it's the Circle button. - * On an XBox controller it's the B button. - */ - B: boolean; - - /** - * Returns the value of the Gamepad's top left shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the L1 button. - * On an XBox controller it's the LB button. - */ - L1: number; - - /** - * Returns the value of the Gamepad's bottom left shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the L2 button. - * On an XBox controller it's the LT button. - */ - L2: number; - - /** - * Returns the value of the Gamepad's top right shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the R1 button. - * On an XBox controller it's the RB button. - */ - R1: number; - - /** - * Returns the value of the Gamepad's bottom right shoulder button. - * If the Gamepad doesn't have this button it will always return zero. - * The value is a float between 0 and 1, corresponding to how depressed the button is. - * On a Dual Shock controller it's the R2 button. - * On an XBox controller it's the RT button. - */ - R2: number; - } /** - * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system. - * - * Its role is to listen for native DOM Gamepad Events and then process them. - * + * The Keyboard Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Keyboard Events and then process them. + * * You do not need to create this class directly, the Input system will create an instance of it automatically. - * - * You can access it from within a Scene using `this.input.gamepad`. - * - * To listen for a gamepad being connected: - * + * + * You can access it from within a Scene using `this.input.keyboard`. For example, you can do: + * * ```javascript - * this.input.gamepad.once('connected', function (pad) { - * // 'pad' is a reference to the gamepad that was just connected - * }); + * this.input.keyboard.on('keydown', callback, context); * ``` - * - * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, - * this is for security reasons. However, it may also trust the page already, in which case you won't get the - * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads - * already connected. - * - * Once you have received the connected event, or polled the gamepads and found them enabled, you can access - * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference - * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on - * the `Gamepad` class for more details. - * - * As of September 2020 Chrome, and likely other browsers, will soon start to require that games requesting - * access to the Gamepad API are running under SSL. They will actively block API access if they are not. - * - * For more information about Gamepad support in browsers see the following resources: - * - * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API - * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API - * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/ - * http://html5gamepad.com/ + * + * Or, to listen for a specific key: + * + * ```javascript + * this.input.keyboard.on('keydown-A', callback, context); + * ``` + * + * You can also create Key objects, which you can then poll in your game loop: + * + * ```javascript + * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * ``` + * + * If you have multiple parallel Scenes, each trying to get keyboard input, be sure to disable capture on them to stop them from + * stealing input from another Scene in the list. You can do this with `this.input.keyboard.enabled = false` within the + * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. + * + * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. + * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details + * and use the site https://w3c.github.io/uievents/tools/key-event-viewer.html to test your n-key support in browser. + * + * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. + * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. + * And there are others. So, please check your extensions before opening Phaser issues about keys that don't work. */ - class GamepadPlugin extends Phaser.Events.EventEmitter { + class KeyboardPlugin extends Phaser.Events.EventEmitter { /** * * @param sceneInputPlugin A reference to the Scene Input Plugin that the GamepadPlugin belongs to. */ constructor(sceneInputPlugin: Phaser.Input.InputPlugin); + /** + * A reference to the core game, so we can listen for visibility events. + */ + game: Phaser.Game; + /** * A reference to the Scene that this Input Plugin is responsible for. */ @@ -79896,21 +81141,25 @@ declare namespace Phaser { sceneInputPlugin: Phaser.Input.InputPlugin; /** - * A boolean that controls if the Gamepad Manager is enabled or not. + * A reference to the global Keyboard Manager. + */ + manager: Phaser.Input.Keyboard.KeyboardManager; + + /** + * A boolean that controls if this Keyboard Plugin is enabled or not. * Can be toggled on the fly. */ enabled: boolean; /** - * The Gamepad Event target, as defined in the Game Config. - * Typically the browser window, but can be any interactive DOM element. + * An array of Key objects to process. */ - target: any; + keys: Phaser.Input.Keyboard.Key[]; /** - * An array of the connected Gamepads. + * An array of KeyCombo objects to process. */ - gamepads: Phaser.Input.Gamepad.Gamepad[]; + combos: Phaser.Input.Keyboard.KeyCombo[]; /** * Checks to see if both this plugin and the Scene to which it belongs is active.undefined @@ -79919,27 +81168,58 @@ declare namespace Phaser { isActive(): boolean; /** - * Disconnects all current Gamepads. + * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. + * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. + * + * This `addCapture` method enables consuming keyboard events for specific keys, so they don't bubble up the browser + * and cause the default behaviors. + * + * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent + * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. + * + * You can pass a single key code value: + * + * ```javascript + * this.input.keyboard.addCapture(62); + * ``` + * + * An array of key codes: + * + * ```javascript + * this.input.keyboard.addCapture([ 62, 63, 64 ]); + * ``` + * + * Or, a comma-delimited string: + * + * ```javascript + * this.input.keyboard.addCapture('W,S,A,D'); + * ``` + * + * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. + * + * You can also provide an array mixing both strings and key code integers. + * @param keycode The Key Codes to enable event capture for. */ - disconnectAll(): void; + addCapture(keycode: string | number | number[] | any[]): this; /** * Returns an array of all currently connected Gamepads.undefined * @returns An array of all currently connected Gamepads. */ - getAll(): Phaser.Input.Gamepad.Gamepad[]; + removeCapture(keycode: string | number | number[] | any[]): this; /** * Looks up a single Gamepad based on the given index value. * @param index The index of the Gamepad to get. * @returns The Gamepad matching the given index, or undefined if none were found. */ - getPad(index: number): Phaser.Input.Gamepad.Gamepad; + getCaptures(): number[]; /** - * The total number of connected game pads. + * Allows Phaser to prevent any key captures you may have defined from bubbling up the browser. + * You can use this to re-enable event capturing if you had paused it via `disableGlobalCapture`. */ - total: number; + enableGlobalCapture(): this; /** * A reference to the first connected Gamepad. @@ -79948,7 +81228,7 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - pad1: Phaser.Input.Gamepad.Gamepad; + disableGlobalCapture(): this; /** * A reference to the second connected Gamepad. @@ -79957,7 +81237,7 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - pad2: Phaser.Input.Gamepad.Gamepad; + clearCaptures(): this; /** * A reference to the third connected Gamepad. @@ -79966,7 +81246,7 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - pad3: Phaser.Input.Gamepad.Gamepad; + createCursorKeys(): Phaser.Types.Input.Keyboard.CursorKeys; /** * A reference to the fourth connected Gamepad. @@ -79975,7 +81255,93 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - pad4: Phaser.Input.Gamepad.Gamepad; + addKeys(keys: object | string, enableCapture?: boolean, emitOnRepeat?: boolean): object; + + /** + * Adds a Key object to this Keyboard Plugin. + * + * The given argument can be either an existing Key object, a string, such as `A` or `SPACE`, or a key code value. + * + * If a Key object is given, and one already exists matching the same key code, the existing one is replaced with the new one. + * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param enableCapture Automatically call `preventDefault` on the native DOM browser event for the key codes being added. Default true. + * @param emitOnRepeat Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). Default false. + */ + addKey(key: Phaser.Input.Keyboard.Key | string | number, enableCapture?: boolean, emitOnRepeat?: boolean): Phaser.Input.Keyboard.Key; + + /** + * Removes a Key object from this Keyboard Plugin. + * + * The given argument can be either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param destroy Call `Key.destroy` on the removed Key object? Default false. + * @param removeCapture Remove this Key from being captured? Only applies if set to capture when created. Default false. + */ + removeKey(key: Phaser.Input.Keyboard.Key | string | number, destroy?: boolean, removeCapture?: boolean): this; + + /** + * Removes all Key objects created by _this_ Keyboard Plugin. + * @param destroy Call `Key.destroy` on each removed Key object? Default false. + * @param removeCapture Remove all key captures for Key objects owened by this plugin? Default false. + */ + removeAllKeys(destroy?: boolean, removeCapture?: boolean): this; + + /** + * Creates a new KeyCombo. + * + * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them + * it will emit a `keycombomatch` event from this Keyboard Plugin. + * + * The keys to be listened for can be defined as: + * + * A string (i.e. 'ATARI') + * An array of either integers (key codes) or strings, or a mixture of both + * An array of objects (such as Key objects) with a public 'keyCode' property + * + * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) + * you could pass the following array of key codes: + * + * ```javascript + * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); + * + * this.input.keyboard.on('keycombomatch', function (event) { + * console.log('Konami Code entered!'); + * }); + * ``` + * + * Or, to listen for the user entering the word PHASER: + * + * ```javascript + * this.input.keyboard.createCombo('PHASER'); + * ``` + * @param keys The keys that comprise this combo. + * @param config A Key Combo configuration object. + */ + createCombo(keys: string | number[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig): Phaser.Input.Keyboard.KeyCombo; + + /** + * Checks if the given Key object is currently being held down. + * + * The difference between this method and checking the `Key.isDown` property directly is that you can provide + * a duration to this method. For example, if you wanted a key press to fire a bullet, but you only wanted + * it to be able to fire every 100ms, then you can call this method with a `duration` of 100 and it + * will only return `true` every 100ms. + * + * If the Keyboard Plugin has been disabled, this method will always return `false`. + * @param key A Key object. + * @param duration The duration which must have elapsed before this Key is considered as being down. Default 0. + */ + checkDown(key: Phaser.Input.Keyboard.Key, duration?: number): boolean; + + /** + * Resets all Key objects created by _this_ Keyboard Plugin back to their default un-pressed states. + * This can only reset keys created via the `addKey`, `addKeys` or `createCursorKeys` methods. + * If you have created a Key object directly you'll need to reset it yourself. + * + * This method is called automatically when the Keyboard Plugin shuts down, but can be + * invoked directly at any time you require. + */ + resetKeys(): this; } @@ -81111,9 +82477,9 @@ declare namespace Phaser { /** * The justDown value allows you to test if this Key has just been pressed down or not. - * + * * When you check this value it will return `true` if the Key is down, otherwise `false`. - * + * * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. * @param key The Key to check to see if it's just down or not. @@ -81123,9 +82489,9 @@ declare namespace Phaser { /** * The justUp value allows you to test if this Key has just been released or not. - * + * * When you check this value it will return `true` if the Key is up, otherwise `false`. - * + * * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. * @param key The Key to check to see if it's just up or not. @@ -81143,7 +82509,7 @@ declare namespace Phaser { */ class Key extends Phaser.Events.EventEmitter { /** - * + * * @param plugin The Keyboard Plugin instance that owns this Key object. * @param keyCode The keycode of this key. */ @@ -81224,7 +82590,7 @@ declare namespace Phaser { /** * When a key is held down should it continuously fire the `down` event each time it repeats? - * + * * By default it will emit the `down` event just once, but if you wish to receive the event * for each repeat as well, enable this property. */ @@ -81267,9 +82633,9 @@ declare namespace Phaser { /** * Returns the duration, in ms, that the Key has been held down for. - * + * * If the key is not currently down it will return zero. - * + * * To get the duration the Key was held down for in the previous up-down cycle, * use the `Key.duration` property value instead.undefined * @returns The duration, in ms, that the Key has been held down for if currently down. @@ -81802,14 +83168,14 @@ declare namespace Phaser { namespace Mouse { /** * The Mouse Manager is a helper class that belongs to the Input Manager. - * + * * Its role is to listen for native DOM Mouse Events and then pass them onto the Input Manager for further processing. - * + * * You do not need to create this class directly, the Input Manager will create an instance of it automatically. */ class MouseManager { /** - * + * * @param inputManager A reference to the Input Manager. */ constructor(inputManager: Phaser.Input.InputManager); @@ -81921,7 +83287,7 @@ declare namespace Phaser { /** * Are the event listeners hooked into `window.top` or `window`? - * + * * This is set during the `boot` sequence. If the browser does not have access to `window.top`, * such as in cross-origin iframe environments, this property gets set to `false` and the events * are hooked into `window` instead. @@ -81930,9 +83296,9 @@ declare namespace Phaser { /** * Attempts to disable the context menu from appearing if you right-click on the game canvas, or specified input target. - * + * * Works by listening for the `contextmenu` event and prevent defaulting it. - * + * * Use this if you need to enable right-button mouse support in your game, and the context * menu keeps getting in the way.undefined * @returns This Mouse Manager instance. @@ -81941,16 +83307,16 @@ declare namespace Phaser { /** * If the browser supports it, you can request that the pointer be locked to the browser window. - * + * * This is classically known as 'FPS controls', where the pointer can't leave the browser until * the user presses an exit key. - * + * * If the browser successfully enters a locked state, a `POINTER_LOCK_CHANGE_EVENT` will be dispatched, * from the games Input Manager, with an `isPointerLocked` property. - * + * * It is important to note that pointer lock can only be enabled after an 'engagement gesture', * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. - * + * * Note for Firefox: There is a bug in certain Firefox releases that cause native DOM events like * `mousemove` to fire continuously when in pointer lock mode. You can get around this by setting * `this.preventDefaultMove` to `false` in this class. You may also need to do the same for @@ -81990,14 +83356,14 @@ declare namespace Phaser { namespace Touch { /** * The Touch Manager is a helper class that belongs to the Input Manager. - * + * * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. - * + * * You do not need to create this class directly, the Input Manager will create an instance of it automatically. */ class TouchManager { /** - * + * * @param inputManager A reference to the Input Manager. */ constructor(inputManager: Phaser.Input.InputManager); @@ -82068,7 +83434,7 @@ declare namespace Phaser { /** * Are the event listeners hooked into `window.top` or `window`? - * + * * This is set during the `boot` sequence. If the browser does not have access to `window.top`, * such as in cross-origin iframe environments, this property gets set to `false` and the events * are hooked into `window` instead. @@ -82087,7 +83453,7 @@ declare namespace Phaser { /** * Starts the Touch Event listeners running as long as an input target is set. - * + * * This method is called automatically if Touch Input is enabled in the game config, * which it is by default. However, you can call it manually should you need to * delay input capturing until later in the game. @@ -87497,8 +88863,10 @@ declare namespace Phaser { */ class Matrix3 { /** - * - * @param m Optional Matrix3 to copy values from. + * A Smoother Step interpolation method. + * @param t The percentage of interpolation, between 0 and 1. + * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. */ constructor(m?: Phaser.Math.Matrix3); @@ -92383,9 +93751,9 @@ declare namespace Phaser { namespace BitmapText { /** * The font data for an individual character of a Bitmap Font. - * + * * Describes the character's position, size, offset and kerning. - * + * * As of version 3.50 it also includes the WebGL texture uv data. */ type BitmapFontCharacterData = { @@ -92475,7 +93843,7 @@ declare namespace Phaser { /** * A single entry from the `BitmapTextSize` characters array. - * + * * The position and dimensions take the font size into account, * but are not translated into the local space of the Game Object itself. */ @@ -93055,11 +94423,11 @@ declare namespace Phaser { /** * The total number of objects created will be - * + * * key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat) - * + * * If `max` is nonzero, then the total created will not exceed `max`. - * + * * `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used. */ type GroupCreateConfig = { @@ -95302,7 +96670,7 @@ declare namespace Phaser { /** * A Phaser Input Event Data object. - * + * * This object is passed to the registered event listeners and allows you to stop any further propagation. */ type EventData = { @@ -97589,22 +98957,22 @@ declare namespace Phaser { /** * An `Object` that specifies the collision filtering properties of this body. - * + * * Collisions between two bodies will obey the following rules: * - If the two bodies have the same non-zero value of `collisionFilter.group`, * they will always collide if the value is positive, and they will never collide * if the value is negative. * - If the two bodies have different values of `collisionFilter.group` or if one * (or both) of the bodies has a value of 0, then the category/mask rules apply as follows: - * + * * Each body belongs to a collision category, given by `collisionFilter.category`. This * value is used as a bit field and the category should have only one bit set, meaning that * the value of this property is a power of two in the range [1, 2^31]. Thus, there are 32 * different collision categories available. - * + * * Each body also defines a collision bitmask, given by `collisionFilter.mask` which specifies * the categories it collides with (the value is the bitwise AND value of all these categories). - * + * * Using the category/mask rules, two bodies `A` and `B` collide if each includes the other's * category in its mask, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` * are both true. @@ -97970,9 +99338,9 @@ declare namespace Phaser { /** * Configuration for the Matter Physics Runner. - * + * * Set only one of `fps` and `delta`. - * + * * `delta` is the size of the Runner's fixed time step (one physics update). * The "frame delta" is the time elapsed since the last game step. * Depending on the size of the frame delta, the Runner makes zero or more updates per game step. @@ -99315,7 +100683,7 @@ declare namespace Phaser { /** * Config object containing settings for the source of the spatial sound. - * + * * See https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics */ type SpatialSoundConfig = { @@ -101092,7 +102460,7 @@ declare namespace Phaser { */ class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Collision, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -101338,7 +102706,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -101384,21 +102752,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -101408,21 +102776,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -101434,13 +102802,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -101471,7 +102839,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -101481,11 +102849,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -101494,11 +102862,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -101585,7 +102953,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101596,7 +102964,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101607,7 +102975,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101618,7 +102986,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101629,7 +102997,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101640,7 +103008,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101651,7 +103019,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101662,7 +103030,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101673,7 +103041,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -101755,10 +103123,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -101779,12 +103147,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -101830,7 +103198,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -101932,12 +103300,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -101951,12 +103319,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -101974,10 +103342,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -101994,7 +103362,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -102003,7 +103371,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -102012,30 +103380,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -102045,12 +103413,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -102091,26 +103459,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -102123,7 +103491,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -102133,14 +103501,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -102209,11 +103577,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -102281,7 +103649,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -102295,7 +103663,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -102313,20 +103681,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -102351,9 +103719,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -102402,7 +103770,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -102435,9 +103803,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -102468,14 +103836,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -102506,7 +103874,7 @@ declare namespace Phaser { /** * Sets the angular velocity of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -102517,7 +103885,7 @@ declare namespace Phaser { /** * Sets the angular acceleration of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -102535,7 +103903,7 @@ declare namespace Phaser { /** * Sets the bounce values of this body. - * + * * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. @@ -102564,7 +103932,7 @@ declare namespace Phaser { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. * @param bounceX If given, this will replace the `worldBounce.x` value. @@ -102577,9 +103945,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -102615,10 +103983,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -102638,7 +104006,7 @@ declare namespace Phaser { /** * Sets the debug values of this body. - * + * * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. * Note that there is a performance cost in drawing debug displays. It should never be used in production. * @param showBody Set to `true` to have this body render its outline to the debug display. @@ -102672,16 +104040,16 @@ declare namespace Phaser { /** * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param x The amount of horizontal drag to apply. * @param y The amount of vertical drag to apply. Default x. @@ -102691,16 +104059,16 @@ declare namespace Phaser { /** * Sets the body's horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of horizontal drag to apply. * @returns This Game Object. @@ -102709,16 +104077,16 @@ declare namespace Phaser { /** * Sets the body's vertical drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of vertical drag to apply. * @returns This Game Object. @@ -102731,7 +104099,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. @@ -102844,7 +104212,7 @@ declare namespace Phaser { /** * Sets if this Body can be separated during collisions with other bodies. - * + * * When a body is immovable it means it won't move at all, not even to separate it from collision * overlap. If you just wish to prevent a body from being knocked around by other bodies, see * the `setPushable` method instead. @@ -102863,7 +104231,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -102911,7 +104279,7 @@ declare namespace Phaser { /** * Sets the horizontal component of the body's velocity. - * + * * Positive values move the body to the right, while negative values move it to the left. * @param x The new horizontal velocity, in pixels per second. * @returns This Game Object. @@ -102920,7 +104288,7 @@ declare namespace Phaser { /** * Sets the vertical component of the body's velocity. - * + * * Positive values move the body down, while negative values move it up. * @param y The new vertical velocity, in pixels per second. * @returns This Game Object. @@ -102940,9 +104308,9 @@ declare namespace Phaser { /** * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. * It also holds some useful methods for moving and rotating Arcade Physics Bodies. - * + * * You can access it from within a Scene using `this.physics`. - * + * * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. * The separation that stops two objects penetrating may create a new penetration against a different object. If you @@ -102950,7 +104318,7 @@ declare namespace Phaser { */ class ArcadePhysics { /** - * + * * @param scene The Scene that this Plugin belongs to. */ constructor(scene: Phaser.Scene); @@ -102994,7 +104362,7 @@ declare namespace Phaser { * If you wish to run the World update at your own rate, or from your own * component, then you should call this method to disable the built-in link, * and then call `World.update(time, delta)` accordingly. - * + * * Note that `World.postUpdate` is always automatically called when the Scene * emits a `POST_UPDATE` event, regardless of this setting. */ @@ -103008,11 +104376,11 @@ declare namespace Phaser { /** * Returns the next available collision category. - * + * * You can have a maximum of 32 categories. - * + * * By default all bodies collide with all other bodies. - * + * * Use the `Body.setCollisionCategory()` and * `Body.setCollidesWith()` methods to change this.undefined * @returns The next collision category. @@ -103033,18 +104401,18 @@ declare namespace Phaser { /** * Performs a collision check and separation between the two physics enabled objects given, which can be single * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. - * + * * If you don't require separation then use {@link #overlap} instead. - * + * * If two Groups or arrays are passed, each member of one will be tested against each member of the other. - * + * * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. - * + * * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. - * + * * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding * objects are passed to it. - * + * * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. * The separation that stops two objects penetrating may create a new penetration against a different object. If you @@ -103060,15 +104428,15 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. - * + * * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for collision with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, * you should filter them before passing them to this method. - * + * * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on @@ -103084,10 +104452,10 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. - * + * * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, @@ -103115,9 +104483,9 @@ declare namespace Phaser { /** * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) - * + * * You must give a maximum speed value, beyond which the game object won't go any faster. - * + * * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. * Note: The game object doesn't stop moving once it reaches the destination coordinates. * @param gameObject Any Game Object with an Arcade Physics body. @@ -103134,7 +104502,7 @@ declare namespace Phaser { * Sets the acceleration.x/y property on the game object so it will move towards the destination object at the given rate (in pixels per second squared) * * You must give a maximum speed value, beyond which the game object won't go any faster. - * + * * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. * Note: The game object doesn't stop moving once it reaches the destination coordinates. * @param gameObject Any Game Object with an Arcade Physics body. @@ -103148,12 +104516,12 @@ declare namespace Phaser { /** * Finds the Body or Game Object closest to a source point or object. - * + * * If a `targets` argument is passed, this method finds the closest of those. * The targets can be Arcade Physics Game Objects, Dynamic Bodies, or Static Bodies. - * + * * If no `targets` argument is passed, this method finds the closest Dynamic Body. - * + * * If two or more targets are the exact same distance from the source point, only the first target * is returned. * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. @@ -103164,12 +104532,12 @@ declare namespace Phaser { /** * Finds the Body or Game Object farthest from a source point or object. - * + * * If a `targets` argument is passed, this method finds the farthest of those. * The targets can be Arcade Physics Game Objects, Dynamic Bodies, or Static Bodies. - * + * * If no `targets` argument is passed, this method finds the farthest Dynamic Body. - * + * * If two or more targets are the exact same distance from the source point, only the first target * is returned. * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. @@ -103232,7 +104600,7 @@ declare namespace Phaser { /** * This method will search the given rectangular area and return an array of all physics bodies that * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. - * + * * A body only has to intersect with the search area to be considered, it doesn't have to be fully * contained within it. * @@ -103251,10 +104619,10 @@ declare namespace Phaser { /** * This method will search the given circular area and return an array of all physics bodies that * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. - * + * * A body only has to intersect with the search area to be considered, it doesn't have to be fully * contained within it. - * + * * If Arcade Physics is set to use the RTree (which it is by default) then the search is rather fast, * otherwise the search is O(N) for Dynamic Bodies. * @param x The x coordinate of the center of the area to search within. @@ -103295,7 +104663,7 @@ declare namespace Phaser { */ class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Collision, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -103545,7 +104913,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -103591,21 +104959,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -103615,21 +104983,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -103641,13 +105009,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -103678,7 +105046,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -103688,11 +105056,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -103701,11 +105069,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -103792,7 +105160,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103803,7 +105171,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103814,7 +105182,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103825,7 +105193,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103836,7 +105204,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103847,7 +105215,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103858,7 +105226,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103869,7 +105237,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103880,7 +105248,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103962,10 +105330,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -103986,12 +105354,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -104037,7 +105405,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -104139,12 +105507,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -104158,12 +105526,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -104181,10 +105549,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -104201,7 +105569,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -104210,7 +105578,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -104219,30 +105587,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -104252,12 +105620,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -104298,26 +105666,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -104330,7 +105698,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -104340,14 +105708,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -104416,11 +105784,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -104488,7 +105856,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -104502,7 +105870,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -104520,20 +105888,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -104558,9 +105926,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -104609,7 +105977,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -104642,9 +106010,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -104675,14 +106043,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -104713,7 +106081,7 @@ declare namespace Phaser { /** * Sets the angular velocity of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -104724,7 +106092,7 @@ declare namespace Phaser { /** * Sets the angular acceleration of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -104742,7 +106110,7 @@ declare namespace Phaser { /** * Sets the bounce values of this body. - * + * * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. @@ -104771,7 +106139,7 @@ declare namespace Phaser { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. * @param bounceX If given, this will replace the `worldBounce.x` value. @@ -104784,9 +106152,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -104822,10 +106190,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -104845,7 +106213,7 @@ declare namespace Phaser { /** * Sets the debug values of this body. - * + * * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. * Note that there is a performance cost in drawing debug displays. It should never be used in production. * @param showBody Set to `true` to have this body render its outline to the debug display. @@ -104879,16 +106247,16 @@ declare namespace Phaser { /** * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param x The amount of horizontal drag to apply. * @param y The amount of vertical drag to apply. Default x. @@ -104898,16 +106266,16 @@ declare namespace Phaser { /** * Sets the body's horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of horizontal drag to apply. * @returns This Game Object. @@ -104916,16 +106284,16 @@ declare namespace Phaser { /** * Sets the body's vertical drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of vertical drag to apply. * @returns This Game Object. @@ -104938,7 +106306,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. @@ -105051,7 +106419,7 @@ declare namespace Phaser { /** * Sets if this Body can be separated during collisions with other bodies. - * + * * When a body is immovable it means it won't move at all, not even to separate it from collision * overlap. If you just wish to prevent a body from being knocked around by other bodies, see * the `setPushable` method instead. @@ -105070,7 +106438,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -105118,7 +106486,7 @@ declare namespace Phaser { /** * Sets the horizontal component of the body's velocity. - * + * * Positive values move the body to the right, while negative values move it to the left. * @param x The new horizontal velocity, in pixels per second. * @returns This Game Object. @@ -105127,7 +106495,7 @@ declare namespace Phaser { /** * Sets the vertical component of the body's velocity. - * + * * Positive values move the body down, while negative values move it up. * @param y The new vertical velocity, in pixels per second. * @returns This Game Object. @@ -105155,7 +106523,7 @@ declare namespace Phaser { */ class Body implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The Arcade Physics simulation this Body belongs to. * @param gameObject The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ @@ -105168,7 +106536,7 @@ declare namespace Phaser { /** * The Game Object this Body belongs to. - * + * * As of Phaser 3.60 this is now optional and can be undefined. */ gameObject: Phaser.GameObjects.GameObject; @@ -105300,7 +106668,7 @@ declare namespace Phaser { /** * The Body's change in position (due to velocity) at the last step, in pixels. - * + * * The size of this value depends on the simulation's step rate. */ readonly newVelocity: Phaser.Math.Vector2; @@ -105322,7 +106690,7 @@ declare namespace Phaser { /** * When `useDamping` is false (the default), this is absolute loss of velocity due to movement, in pixels per second squared. - * + * * When `useDamping` is true, this is a damping multiplier between 0 and 1. * * A value of 0 means the Body stops instantly. @@ -105330,9 +106698,9 @@ declare namespace Phaser { * A value of 0.1 means the Body keeps 10% of its velocity per second, losing 90%. * A value of 1 means the Body loses no velocity. * You can use very small values (e.g., 0.001) to stop the Body quickly. - * + * * The x and y components are applied separately. - * + * * Drag is applied only when `acceleration` is zero. */ drag: Phaser.Math.Vector2; @@ -105361,10 +106729,10 @@ declare namespace Phaser { /** * The rectangle used for world boundary collisions. - * + * * By default it is set to the world boundary rectangle. Or, if this Body was * created by a Physics Group, then whatever rectangle that Group defined. - * + * * You can also change it by using the `Body.setBoundsRectangle` method. */ customBoundsRectangle: Phaser.Geom.Rectangle; @@ -105393,9 +106761,9 @@ declare namespace Phaser { /** * The maximum speed this Body is allowed to reach, in pixels per second. - * + * * If not negative it limits the scalar value of speed. - * + * * Any negative value means no maximum is being applied (the default). */ maxSpeed: number; @@ -105414,7 +106782,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration. @@ -105433,7 +106801,7 @@ declare namespace Phaser { /** * Loss of angular velocity due to angular movement, in degrees per second. - * + * * Angular drag is applied only when angular acceleration is zero. */ angularDrag: number; @@ -105473,7 +106841,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -105486,18 +106854,18 @@ declare namespace Phaser { /** * The Slide Factor of this Body. - * + * * The Slide Factor controls how much velocity is preserved when * this Body is pushed by another Body. - * + * * The default value is 1, which means that it will take on all * velocity given in the push. You can adjust this value to control * how much velocity is retained by this Body when the push ends. - * + * * A value of 0, for example, will allow this Body to be pushed * but then remain completely still after the push ends, such as * you see in a game like Sokoban. - * + * * Or you can set a mid-point, such as 0.25 which will allow it * to keep 25% of the original velocity when the push ends. You * can combine this with the `setDrag()` method to create deceleration. @@ -105581,16 +106949,16 @@ declare namespace Phaser { /** * The Arcade Physics Body Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Body Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; @@ -105618,18 +106986,18 @@ declare namespace Phaser { /** * Updates the Body's `position`, `width`, `height`, and `center` from its Game Object and `offset`. - * + * * You don't need to call this for Dynamic Bodies, as it happens automatically during the physics step. * But you could use it if you have modified the Body offset or Game Object transform and need to immediately * read the Body's new `position` or `center`. - * + * * To resynchronize the Body with its Game Object, use `reset()` instead. */ updateFromGameObject(): void; /** * Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states. - * + * * This method is only called if the physics world is going to run a step this frame. * @param clear Set the `wasTouching` values to their defaults. Default false. */ @@ -105646,9 +107014,9 @@ declare namespace Phaser { /** * Performs a single physics step and updates the body velocity, angle, speed and other properties. - * + * * This method can be called multiple times per game frame, depending on the physics step rate. - * + * * The results are synced back to the Game Object in `postUpdate`. * @param delta The delta time, in seconds, elapsed since the last frame. */ @@ -105656,7 +107024,7 @@ declare namespace Phaser { /** * Feeds the Body results back into the parent Game Object. - * + * * This method is called every game frame, regardless if the world steps or not. */ postUpdate(): void; @@ -105686,12 +107054,12 @@ declare namespace Phaser { /** * Assign this Body to a new Game Object. - * + * * Removes this body from the Physics World, assigns to the new Game Object, calls `setSize` and then * adds this body back into the World again, setting it enabled, unless the `enable` argument is set to `false`. - * + * * If this body already has a Game Object, then it will remove itself from that Game Object first. - * + * * If the given `gameObject` doesn't have a `body` property, it is created and this Body is assigned to it. * @param gameObject The Game Object to assign this Body to. * @param enable Automatically enable this Body for physics. Default true. @@ -105781,7 +107149,7 @@ declare namespace Phaser { /** * The change in this Body's horizontal position from the previous step. * This value is set during the Body's update phase. - * + * * As a Body can update multiple times per step this may not hold the final * delta value for the Body. In this case, please see the `deltaXFinal` method.undefined * @returns The change in horizontal position since the last step, in pixels. @@ -105791,7 +107159,7 @@ declare namespace Phaser { /** * The change in this Body's vertical position from the previous step. * This value is set during the Body's update phase. - * + * * As a Body can update multiple times per step this may not hold the final * delta value for the Body. In this case, please see the `deltaYFinal` method.undefined * @returns The change in vertical position since the last step, in pixels. @@ -105800,10 +107168,10 @@ declare namespace Phaser { /** * The change in this Body's horizontal position from the previous game update. - * + * * This value is set during the `postUpdate` phase and takes into account the * `deltaMax` and final position of the Body. - * + * * Because this value is not calculated until `postUpdate`, you must listen for it * during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will * not be calculated by that point. If you _do_ use these values in `update` they @@ -105814,10 +107182,10 @@ declare namespace Phaser { /** * The change in this Body's vertical position from the previous game update. - * + * * This value is set during the `postUpdate` phase and takes into account the * `deltaMax` and final position of the Body. - * + * * Because this value is not calculated until `postUpdate`, you must listen for it * during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will * not be calculated by that point. If you _do_ use these values in `update` they @@ -105863,7 +107231,7 @@ declare namespace Phaser { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce and `onWorldBounds` values. * @param value `true` if the Body should collide with the world bounds, otherwise `false`. Default true. * @param bounceX If given this replaces the Body's `worldBounce.x` value. @@ -105926,18 +107294,18 @@ declare namespace Phaser { /** * Sets the Slide Factor of this Body. - * + * * The Slide Factor controls how much velocity is preserved when * this Body is pushed by another Body. - * + * * The default value is 1, which means that it will take on all * velocity given in the push. You can adjust this value to control * how much velocity is retained by this Body when the push ends. - * + * * A value of 0, for example, will allow this Body to be pushed * but then remain completely still after the push ends, such as * you see in a game like Sokoban. - * + * * Or you can set a mid-point, such as 0.25 which will allow it * to keep 25% of the original velocity when the push ends. You * can combine this with the `setDrag()` method to create deceleration. @@ -106026,7 +107394,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. @@ -106188,9 +107556,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -106226,10 +107594,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -106258,7 +107626,7 @@ declare namespace Phaser { */ class Collider { /** - * + * * @param world The Arcade physics World that will manage the collisions. * @param overlapOnly Whether to check for collisions or overlaps. * @param object1 The first object to check for collision. @@ -106316,7 +107684,7 @@ declare namespace Phaser { /** * A name for the Collider. - * + * * Phaser does not use this value, it's for your own reference. * @param name The name to assign to the Collider. * @returns This Collider instance. @@ -106341,7 +107709,7 @@ declare namespace Phaser { */ class Factory { /** - * + * * @param world The Arcade Physics World instance. */ constructor(world: Phaser.Physics.Arcade.World); @@ -106451,7 +107819,7 @@ declare namespace Phaser { /** * Creates a new physics Body with the given position and size. - * + * * This Body is not associated with any Game Object, but still exists within the world * and can be tested for collision, have velocity, etc. * @param x The horizontal position of this Body in the physics world. @@ -106464,7 +107832,7 @@ declare namespace Phaser { /** * Creates a new static physics Body with the given position and size. - * + * * This Body is not associated with any Game Object, but still exists within the world * and can be tested for collision, etc. * @param x The horizontal position of this Body in the physics world. @@ -106519,20 +107887,20 @@ declare namespace Phaser { * The primary use of a Physics Group is a way to collect together physics-enabled objects * that share the same intrinsic structure into a single pool. They can then be easily * compared against other Groups, or Game Objects. - * + * * All Game Objects created by, or added to this Group will automatically be given **dynamic** * Arcade Physics bodies (if they have no body already) and the bodies will receive the * Groups {@link Phaser.Physics.Arcade.Group#defaults default values}. - * + * * You should not pass objects into this Group that should not receive a body. For example, * do not add basic Geometry or Tilemap Layers into a Group, as they will not behave in the * way you may expect. Groups should all ideally have objects of the same type in them. - * + * * If you wish to create a Group filled with Static Bodies, please see {@link Phaser.Physics.Arcade.StaticGroup}. */ class Group extends Phaser.GameObjects.Group implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The physics simulation. * @param scene The scene this group belongs to. * @param children Game Objects to add to this group; or the `config` argument. @@ -106547,7 +107915,7 @@ declare namespace Phaser { /** * The class to create new Group members from. - * + * * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. * * The constructor arguments must match `(scene, x, y, texture, frame)`. @@ -106561,23 +107929,23 @@ declare namespace Phaser { /** * The Arcade Physics Group Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Group Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; /** * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. - * + * * You can remove the default values by setting this property to `{}`. */ defaults: Phaser.Types.Physics.Arcade.PhysicsGroupDefaults; @@ -106628,9 +107996,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -106666,10 +108034,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -106691,7 +108059,7 @@ declare namespace Phaser { /** * Separates two overlapping bodies on the X-axis (horizontally). - * + * * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. * * The bodies won't be separated if there is no horizontal overlap between them, if both are immovable, or if either one uses custom separation logic via `customSeparateX`. @@ -106706,9 +108074,9 @@ declare namespace Phaser { /** * Separates two overlapping bodies on the Y-axis (vertically). - * + * * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. - * + * * The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation. * @param body1 The first Body to separate. * @param body2 The second Body to separate. @@ -106735,10 +108103,10 @@ declare namespace Phaser { /** * A Static Arcade Physics Body. - * + * * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Static Body manually. - * + * * A Static Body can collide with other Bodies, but is never moved by collisions. * * Static Bodies are ideal for platforms, walls, floors, and other immovable environmental @@ -106749,7 +108117,7 @@ declare namespace Phaser { */ class StaticBody implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The Arcade Physics simulation this Static Body belongs to. * @param gameObject The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ @@ -106762,7 +108130,7 @@ declare namespace Phaser { /** * The Game Object this Static Body belongs to. - * + * * As of Phaser 3.60 this is now optional and can be undefined. */ gameObject: Phaser.GameObjects.GameObject; @@ -106800,7 +108168,7 @@ declare namespace Phaser { /** * The offset set by {@link Phaser.Physics.Arcade.StaticBody#setCircle} or {@link Phaser.Physics.Arcade.StaticBody#setSize}. - * + * * This doesn't affect the Static Body's position, because a Static Body does not follow its Game Object. */ readonly offset: Phaser.Math.Vector2; @@ -106888,7 +108256,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -106966,25 +108334,25 @@ declare namespace Phaser { /** * The Arcade Physics Body Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Body Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; /** * Changes the Game Object this Body is bound to. - * + * * First it removes its reference from the old Game Object, then sets the new one. - * + * * This body will be resized to match the frame dimensions of the given Game Object, if it has a texture frame. * You can optionally update the position and dimensions of this Body to reflect that of the new Game Object. * @param gameObject The Game Object to assign this Body to. @@ -107035,7 +108403,7 @@ declare namespace Phaser { /** * Resets this Static Body to its parent Game Object's position. - * + * * If `x` and `y` are given, the parent Game Object is placed there and this Static Body is centered on it. * Otherwise this Static Body is centered on the Game Object's current position. * @param x The x coordinate to reset the body to. If not given will use the parent Game Object's coordinate. @@ -107156,9 +108524,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -107194,10 +108562,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -107233,7 +108601,7 @@ declare namespace Phaser { */ class StaticGroup extends Phaser.GameObjects.Group implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The physics simulation. * @param scene The scene this group belongs to. * @param children Game Objects to add to this group; or the `config` argument. @@ -107253,16 +108621,16 @@ declare namespace Phaser { /** * The Arcade Physics Static Group Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Static Group Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; @@ -107304,9 +108672,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -107342,10 +108710,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -107367,9 +108735,9 @@ declare namespace Phaser { /** * The Arcade Physics World. - * + * * The World is responsible for creating, managing, colliding and updating all of the bodies within it. - * + * * An instance of the World belongs to a Phaser.Scene and is accessed via the property `physics.world`. * * It uses an RTree spatial index for fast broad-phase collision detection and supports @@ -107378,7 +108746,7 @@ declare namespace Phaser { */ class World extends Phaser.Events.EventEmitter { /** - * + * * @param scene The Scene to which this World instance belongs. * @param config An Arcade Physics Configuration object. */ @@ -107426,7 +108794,7 @@ declare namespace Phaser { /** * The number of physics steps to be taken per second. - * + * * This property is read-only. Use the `setFPS` method to modify it at run-time. */ readonly fps: number; @@ -107444,7 +108812,7 @@ declare namespace Phaser { /** * Scaling factor applied to the frame rate. - * + * * - 1.0 = normal speed * - 2.0 = half speed * - 0.5 = double speed @@ -107494,7 +108862,7 @@ declare namespace Phaser { /** * The maximum number of items per node on the RTree. - * + * * This is ignored if `useTree` is `false`. If you have a large number of bodies in * your world then you may find search performance improves by increasing this value, * to allow more items per node and less node division. @@ -107503,17 +108871,17 @@ declare namespace Phaser { /** * Should this Arcade Physics World use an RTree for Dynamic bodies? - * + * * An RTree is a fast way of spatially sorting of all the bodies in the world. * However, at certain limits, the cost of clearing and inserting the bodies into the * tree every frame becomes more expensive than the search speed gains it provides. - * + * * If you have a large number of dynamic bodies in your world then it may be best to * disable the use of the RTree by setting this property to `false` in the physics config. - * + * * The number it can cope with depends on browser and device, but a conservative estimate * of around 5,000 bodies should be considered the max before disabling it. - * + * * This only applies to dynamic bodies. Static bodies are always kept in an RTree, * because they don't have to be cleared every frame, so you benefit from the * massive search speeds all the time. @@ -107542,23 +108910,23 @@ declare namespace Phaser { /** * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `enableBody` method is that you can pass arrays or Groups * to this method. - * + * * You can specify if the bodies are to be Dynamic or Static. A dynamic body can move via velocity and * acceleration. A static body remains fixed in place and as such is able to use an optimized search * tree, making it ideal for static elements such as level objects. You can still collide and overlap * with static bodies. - * + * * Normally, rather than calling this method directly, you'd use the helper methods available in the * Arcade Physics Factory, such as: - * + * * ```javascript * this.physics.add.image(x, y, textureKey); * this.physics.add.sprite(x, y, textureKey); * ``` - * + * * Calling factory methods encapsulates the creation of a Game Object and the creation of its * body at the same time. If you are creating custom classes then you can pass them to this * method to have their bodies created. @@ -107569,22 +108937,22 @@ declare namespace Phaser { /** * Creates an Arcade Physics Body on a single Game Object. - * + * * If the Game Object already has a body, this method will simply add it back into the simulation. - * + * * You can specify if the body is Dynamic or Static. A dynamic body can move via velocity and * acceleration. A static body remains fixed in place and as such is able to use an optimized search * tree, making it ideal for static elements such as level objects. You can still collide and overlap * with static bodies. - * + * * Normally, rather than calling this method directly, you'd use the helper methods available in the * Arcade Physics Factory, such as: - * + * * ```javascript * this.physics.add.image(x, y, textureKey); * this.physics.add.sprite(x, y, textureKey); * ``` - * + * * Calling factory methods encapsulates the creation of a Game Object and the creation of its * body at the same time. If you are creating custom classes then you can pass them to this * method to have their bodies created. @@ -107596,7 +108964,7 @@ declare namespace Phaser { /** * Adds an existing Arcade Physics Body or StaticBody to the simulation. - * + * * The body is enabled and added to the local search trees. * @param body The Body to be added to the simulation. * @returns The Body that was added to the simulation. @@ -107605,10 +108973,10 @@ declare namespace Phaser { /** * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `disableBody` method is that you can pass arrays or Groups * to this method. - * + * * The body itself is not deleted, it just has its `enable` property set to false, which * means you can re-enable it again at any point by passing it to `World.enable` or `World.add`. * @param object The object, or objects, on which to disable the bodies. @@ -107617,9 +108985,9 @@ declare namespace Phaser { /** * Disables an existing Arcade Physics Body or StaticBody and removes it from the simulation. - * + * * The body is disabled and removed from the local search trees. - * + * * The body itself is not deleted, it just has its `enable` property set to false, which * means you can re-enable it again at any point by passing it to `World.enable` or `World.add`. * @param body The Body to be disabled. @@ -107628,9 +108996,9 @@ declare namespace Phaser { /** * Removes an existing Arcade Physics Body or StaticBody from the simulation. - * + * * The body is disabled and removed from the local search trees. - * + * * The body itself is not deleted, it just has its `enabled` property set to false, which * means you can re-enable it again at any point by passing it to `World.enable` or `World.add`. * @param body The body to be removed from the simulation. @@ -107639,11 +109007,11 @@ declare namespace Phaser { /** * Creates a Graphics Game Object that the world will use to render the debug display to. - * + * * This is called automatically when the World is instantiated if the `debug` config property * was set to `true`. However, you can call it at any point should you need to display the * debug Graphic from a fixed point. - * + * * You can control which objects are drawn to the Graphics object, and the colors they use, * by setting the debug properties in the physics config. * @@ -107654,7 +109022,7 @@ declare namespace Phaser { /** * Sets the position, size and properties of the World boundary. - * + * * The World boundary is an invisible rectangle that defines the edges of the World. * If a Body is set to collide with the world bounds then it will automatically stop * when it reaches any of the edges. You can optionally set which edges of the boundary @@ -107683,9 +109051,9 @@ declare namespace Phaser { /** * Pauses the simulation. - * + * * A paused simulation does not update any existing bodies, or run any Colliders. - * + * * However, you can still enable and disable bodies within it, or manually run collide or overlap * checks.undefined * @returns This World object. @@ -107700,10 +109068,10 @@ declare namespace Phaser { /** * Creates a new Collider object and adds it to the simulation. - * + * * A Collider is a way to automatically perform collision checks between two objects, * calling the collide and process callbacks if they occur. - * + * * Colliders are run as part of the World update, after all of the Bodies have updated. * * By creating a Collider you don't need to then call `World.collide` in your `update` loop, @@ -107719,10 +109087,10 @@ declare namespace Phaser { /** * Creates a new Overlap Collider object and adds it to the simulation. - * + * * A Collider is a way to automatically perform overlap checks between two objects, * calling the collide and process callbacks if they occur. - * + * * Colliders are run as part of the World update, after all of the Bodies have updated. * * By creating a Collider you don't need to then call `World.overlap` in your `update` loop, @@ -107738,10 +109106,10 @@ declare namespace Phaser { /** * Removes a Collider from the simulation so it is no longer processed. - * + * * This method does not destroy the Collider. If you wish to add it back at a later stage you can call * `World.colliders.add(Collider)`. - * + * * If you no longer need the Collider you can call the `Collider.destroy` method instead, which will * automatically clear all of its references and then remove it from the World. If you call destroy on * a Collider you _don't_ need to pass it to this method too. @@ -107752,14 +109120,14 @@ declare namespace Phaser { /** * Sets the frame rate to run the simulation at. - * + * * The frame rate value is used to simulate a fixed update time step. This fixed * time step allows for a straightforward implementation of a deterministic game state. - * + * * This frame rate is independent of the frequency at which the game is rendering. The * higher you set the fps, the more physics simulation steps will occur per game step. * Conversely, the lower you set it, the less will take place. - * + * * You can optionally advance the simulation directly yourself by calling the `step` method. * @param framerate The frame rate to advance the simulation at. * @returns This World object. @@ -107768,7 +109136,7 @@ declare namespace Phaser { /** * Advances the simulation based on the elapsed time and fps rate. - * + * * This is called automatically by your Scene and does not need to be invoked directly. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. @@ -107850,7 +109218,7 @@ declare namespace Phaser { /** * Tests if Game Objects overlap. - * + * * See details in {@link Phaser.Physics.Arcade.World#collide}. * @param object1 The first object or array of objects to check. * @param object2 The second object or array of objects to check, or `undefined`. @@ -107864,19 +109232,19 @@ declare namespace Phaser { /** * Performs a collision check and separation between the two physics enabled objects given, which can be single * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. - * + * * If you don't require separation then use {@link Phaser.Physics.Arcade.World#overlap} instead. - * + * * If two Groups or arrays are passed, each member of one will be tested against each member of the other. - * + * * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. - * + * * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. - * + * * Two callbacks can be provided; they receive the colliding game objects as arguments. * If an overlap is detected, the `processCallback` is called first. It can cancel the collision by returning false. * Next the objects are separated and `collideCallback` is invoked. - * + * * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. * The separation that stops two objects penetrating may create a new penetration against a different object. If you @@ -107901,20 +109269,20 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. - * + * * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for collision with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, * you should filter them before passing them to this method. - * + * * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on * dynamic maps, this method can prove very useful. - * + * * This method does not factor in the Collision Mask or Category. * @param sprite The first object to check for collision. * @param tiles An array of Tiles to check for collision against. @@ -107927,15 +109295,15 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. - * + * * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, * you should filter them before passing them to this method. - * + * * This method does not factor in the Collision Mask or Category. * @param sprite The first object to check for collision. * @param tiles An array of Tiles to check for collision against. @@ -107961,7 +109329,7 @@ declare namespace Phaser { /** * Wrap an object's coordinates (or several objects' coordinates) within {@link Phaser.Physics.Arcade.World#bounds}. - * + * * If the object is outside any boundary edge (left, top, right, bottom), it will be moved to the same offset from the opposite edge (the interior). * @param object A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. * @param padding An amount added to each boundary edge during the operation. Default 0. @@ -108810,13 +110178,13 @@ declare namespace Phaser { * The Body Bounds class contains methods to help you extract the world coordinates from various points around * the bounds of a Matter Body. Because Matter bodies are positioned based on their center of mass, and not a * dimension based center, you often need to get the bounds coordinates in order to properly align them in the world. - * + * * You can access this class via the MatterPhysics class from a Scene, i.e.: - * + * * ```javascript * this.matter.bodyBounds.getTopLeft(body); * ``` - * + * * See also the `MatterPhysics.alignBody` method. */ class BodyBounds { @@ -108832,9 +110200,9 @@ declare namespace Phaser { /** * Parses the given body to get the bounds diff values from it. - * + * * They're stored in this class in the temporary properties `boundsCenter` and `centerDiff`. - * + * * This method is called automatically by all other methods in this class. * @param body The Body to get the bounds position from. * @returns `true` if it was able to get the bounds, otherwise `false`. @@ -108843,7 +110211,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the top-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108855,7 +110223,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the top-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108867,7 +110235,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the top-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108879,7 +110247,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the left-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108891,7 +110259,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108903,7 +110271,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the right-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108915,7 +110283,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the bottom-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108927,7 +110295,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the bottom-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -108939,7 +110307,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the bottom-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -114806,7 +116174,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked when this Game Object's Matter Body begins colliding with another body. * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param callback The callback to invoke when this body starts colliding with another. @@ -114816,7 +116184,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked when this Game Object's Matter Body stops colliding with another body. * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param callback The callback to invoke when this body stops colliding with another. @@ -114826,7 +116194,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked each step while this Game Object's Matter Body is actively colliding with another body. * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param callback The callback to invoke for the duration of this body colliding with another. @@ -114836,7 +116204,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked when this Game Object's Matter Body collides with a specific body or bodies. * The callback is sent a reference to the other body, along with a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param body The body, or an array of bodies, to test for collisions with. @@ -115047,7 +116415,7 @@ declare namespace Phaser { setTrapezoid(width: number, height: number, slope: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): this; /** * Set this Game Object to use the given existing Matter Body. - * + * * The body is first removed from the world before being added to this Game Object. * @param body The Body this Game Object should use. * @param addToWorld Should the body be immediately added to the World? Default true. @@ -115096,9 +116464,9 @@ declare namespace Phaser { setSleepThreshold(value?: number): this; /** * Enable sleep and wake events for this body. - * + * * By default when a body goes to sleep, or wakes up, it will not emit any events. - * + * * The events are emitted by the Matter World instance and can be listened to via * the `SLEEP_START` and `SLEEP_END` events. * @param start `true` if you want the sleep start event to be emitted for this body. @@ -115155,7 +116523,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -115294,10 +116662,10 @@ declare namespace Phaser { /** * The Matter Physics After Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the end of the process when a new Body * or Constraint has just been added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`. */ const AFTER_ADD: string; @@ -115319,10 +116687,10 @@ declare namespace Phaser { /** * The Matter Physics After Remove Event. - * + * * This event is dispatched by a Matter Physics World instance at the end of the process when a * Body or Constraint was removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`. */ const AFTER_REMOVE: string; @@ -115344,9 +116712,9 @@ declare namespace Phaser { /** * The Matter Physics After Update Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. */ const AFTER_UPDATE: string; @@ -115368,10 +116736,10 @@ declare namespace Phaser { /** * The Matter Physics Before Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the start of the process when a new Body * or Constraint is being added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`. */ const BEFORE_ADD: string; @@ -115393,10 +116761,10 @@ declare namespace Phaser { /** * The Matter Physics Before Remove Event. - * + * * This event is dispatched by a Matter Physics World instance at the start of the process when a * Body or Constraint is being removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`. */ const BEFORE_REMOVE: string; @@ -115418,9 +116786,9 @@ declare namespace Phaser { /** * The Matter Physics Before Update Event. - * + * * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. */ const BEFORE_UPDATE: string; @@ -115446,10 +116814,10 @@ declare namespace Phaser { /** * The Matter Physics Collision Active Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that are colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. */ const COLLISION_ACTIVE: string; @@ -115475,10 +116843,10 @@ declare namespace Phaser { /** * The Matter Physics Collision End Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have finished colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. */ const COLLISION_END: string; @@ -115504,58 +116872,58 @@ declare namespace Phaser { /** * The Matter Physics Collision Start Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have started to collide in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. */ const COLLISION_START: string; /** * The Matter Physics Drag End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * stops dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. */ const DRAG_END: string; /** * The Matter Physics Drag Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * is actively dragging a body. It is emitted each time the pointer moves. - * + * * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. */ const DRAG: string; /** * The Matter Physics Drag Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * starts dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. */ const DRAG_START: string; /** * The Matter Physics World Pause Event. - * + * * This event is dispatched by an Matter Physics World instance when it is paused. - * + * * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. */ const PAUSE: string; /** * The Matter Physics World Resume Event. - * + * * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. - * + * * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. */ const RESUME: string; @@ -115573,9 +116941,9 @@ declare namespace Phaser { /** * The Matter Physics Sleep End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. */ const SLEEP_END: string; @@ -115593,9 +116961,9 @@ declare namespace Phaser { /** * The Matter Physics Sleep Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. */ const SLEEP_START: string; @@ -115618,7 +116986,7 @@ declare namespace Phaser { */ class BasePlugin { /** - * + * * @param pluginManager A reference to the Plugin Manager. */ constructor(pluginManager: Phaser.Plugins.PluginManager); @@ -115699,20 +117067,20 @@ declare namespace Phaser { /** * These are the core plugins that are installed into every Scene.Systems instance, no matter what. * They are optionally exposed in the Scene as well (see the InjectionMap for details) - * + * * They are created in the order in which they appear in this array and EventEmitter is always first. */ var CoreScene: any[]; /** * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. - * + * * You can elect not to have these plugins by either creating a DefaultPlugins object as part * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array * and building your own bundle. - * + * * They are optionally exposed in the Scene as well (see the InjectionMap for details) - * + * * They are always created in the order in which they appear in the array. */ var DefaultScene: any[]; @@ -115791,7 +117159,7 @@ declare namespace Phaser { /** * Removes all Core Plugins. - * + * * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. * So be sure you only call this if you do not wish to run Phaser again. */ @@ -115809,40 +117177,40 @@ declare namespace Phaser { /** * The PluginManager is responsible for installing and adding plugins to Phaser. - * + * * It is a global system and therefore belongs to the Game instance, not a specific Scene. - * + * * It works in conjunction with the PluginCache. Core internal plugins automatically register themselves * with the Cache, but it's the Plugin Manager that is responsible for injecting them into the Scenes. - * + * * There are two types of plugin: - * + * * 1. A Global Plugin * 2. A Scene Plugin - * + * * A Global Plugin is a plugin that lives within the Plugin Manager rather than a Scene. You can get * access to it by calling `PluginManager.get` and providing a key. Any Scene that requests a plugin in * this way will get access to the same plugin instance, allowing you to use a single plugin across * multiple Scenes. - * + * * A Scene Plugin is a plugin dedicated to running within a Scene. These are different to Global Plugins * in that their instances do not live within the Plugin Manager, but within the Scene Systems class instead. * Also, every Scene created is given its own unique instance of a Scene Plugin. Examples of core Scene * Plugins include the Input Plugin, the Tween Plugin and the physics Plugins. - * + * * You can add a plugin to Phaser in three different ways: - * + * * 1. Preload it * 2. Include it in your source code and install it via the Game Config * 3. Include it in your source code and install it within a Scene - * + * * For examples of all of these approaches please see the Phaser 3 Examples Repo `plugins` folder. - * + * * For information on creating your own plugin please see the Phaser 3 Plugin Template. */ class PluginManager { /** - * + * * @param game The game instance that owns this Plugin Manager. */ constructor(game: Phaser.Game); @@ -115870,7 +117238,7 @@ declare namespace Phaser { /** * Called by the Scene Systems class. Tells the plugin manager to install all Scene plugins into it. - * + * * First it will install global references, i.e. references from the Game systems into the Scene Systems (and Scene if mapped.) * Then it will install Core Scene Plugins followed by Scene Plugins registered with the PluginManager. * Finally it will install any references to Global Plugins that have a Scene mapping property into the Scene itself. @@ -115890,19 +117258,19 @@ declare namespace Phaser { * Installs a new Scene Plugin into the Plugin Manager and optionally adds it * to the given Scene as well. A Scene Plugin added to the manager in this way * will be automatically installed into all new Scenes using the key and mapping given. - * + * * The `key` property is what the plugin is injected into Scene.Systems as. * The `mapping` property is optional, and if specified is what the plugin is installed into * the Scene as. For example: - * + * * ```javascript * this.plugins.installScenePlugin('powerupsPlugin', pluginCode, 'powerups'); - * + * * // and from within the scene: * this.sys.powerupsPlugin; // key value * this.powerups; // mapping value * ``` - * + * * This method is called automatically by Phaser if you install your plugins using either the * Game Configuration object, or by preloading them via the Loader. * @param key The property key that will be used to add this plugin to Scene.Systems. @@ -115917,19 +117285,19 @@ declare namespace Phaser { * Installs a new Global Plugin into the Plugin Manager and optionally starts it running. * A global plugin belongs to the Plugin Manager, rather than a specific Scene, and can be accessed * and used by all Scenes in your game. - * + * * The `key` property is what you use to access this plugin from the Plugin Manager. - * + * * ```javascript * this.plugins.install('powerupsPlugin', pluginCode); - * + * * // and from within the scene: * this.plugins.get('powerupsPlugin'); * ``` - * + * * This method is called automatically by Phaser if you install your plugins using either the * Game Configuration object, or by preloading them via the Loader. - * + * * The same plugin can be installed multiple times into the Plugin Manager by simply giving each * instance its own unique key. * @param key The unique handle given to this plugin within the Plugin Manager. @@ -115964,13 +117332,13 @@ declare namespace Phaser { /** * Starts a global plugin running. - * + * * If the plugin was previously active then calling `start` will reset it to an active state and then * call its `start` method. - * + * * If the plugin has never been run before a new instance of it will be created within the Plugin Manager, * its active state set and then both of its `init` and `start` methods called, in that order. - * + * * If the plugin is already running under the given key then nothing happens. * @param key The key of the plugin to start. * @param runAs Run the plugin under a new key. This allows you to run one plugin multiple times. @@ -115980,10 +117348,10 @@ declare namespace Phaser { /** * Stops a global plugin from running. - * + * * If the plugin is active then its active state will be set to false and the plugins `stop` method * will be called. - * + * * If the plugin is not already running, nothing will happen. * @param key The key of the plugin to stop. * @returns The Plugin Manager. @@ -115992,7 +117360,7 @@ declare namespace Phaser { /** * Gets a global plugin from the Plugin Manager based on the given key and returns it. - * + * * If it cannot find an active plugin based on the key, but there is one in the Plugin Cache with the same key, * then it will create a new instance of the cached plugin and return that. * @param key The key of the plugin to get. @@ -116011,7 +117379,7 @@ declare namespace Phaser { /** * Removes a global plugin from the Plugin Manager and Plugin Cache. - * + * * It is up to you to remove all references to this plugin that you may hold within your game code. * @param key The key of the plugin to remove. */ @@ -116019,9 +117387,9 @@ declare namespace Phaser { /** * Removes a scene plugin from the Plugin Manager and Plugin Cache. - * + * * This will not remove the plugin from any active Scenes that are already using it. - * + * * It is up to you to remove all references to this plugin that you may hold within your game code. * @param key The key of the plugin to remove. */ @@ -116031,26 +117399,26 @@ declare namespace Phaser { * Registers a new type of Game Object with the global Game Object Factory and / or Creator. * This is usually called from within your Plugin code and is a helpful short-cut for creating * new Game Objects. - * + * * The key is the property that will be injected into the factories and used to create the * Game Object. For example: - * + * * ```javascript * this.plugins.registerGameObject('clown', clownFactoryCallback, clownCreatorCallback); * // later in your game code: * this.add.clown(); * this.make.clown(); * ``` - * + * * The callbacks are what are called when the factories try to create a Game Object * matching the given key. It's important to understand that the callbacks are invoked within * the context of the GameObjectFactory. In this context there are several properties available * to use: - * + * * this.scene - A reference to the Scene that owns the GameObjectFactory. * this.displayList - A reference to the Display List the Scene owns. * this.updateList - A reference to the Update List the Scene owns. - * + * * See the GameObjectFactory and GameObjectCreator classes for more details. * Any public property or method listed is available from your callbacks under `this`. * @param key The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. @@ -116071,13 +117439,13 @@ declare namespace Phaser { /** * Registers a new file type with the global File Types Manager, making it available to all Loader * Plugins created after this. - * + * * This is usually called from within your Plugin code and is a helpful short-cut for creating * new loader file types. - * + * * The key is the property that will be injected into the Loader Plugin and used to load the * files. For example: - * + * * ```javascript * this.plugins.registerFileType('wad', doomWadLoaderCallback); * // later in your preload code: @@ -116088,10 +117456,10 @@ declare namespace Phaser { * It's important to understand that the callback is invoked within * the context of the LoaderPlugin. In this context there are several properties / methods available * to use: - * + * * this.addFile - A method to add the new file to the load queue. * this.scene - The Scene that owns the Loader Plugin instance. - * + * * See the LoaderPlugin class for more details. Any public property or method listed is available from * your callback under `this`. * @param key The key of the file type to register with the Loader Plugin, i.e. `wad`, `atlas`. @@ -116103,7 +117471,7 @@ declare namespace Phaser { /** * Destroys this Plugin Manager and all associated plugins. * It will iterate all plugins found and call their `destroy` methods. - * + * * The PluginCache will remove all custom plugins. */ destroy(): void; @@ -116124,7 +117492,7 @@ declare namespace Phaser { */ class ScenePlugin extends Phaser.Plugins.BasePlugin { /** - * + * * @param scene A reference to the Scene that has installed this plugin. * @param pluginManager A reference to the Plugin Manager. * @param pluginKey The key under which this plugin has been installed into the Scene Systems. @@ -116149,7 +117517,7 @@ declare namespace Phaser { /** * The key under which this plugin was installed into the Scene Systems. - * + * * This property is only set when the plugin is instantiated and added to the Scene, not before. * You can use it during the `boot` method. */ @@ -116157,12 +117525,12 @@ declare namespace Phaser { /** * This method is called when the Scene boots. It is only ever called once. - * + * * By this point the plugin properties `scene` and `systems` will have already been set. - * + * * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. * Here are the Scene events you can listen to: - * + * * - start * - ready * - preupdate @@ -116179,9 +117547,9 @@ declare namespace Phaser { * - transitionout * - shutdown * - destroy - * + * * At the very least you should offer a destroy handler for when the Scene closes down, i.e: - * + * * ```javascript * var eventEmitter = this.systems.events; * eventEmitter.once('destroy', this.sceneDestroy, this); @@ -116418,7 +117786,7 @@ declare namespace Phaser { */ class CanvasRenderer extends Phaser.Events.EventEmitter { /** - * + * * @param game The Phaser Game instance that owns this renderer. */ constructor(game: Phaser.Game); @@ -116475,14 +117843,14 @@ declare namespace Phaser { /** * The blend modes supported by the Canvas Renderer. - * + * * This object maps the {@link Phaser.BlendModes} to canvas compositing operations. */ blendModes: any[]; /** * Details about the currently scheduled snapshot. - * + * * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. */ snapshotState: Phaser.Types.Renderer.Snapshot.SnapshotState; @@ -116554,12 +117922,12 @@ declare namespace Phaser { /** * The core render step for a Scene Camera. - * + * * Iterates through the given array of Game Objects and renders them with the given Camera. - * + * * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked * by the Scene Systems.render method. - * + * * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * @param scene The Scene to render. * @param children An array of filtered Game Objects that can be rendered by the given Camera. @@ -116569,16 +117937,16 @@ declare namespace Phaser { /** * Restores the game context's global settings and takes a snapshot if one is scheduled. - * + * * The post-render step happens after all Cameras in all Scenes have been rendered. */ postRender(): void; /** * Takes a snapshot of the given area of the given canvas. - * + * * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. - * + * * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. * @param canvas The canvas to grab from. @@ -116596,12 +117964,12 @@ declare namespace Phaser { /** * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. - * + * * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. - * + * * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then * calling this method will override it. - * + * * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. * @param callback The Function to invoke after the snapshot image is created. @@ -116613,12 +117981,12 @@ declare namespace Phaser { /** * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. - * + * * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. - * + * * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then * calling this method will override it. - * + * * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. * @param x The x coordinate to grab from. @@ -116634,12 +118002,12 @@ declare namespace Phaser { /** * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. - * + * * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. - * + * * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then * calling this method will override it. - * + * * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, * using less memory. @@ -116678,7 +118046,7 @@ declare namespace Phaser { /** * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix * and then performs the following steps: - * + * * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. * 3. Sets the blend mode of the context to be that used by the Game Object. @@ -116687,7 +118055,7 @@ declare namespace Phaser { * 6. Sets the final matrix values into the context via setTransform. * 7. If the Game Object has a texture frame, imageSmoothingEnabled is set based on frame.source.scaleMode. * 8. If the Game Object does not have a texture frame, imageSmoothingEnabled is set based on Renderer.antialias. - * + * * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. * @param renderer A reference to the current active Canvas renderer. * @param ctx The canvas context to set the transform on. @@ -116703,17 +118071,17 @@ declare namespace Phaser { namespace Events { /** * The Lose WebGL Event. - * + * * This event is dispatched by the WebGLRenderer when the WebGL context * is lost. - * + * * Context can be lost for a variety of reasons, like leaving the browser tab. * The game canvas DOM object will dispatch `webglcontextlost`. * All WebGL resources get wiped, and the context is reset. - * + * * While WebGL is lost, the game will continue to run, but all WebGL resources * are lost, and new ones cannot be created. - * + * * Once the context is restored and the renderer has automatically restored * the state, the renderer will emit a `RESTORE_WEBGL` event. At that point, * it is safe to continue. @@ -116722,7 +118090,7 @@ declare namespace Phaser { /** * The Post-Render Event. - * + * * This event is dispatched by the Renderer when all rendering, for all cameras in all Scenes, * has completed, but before any pending snapshots have been taken. */ @@ -116730,16 +118098,16 @@ declare namespace Phaser { /** * The Pre-Render Clear Event. - * + * * This event is dispatched by the Phaser Renderer. It happens at the start of the render step, before * the WebGL gl.clear function has been called. This allows you to toggle the `config.clearBeforeRender` property * as required, to have fine-grained control over when the canvas is cleared during rendering. - * + * * Listen to it from within a Scene using: `this.renderer.events.on('prerenderclear', listener)`. - * + * * It's very important to understand that this event is called _before_ the scissor and mask stacks are cleared. * This means you should not use this event to modify the scissor or mask. Instead, use the `prerender` event for that. - * + * * If using the Canvas Renderer, this event is dispatched before the canvas is cleared, but after the context globalAlpha * and transform have been reset. */ @@ -116747,7 +118115,7 @@ declare namespace Phaser { /** * The Pre-Render Event. - * + * * This event is dispatched by the Phaser Renderer. This happens right at the start of the render * process, after the context has been cleared, the scissors enabled (WebGL only) and everything has been * reset ready for the render. @@ -116756,16 +118124,16 @@ declare namespace Phaser { /** * The Render Event. - * + * * This event is dispatched by the Phaser Renderer for every camera in every Scene. - * + * * It is dispatched before any of the children in the Scene have been rendered. */ const RENDER: string; /** * The Renderer Resize Event. - * + * * This event is dispatched by the Phaser Renderer when it is resized, usually as a result * of the Scale Manager resizing. */ @@ -116773,19 +118141,19 @@ declare namespace Phaser { /** * The Restore WebGL Event. - * + * * This event is dispatched by the WebGLRenderer when the WebGL context * is restored. - * + * * It is dispatched after all WebGL resources have been recreated. * Most resources should come back automatically, but you will need to redraw * dynamic textures that were GPU bound. * Listen to this event to know when you can safely do that. - * + * * Context can be lost for a variety of reasons, like leaving the browser tab. * The game canvas DOM object will dispatch `webglcontextlost`. * All WebGL resources get wiped, and the context is reset. - * + * * Once the context is restored, the canvas will dispatch * `webglcontextrestored`. Phaser uses this to re-create necessary resources. * Please wait for Phaser to dispatch the `RESTORE_WEBGL` event before @@ -117104,7 +118472,7 @@ declare namespace Phaser { /** * The renderer that owns this DrawingContextPool. */ - renderer: Phaser.Renderer.WebGL.WebGLRenderer; + const LIGHT_PIPELINE: string; /** * The maximum age of a DrawingContext in milliseconds. @@ -122044,7 +123412,7 @@ declare namespace Phaser { /** * Wrapper for a WebGL buffer, containing all the information that was used * to create it. This can be a VertexBuffer or IndexBuffer. - * + * * A WebGLBuffer should never be exposed outside the WebGLRenderer, so the * WebGLRenderer can handle context loss and other events without other * systems having to be aware of it. Always use WebGLBufferWrapper instead. @@ -122066,7 +123434,7 @@ declare namespace Phaser { /** * The WebGLBuffer being wrapped by this class. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -122124,7 +123492,7 @@ declare namespace Phaser { /** * Creates a WebGLBuffer for this WebGLBufferWrapper. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLBuffer needs re-creating. */ @@ -122165,7 +123533,7 @@ declare namespace Phaser { /** * Wrapper for a WebGL frame buffer, * containing all the information that was used to create it. - * + * * A WebGLFramebuffer should never be exposed outside the WebGLRenderer, * so the WebGLRenderer can handle context loss and other events * without other systems having to be aware of it. @@ -122186,7 +123554,7 @@ declare namespace Phaser { /** * The WebGLFramebuffer being wrapped by this class. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -122236,7 +123604,7 @@ declare namespace Phaser { /** * Creates a WebGLFramebuffer from the given parameters. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLFramebuffer needs re-creating. */ @@ -122553,7 +123921,7 @@ declare namespace Phaser { /** * The WebGLProgram being wrapped by this class. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -122624,7 +123992,7 @@ declare namespace Phaser { /** * Creates a WebGLProgram from the given vertex and fragment shaders. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLProgram needs re-creating. */ @@ -122784,7 +124152,7 @@ declare namespace Phaser { /** * Wrapper for a WebGL texture, containing all the information that was used * to create it. - * + * * A WebGLTexture should never be exposed outside the WebGLRenderer, * so the WebGLRenderer can handle context loss and other events * without other systems having to be aware of it. @@ -122816,7 +124184,7 @@ declare namespace Phaser { /** * The WebGLTexture that this wrapper is wrapping. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -122915,7 +124283,7 @@ declare namespace Phaser { /** * Creates a WebGLTexture from the given parameters. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLTexture needs re-creating. */ @@ -122941,7 +124309,7 @@ declare namespace Phaser { /** * Updates the WebGLTexture from an updated source. - * + * * This should only be used when the source is a Canvas or Video element. * * Because textures usually change into something complex and unique, @@ -123133,7 +124501,7 @@ declare namespace Phaser { namespace Scale { /** * The Scale Manager handles the scaling, resizing and alignment of the game canvas. - * + * * The way scaling is handled is by setting the game canvas to a fixed size, which is defined in the * game configuration. You also define the parent container in the game config. If no parent is given, * it will default to using the document body. The Scale Manager will then look at the available space @@ -123142,37 +124510,37 @@ declare namespace Phaser { * Scaling is therefore achieved by keeping the core canvas the same size and 'stretching' * it via its CSS properties. This gives the same result and speed as using the `transform-scale` CSS * property, without the need for browser prefix handling. - * + * * The calculations for the scale are heavily influenced by the bounding parent size, which is the computed * dimensions of the canvas's parent. The CSS rules of the parent element play an important role in the * operation of the Scale Manager. For example, if the parent has no defined width or height, then actions * like auto-centering will fail to achieve the required result. The Scale Manager works in tandem with the * CSS you set-up on the page hosting your game, rather than taking control of it. - * + * * #### Parent and Display canvas containment guidelines: - * + * * - Style the Parent element (of the game canvas) to control the Parent size and thus the games size and layout. - * + * * - The Parent element's CSS styles should _effectively_ apply maximum (and minimum) bounding behavior. - * + * * - The Parent element should _not_ apply a padding as this is not accounted for. * If a padding is required apply it to the Parent's parent or apply a margin to the Parent. * If you need to add a border, margin or any other CSS around your game container, then use a parent element and * apply the CSS to this instead, otherwise you'll be constantly resizing the shape of the game container. - * + * * - The Display canvas layout CSS styles (i.e. margins, size) should not be altered / specified as * they may be updated by the Scale Manager. - * + * * #### Scale Modes - * + * * The way the scaling is handled is determined by the `scaleMode` property. The default is `NONE`, * which prevents Phaser from scaling or touching the canvas, or its parent, at all. In this mode, you are * responsible for all scaling. The other scaling modes afford you automatic scaling. - * + * * If you wish to scale your game so that it always fits into the available space within the parent, you * should use the scale mode `FIT`. Look at the documentation for other scale modes to see what options are * available. Here is a basic config showing how to set this scale mode: - * + * * ```javascript * scale: { * parent: 'yourgamediv', @@ -123181,33 +124549,33 @@ declare namespace Phaser { * height: 600 * } * ``` - * + * * Place the `scale` config object within your game config. - * + * * If you wish for the canvas to be resized directly, so that the canvas itself fills the available space * (i.e. it isn't scaled, it's resized) then use the `RESIZE` scale mode. This will give you a 1:1 mapping * of canvas pixels to game size. In this mode CSS isn't used to scale the canvas, it's literally adjusted * to fill all available space within the parent. You should be extremely careful about the size of the * canvas you're creating when doing this, as the larger the area, the more work the GPU has to do and it's * very easy to hit fill-rate limits quickly. - * + * * For complex, custom-scaling requirements, you should probably consider using the `RESIZE` scale mode, * with your own limitations in place re: canvas dimensions and managing the scaling with the game scenes * yourself. For the vast majority of games, however, the `FIT` mode is likely to be the most used. - * + * * Please appreciate that the Scale Manager cannot perform miracles. All it does is scale your game canvas * as best it can, based on what it can infer from its surrounding area. There are all kinds of environments * where it's up to you to guide and help the canvas position itself, especially when built into rendering * frameworks like React and Vue. If your page requires meta tags to prevent user scaling gestures, or such * like, then it's up to you to ensure they are present in the html. - * + * * #### Centering - * + * * You can also have the game canvas automatically centered. Again, this relies heavily on the parent being * properly configured and styled, as the centering offsets are based entirely on the available space * within the parent element. Centering is disabled by default, or can be applied horizontally, vertically, * or both. Here's an example: - * + * * ```javascript * scale: { * parent: 'yourgamediv', @@ -123216,9 +124584,9 @@ declare namespace Phaser { * height: 600 * } * ``` - * + * * #### Fullscreen API - * + * * If the browser supports it, you can send your game into fullscreen mode. In this mode, the game will fill * the entire display, removing all browser UI and anything else present on the screen. It will remain in this * mode until your game either disables it, or until the user tabs out or presses ESCape if on desktop. It's a @@ -123227,7 +124595,7 @@ declare namespace Phaser { */ class ScaleManager extends Phaser.Events.EventEmitter { /** - * + * * @param game A reference to the Phaser.Game instance. */ constructor(game: Phaser.Game); @@ -123249,7 +124617,7 @@ declare namespace Phaser { /** * The parent object of the Canvas. Often a div, or the browser window, or nothing in non-browser environments. - * + * * This is set in the Game Config as the `parent` property. If undefined (or just not present), it will default * to use the document body. If specifically set to `null` Phaser will ignore all parent operations. */ @@ -123267,7 +124635,7 @@ declare namespace Phaser { /** * The Game Size component. - * + * * The un-modified game size, as requested in the game config (the raw width / height), * as used for world bounds, cameras, etc */ @@ -123275,7 +124643,7 @@ declare namespace Phaser { /** * The Base Size component. - * + * * The modified game size, which is the auto-rounded gameSize, used to set the canvas width and height * (but not the CSS style) */ @@ -123283,7 +124651,7 @@ declare namespace Phaser { /** * The Display Size component. - * + * * The size used for the canvas style, factoring in the scale mode, parent and other values. */ displaySize: Phaser.Structs.Size; @@ -123295,11 +124663,11 @@ declare namespace Phaser { /** * The game zoom factor. - * + * * This value allows you to multiply your games base size by the given zoom factor. * This is then used when calculating the display size, even in `NONE` situations. * If you don't want Phaser to touch the canvas style at all, this value should be 1. - * + * * Can also be set to `MAX_ZOOM` in which case the zoom value will be derived based * on the game size and available space within the parent. */ @@ -123324,12 +124692,12 @@ declare namespace Phaser { /** * Automatically center the canvas within the parent? The different centering modes are: - * + * * 1. No centering. * 2. Center both horizontally and vertically. * 3. Center horizontally. * 4. Center vertically. - * + * * Please be aware that in order to center the game canvas, you must have specified a parent * that has a size set, or the canvas parent is the document.body. */ @@ -123337,7 +124705,7 @@ declare namespace Phaser { /** * The current device orientation. - * + * * Orientation events are dispatched via the Device Orientation API, typically only on mobile browsers. */ orientation: Phaser.Scale.OrientationType; @@ -123360,7 +124728,7 @@ declare namespace Phaser { /** * How many milliseconds should elapse before checking if the browser size has changed? - * + * * Most modern browsers dispatch a 'resize' event, which the Scale Manager will listen for. * However, older browsers fail to do this, or do it consistently, so we fall back to a * more traditional 'size check' based on a time interval. You can control how often it is @@ -123400,7 +124768,7 @@ declare namespace Phaser { /** * Attempts to lock the orientation of the web browser using the Screen Orientation API. - * + * * This API is only available on modern mobile browsers. * See https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation for details. * @param orientation The orientation you'd like to lock the browser in. Should be an API string such as 'landscape', 'landscape-primary', 'portrait', etc. @@ -123421,7 +124789,7 @@ declare namespace Phaser { /** * This method will set a new size for your game. - * + * * It should only be used if you're looking to change the base size of your game and are using * one of the Scale Manager scaling modes, i.e. `FIT`. If you're using `NONE` and wish to * change the game and canvas size directly, then please use the `resize` method instead. @@ -123435,18 +124803,18 @@ declare namespace Phaser { * Call this to modify the size of the Phaser canvas element directly. * You should only use this if you are using the `NONE` scale mode, * it will update all internal components completely. - * + * * If all you want to do is change the size of the parent, see the `setParentSize` method. - * + * * If all you want is to change the base size of the game, but still have the Scale Manager * manage all the scaling (i.e. you're **not** using `NONE`), then see the `setGameSize` method. - * + * * This method will set the `gameSize`, `baseSize` and `displaySize` components to the given * dimensions. It will then resize the canvas width and height to the values given, by * directly setting the properties. Finally, if you have set the Scale Manager zoom value * to anything other than 1 (the default), it will set the canvas CSS width and height to * be the given size multiplied by the zoom factor (the canvas pixel size remains untouched). - * + * * If you have enabled `autoCenter`, it is then passed to the `updateCenter` method and * the margins are set, allowing the canvas to be centered based on its parent element * alone. Finally, the `displayScale` is adjusted and the RESIZE event dispatched. @@ -123473,11 +124841,11 @@ declare namespace Phaser { * By setting a Snap value, when the browser size is modified, its dimensions will automatically * be snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) - * + * * This mode is best used with the `FIT` scale mode. - * + * * Call this method with no arguments to reset the snap values. - * + * * Calling this method automatically invokes `ScaleManager.refresh` which emits a `RESIZE` event. * @param snapWidth The amount to snap the width to. If you don't want to snap the width, pass a value of zero. Default 0. * @param snapHeight The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero. Default snapWidth. @@ -123487,9 +124855,9 @@ declare namespace Phaser { /** * Refreshes the internal scale values, bounds sizes and orientation checks. - * + * * Once finished, dispatches the resize event. - * + * * This is called automatically by the Scale Manager when the browser window size changes, * as long as it is using a Scale Mode other than 'NONE'. * @param previousWidth The previous width of the game. Only set if the gameSize has changed. @@ -123500,7 +124868,7 @@ declare namespace Phaser { /** * Internal method that checks the current screen orientation, only if the internal check flag is set. - * + * * If the orientation has changed it updates the orientation property and then dispatches the orientation change event. */ updateOrientation(): void; @@ -123523,11 +124891,11 @@ declare namespace Phaser { * bounds of its parent. If you have explicitly set parent to be `null` in your * game config then this method will likely give incorrect results unless you have called the * `setParentSize` method first. - * + * * It works by modifying the canvas CSS `marginLeft` and `marginTop` properties. - * + * * If they have already been set by your own style sheet, or code, this will overwrite them. - * + * * To prevent the Scale Manager from centering the canvas, either do not set the * `autoCenter` property in your game config, or make sure it is set to `NO_CENTER`. */ @@ -123555,22 +124923,22 @@ declare namespace Phaser { /** * Sends a request to the browser to ask it to go in to full screen mode, using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API Fullscreen API}. - * + * * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. - * + * * This method _must_ be called from a `pointerup` user-input gesture (**not** `pointerdown`). You cannot launch * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked * from fullscreen unless the iframe has the `allowfullscreen` attribute. - * + * * On touch devices, such as Android and iOS Safari, you should always use `pointerup` and NOT `pointerdown`, * otherwise the request will fail unless the document in which your game is embedded has already received * some form of touch input, which you cannot guarantee. Activating fullscreen via `pointerup` circumvents * this issue. - * + * * Performing an action that navigates to another page, or opens another tab, will automatically cancel * fullscreen mode, as will the user pressing the ESC key. To cancel fullscreen mode directly from your game, * i.e. by clicking an icon, call the `stopFullscreen` method. - * + * * A browser can only send one DOM element into fullscreen. You can control which element this is by * setting the `fullscreenTarget` property in your game config, or changing the property in the Scale Manager. * Note that the game canvas _must_ be a child of the target. If you do not give a target, Phaser will @@ -123604,7 +124972,7 @@ declare namespace Phaser { /** * Toggles the fullscreen mode. If already in fullscreen, calling this will cancel it. * If not in fullscreen, this will request the browser to enter fullscreen mode. - * + * * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. * * This method _must_ be called from a `pointerup` user-input gesture (**not** `pointerdown`). You cannot launch @@ -123668,14 +125036,14 @@ declare namespace Phaser { /** * The game width. - * + * * This is typically the size given in the game configuration. */ readonly width: number; /** * The game height. - * + * * This is typically the size given in the game configuration. */ readonly height: number; @@ -123694,14 +125062,14 @@ declare namespace Phaser { /** * Are the game dimensions portrait? (i.e. taller than they are wide) - * + * * This is different to the device itself being in a portrait orientation. */ readonly isGamePortrait: boolean; /** * Are the game dimensions landscape? (i.e. wider than they are tall) - * + * * This is different to the device itself being in a landscape orientation. */ readonly isGameLandscape: boolean; @@ -123906,7 +125274,7 @@ declare namespace Phaser { /** * The game canvas is centered both horizontally and vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. */ @@ -125654,7 +127022,7 @@ declare namespace Phaser { */ class BaseSound extends Phaser.Events.EventEmitter { /** - * + * * @param manager Reference to the current sound manager instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. @@ -125739,7 +127107,7 @@ declare namespace Phaser { /** * Play this sound, or a marked section of it. - * + * * It always plays the sound from the start. If you want to start playback from a specific time * you can set 'seek' setting of the config object, provided to this call, to that value. * @param markerName If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object. Default ''. @@ -125808,7 +127176,7 @@ declare namespace Phaser { */ class BaseSoundManager extends Phaser.Events.EventEmitter { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -125853,9 +127221,9 @@ declare namespace Phaser { /** * The Spatial Audio listener position. - * + * * Only available with WebAudio. - * + * * You can modify the x/y properties of this Vec2 directly to * adjust the listener position within the game world. */ @@ -125889,7 +127257,7 @@ declare namespace Phaser { /** * Gets all sounds in this Sound Manager. - * + * * You can optionally specify a key, in which case only Sound instances that match the given key * will be returned. * @param key Optional asset key. If given, only Sound instances with this key will be returned. @@ -125907,9 +127275,9 @@ declare namespace Phaser { /** * Adds a new sound to the sound manager and plays it. - * + * * The sound will be automatically removed (destroyed) once playback ends. - * + * * This lets you play a new sound on the fly without the need to keep a reference to it. * @param key Asset key for the sound. * @param extra An optional additional object containing settings to be applied to the sound. It could be either config or marker object. @@ -125965,7 +127333,7 @@ declare namespace Phaser { * If you call this method with no parameters it will default to the center-point of * the game canvas. Depending on the type of game you're making, you may need to call * this method constantly to reset the listener position as the camera scrolls. - * + * * Calling this method does nothing on HTML5Audio. * @param x The x position of the Spatial Audio listener. * @param y The y position of the Spatial Audio listener. @@ -125986,7 +127354,7 @@ declare namespace Phaser { /** * When a key is given, returns true if any sound with that key is playing. - * + * * When no key is given, returns true if any sound is playing. * @param key Sound asset key. * @returns - Per the key argument, true if any matching sound is playing, otherwise false. @@ -125996,7 +127364,7 @@ declare namespace Phaser { /** * Method used internally for unlocking audio playback on devices that * require user interaction before any sound can be played on a web page. - * + * * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). */ protected unlock(): void; @@ -126028,7 +127396,7 @@ declare namespace Phaser { /** * Sets the global playback rate at which all the sounds will be played. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audios playback speed. * @param value Global playback rate at which all the sounds will be played. @@ -126087,11 +127455,11 @@ declare namespace Phaser { namespace Events { /** * The Sound Complete Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. - * + * * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('complete', listener); @@ -126102,15 +127470,15 @@ declare namespace Phaser { /** * The Audio Data Decoded All Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, * once all files passed to the method have been decoded (or errored). - * + * * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to * listen for them all completing. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: - * + * * ```javascript * this.sound.once('decodedall', handler); * this.sound.decodeAudio([ audioFiles ]); @@ -126120,11 +127488,11 @@ declare namespace Phaser { /** * The Audio Data Decoded Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: - * + * * ```javascript * this.sound.on('decoded', handler); * this.sound.decodeAudio(key, audioData); @@ -126134,12 +127502,12 @@ declare namespace Phaser { /** * The Sound Destroy Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either * directly or via a Sound Manager. - * + * * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('destroy', listener); @@ -126150,11 +127518,11 @@ declare namespace Phaser { /** * The Sound Detune Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. - * + * * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('detune', listener); @@ -126166,7 +127534,7 @@ declare namespace Phaser { /** * The Sound Manager Global Detune Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally * adjusts the detuning of all active sounds. @@ -126177,77 +127545,77 @@ declare namespace Phaser { /** * The Sound Manager Global Mute Event. - * + * * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly * or via the `setMute` method. This changes the mute state of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('mute', listener)`. */ const GLOBAL_MUTE: string; /** * The Sound Manager Global Rate Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally * adjusts the playback rate of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. */ const GLOBAL_RATE: string; /** * The Sound Manager Global Volume Event. - * + * * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly * or via the `setVolume` method. This changes the volume of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('volume', listener)`. */ const GLOBAL_VOLUME: string; /** * The Sound Looped Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. - * + * * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('looped', listener); * music.setLoop(true); * music.play(); * ``` - * + * * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. */ const LOOPED: string; /** * The Sound Loop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. - * + * * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('loop', listener); * music.setLoop(true); * ``` - * + * * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. */ const LOOP: string; /** * The Sound Mute Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. - * + * * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('mute', listener); @@ -126259,11 +127627,11 @@ declare namespace Phaser { /** * The Sound Pan Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their pan changes. - * + * * Listen to it from a Sound instance using `Sound.on('pan', listener)`, i.e.: - * + * * ```javascript * var sound = this.sound.add('key'); * sound.on('pan', listener); @@ -126275,22 +127643,22 @@ declare namespace Phaser { /** * The Pause All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds * have been paused. - * + * * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. */ const PAUSE_ALL: string; /** * The Sound Pause Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. - * + * * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('pause', listener); @@ -126302,11 +127670,11 @@ declare namespace Phaser { /** * The Sound Play Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. - * + * * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('play', listener); @@ -126317,11 +127685,11 @@ declare namespace Phaser { /** * The Sound Rate Change Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. - * + * * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('rate', listener); @@ -126333,22 +127701,22 @@ declare namespace Phaser { /** * The Resume All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds * have been resumed. - * + * * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. */ const RESUME_ALL: string; /** * The Sound Resume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. - * + * * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('resume', listener); @@ -126361,11 +127729,11 @@ declare namespace Phaser { /** * The Sound Seek Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. - * + * * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('seek', listener); @@ -126377,22 +127745,22 @@ declare namespace Phaser { /** * The Stop All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds * have been stopped. - * + * * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. */ const STOP_ALL: string; /** * The Sound Stop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. - * + * * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('stop', listener); @@ -126404,22 +127772,22 @@ declare namespace Phaser { /** * The Sound Manager Unlocked Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For * Web Audio this is on the first user gesture on the page. - * + * * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. */ const UNLOCKED: string; /** * The Sound Volume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. - * + * * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('volume', listener); @@ -126449,7 +127817,7 @@ declare namespace Phaser { */ class HTML5AudioSound extends Phaser.Sound.BaseSound { /** - * + * * @param manager Reference to the current sound manager instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. Default {}. @@ -126483,10 +127851,10 @@ declare namespace Phaser { /** * Play this sound, or a marked section of it. - * + * * It always plays the sound from the start. If you want to start playback from a specific time * you can set 'seek' setting of the config object, provided to this call, to that value. - * + * * If you want to play the same sound simultaneously, then you need to create another instance * of it and play that Sound. For HTML5 Audio this also requires creating multiple audio instances * when loading the audio files. @@ -126620,7 +127988,7 @@ declare namespace Phaser { /** * Sets the playback rate of this Sound. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audio's playback speed. * @param value The playback rate of this Sound. @@ -126671,14 +128039,14 @@ declare namespace Phaser { /** * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Has no audible effect on HTML5 Audio Sound, but still generates the PAN Event. */ pan: number; /** * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Has no audible effect on HTML5 Audio Sound, but still generates the PAN Event. * @param value The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). * @returns This Sound instance. @@ -126692,7 +128060,7 @@ declare namespace Phaser { */ class HTML5AudioSoundManager extends Phaser.Sound.BaseSoundManager { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -126709,7 +128077,7 @@ declare namespace Phaser { * Value representing time difference, in seconds, between calling * play method on an audio tag and when it actually starts playing. * It is used to achieve more accurate delayed sound playback. - * + * * You might need to tweak this value to get the desired results * since audio play delay varies depending on the browser/platform. */ @@ -126719,7 +128087,7 @@ declare namespace Phaser { * A value by which we should offset the loop end marker of the * looping sound to compensate for lag, caused by changing audio * tag playback position, in order to achieve gapless looping. - * + * * You might need to tweak this value to get the desired results * since loop lag varies depending on the browser/platform. */ @@ -126801,14 +128169,14 @@ declare namespace Phaser { /** * No audio implementation of the sound. It is used if audio has been * disabled in the game config or the device doesn't support any audio. - * + * * It represents a graceful degradation of sound logic that provides * minimal functionality and prevents Phaser projects that use audio from * breaking on devices that don't support any audio playback technologies. */ class NoAudioSound extends Phaser.Events.EventEmitter { /** - * + * * @param manager Reference to the current sound manager instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. Default {}. @@ -126904,7 +128272,7 @@ declare namespace Phaser { /** * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. */ pan: number; @@ -126988,7 +128356,7 @@ declare namespace Phaser { /** * Sets the playback rate of this Sound. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audios playback speed. * @param value The playback rate of this Sound. @@ -127020,7 +128388,7 @@ declare namespace Phaser { /** * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Note: iOS / Safari doesn't support the stereo panner node. * @param value The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). * @returns This Sound instance. @@ -127059,14 +128427,14 @@ declare namespace Phaser { /** * No-audio implementation of the Sound Manager. It is used if audio has been * disabled in the game config or the device doesn't support any audio. - * + * * It represents a graceful degradation of Sound Manager logic that provides * minimal functionality and prevents Phaser projects that use audio from * breaking on devices that don't support any audio playback technologies. */ class NoAudioSoundManager extends Phaser.Sound.BaseSoundManager { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -127288,7 +128656,7 @@ declare namespace Phaser { */ class WebAudioSound extends Phaser.Sound.BaseSound { /** - * + * * @param manager Reference to the WebAudio Sound Manager that owns this Sound instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. Default {}. @@ -127342,34 +128710,34 @@ declare namespace Phaser { /** * The time at which the sound should have started playback from the beginning. - * + * * Treat this property as read-only. - * + * * Based on `BaseAudioContext.currentTime` value. */ playTime: number; /** * The time at which the sound source should have actually started playback. - * + * * Treat this property as read-only. - * + * * Based on `BaseAudioContext.currentTime` value. */ startTime: number; /** * The time at which the sound loop source should actually start playback. - * + * * Based on `BaseAudioContext.currentTime` value. */ loopTime: number; /** * An array where we keep track of all rate updates during playback. - * + * * Treat this property as read-only. - * + * * Array of object types: `{ time: number, rate: number }` */ rateUpdates: any[]; @@ -127388,10 +128756,10 @@ declare namespace Phaser { /** * Play this sound, or a marked section of it. - * + * * It always plays the sound from the start. If you want to start playback from a specific time * you can set 'seek' setting of the config object, provided to this call, to that value. - * + * * If you want to play the same sound simultaneously, then you need to create another instance * of it and play that Sound. * @param markerName If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object. Default ''. @@ -127448,9 +128816,9 @@ declare namespace Phaser { * Gets or sets the x position of this Sound in Spatial Audio space. * * This only has any effect if the sound was created with a SpatialSoundConfig object. - * + * * Also see the `WebAudioSoundManager.setListenerPosition` method. - * + * * If you find that the sound becomes too quiet, too quickly, as it moves away from * the listener, then try different `refDistance` property values when configuring * the spatial sound. @@ -127461,9 +128829,9 @@ declare namespace Phaser { * Gets or sets the y position of this Sound in Spatial Audio space. * * This only has any effect if the sound was created with a SpatialSoundConfig object. - * + * * Also see the `WebAudioSoundManager.setListenerPosition` method. - * + * * If you find that the sound becomes too quiet, too quickly, as it moves away from * the listener, then try different `refDistance` property values when configuring * the spatial sound. @@ -127506,7 +128874,7 @@ declare namespace Phaser { /** * Sets the playback rate of this Sound. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audio's playback speed. * @param value The playback rate of this Sound. @@ -127581,14 +128949,14 @@ declare namespace Phaser { /** * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. */ pan: number; /** * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Note: iOS / Safari doesn't support the stereo panner node. * @param value The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). * @returns This Sound instance. @@ -127610,12 +128978,12 @@ declare namespace Phaser { * Phaser will fall back to the `HTML5AudioSoundManager` instead. * * Not all browsers can play all audio formats. - * + * * There is a good guide to what's supported: [Cross-browser audio basics: Audio codec support](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support). */ class WebAudioSoundManager extends Phaser.Sound.BaseSoundManager { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -127654,7 +129022,7 @@ declare namespace Phaser { /** * This method takes a new AudioContext reference and then sets * this Sound Manager to use that context for all playback. - * + * * As part of this call it also disconnects the master mute and volume * nodes and then re-creates them on the new given context. * @param context Reference to an already created AudioContext instance. @@ -127672,16 +129040,16 @@ declare namespace Phaser { /** * Decode audio data into a format ready for playback via Web Audio. - * + * * The audio data can be a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. - * + * * The `audioKey` is the key that will be used to save the decoded audio to the audio cache. - * + * * Instead of passing a single entry you can instead pass an array of `Phaser.Types.Sound.DecodeAudioConfig` * objects as the first and only argument. - * + * * Decoding is an async process, so be sure to listen for the events to know when decoding has completed. - * + * * Once the audio has decoded it can be added to the Sound Manager or played via its key. * @param audioKey The string-based key to be used to reference the decoded audio in the audio cache, or an array of audio config objects. * @param audioData The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. @@ -127694,7 +129062,7 @@ declare namespace Phaser { * If you call this method with no parameters it will default to the center-point of * the game canvas. Depending on the type of game you're making, you may need to call * this method constantly to reset the listener position as the camera scrolls. - * + * * Calling this method does nothing on HTML5Audio. * @param x The x position of the Spatial Audio listener. * @param y The y position of the Spatial Audio listener. @@ -127703,7 +129071,7 @@ declare namespace Phaser { /** * Unlocks Web Audio API on the initial input event. - * + * * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). */ unlock(): void; @@ -127722,7 +129090,7 @@ declare namespace Phaser { /** * Update method called on every game step. - * + * * Removes destroyed sounds and updates every active sound in the game. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time elapsed since the last frame. @@ -127769,7 +129137,7 @@ declare namespace Phaser { */ class List { /** - * + * * @param parent The parent of this list. */ constructor(parent: any); @@ -127875,15 +129243,15 @@ declare namespace Phaser { /** * Returns all children in this List. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. - * + * * For example: `getAll('parent')` would return only children that have a property called `parent`. - * + * * You can also specify a value to compare the property to: - * + * * `getAll('visible', true)` would return only children that have their visible property set to `true`. - * + * * Optionally you can specify a start and end index. For example if this List had 100 children, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50 children in the List. @@ -128067,14 +129435,14 @@ declare namespace Phaser { /** * The next item in the List, or `null` if the entire List has been traversed. - * + * * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. */ readonly next: T; /** * The previous item in the List, or `null` if the entire List has been traversed. - * + * * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. */ readonly previous: T; @@ -128097,7 +129465,7 @@ declare namespace Phaser { */ class Map { /** - * + * * @param elements An optional array of key-value pairs to populate this Map with. */ constructor(elements: V[]); @@ -128123,9 +129491,9 @@ declare namespace Phaser { /** * Adds an element with a specified `key` and `value` to this Map. - * + * * If the `key` already exists, the value will be replaced. - * + * * If you wish to add multiple elements in a single call, use the `setAll` method instead. * @param key The key of the element to be added to this Map. * @param value The value of the element to be added to this Map. @@ -128185,7 +129553,7 @@ declare namespace Phaser { /** * Iterates through all entries in this Map, passing each one to the given callback. - * + * * If the callback returns `false`, the iteration will break. * @param callback The callback which will receive the keys and entries held in this Map. * @returns This Map object. @@ -128212,11 +129580,11 @@ declare namespace Phaser { /** * A Process Queue maintains three internal lists. - * + * * The `pending` list is a selection of items which are due to be made 'active' in the next update. * The `active` list is a selection of items which are considered active and should be updated. * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update. - * + * * When new items are added to a Process Queue they are put in the pending list, rather than being added * immediately to the active list. Equally, items that are removed are put into the destroy list, rather than * being destroyed immediately. This allows the Process Queue to carefully process each item at a specific, fixed @@ -128259,7 +129627,7 @@ declare namespace Phaser { /** * Adds a new item to the Process Queue. - * + * * The item is added to the pending list and made active in the next update. * @param item The item to add to the queue. * @returns The item that was added. @@ -128268,7 +129636,7 @@ declare namespace Phaser { /** * Removes an item from the Process Queue. - * + * * The item is added to the 'destroy' list and is fully removed in the next update. * @param item The item to be removed from the queue. * @returns The item that was removed. @@ -128285,7 +129653,7 @@ declare namespace Phaser { /** * Update this queue. First it will process any items awaiting destruction, and remove them. - * + * * Then it will check to see if there are any items pending insertion, and move them to an * active state. Finally, it will return a list of active items for further processing.undefined * @returns A list of active items. @@ -128294,7 +129662,7 @@ declare namespace Phaser { /** * Returns the current list of active items. - * + * * This method returns a reference to the active list array, not a copy of it. * Therefore, be careful to not modify this array outside of the ProcessQueue.undefined * @returns A list of active items. @@ -128316,10 +129684,10 @@ declare namespace Phaser { /** * RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. * It's based on an optimized R-tree data structure with bulk insertion support. - * + * * Spatial index is a special data structure for points and rectangles that allows you to perform queries like * "all items within this bounding box" very efficiently (e.g. hundreds of times faster than looping over all items). - * + * * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. * This is to avoid the eval-like function creation that the original library used, which caused CSP policy violations. * @@ -128436,14 +129804,14 @@ declare namespace Phaser { /** * The Size component allows you to set `width` and `height` properties and define the relationship between them. - * + * * The component can automatically maintain the aspect ratios between the two values, and clamp them * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. */ class Size { /** - * + * * @param width The width of the Size component. Default 0. * @param height The height of the Size component. If not given, it will use the `width`. Default width. * @param aspectMode The aspect mode of the Size component. Defaults to 0, no mode. Default 0. @@ -128459,7 +129827,7 @@ declare namespace Phaser { /** * The proportional relationship between the width and height. - * + * * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, * depending on the aspect mode. */ @@ -128493,26 +129861,26 @@ declare namespace Phaser { /** * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. - * + * * By default this is disabled. - * + * * This property is read-only. To change it see the `setSnap` method. */ readonly snapTo: Phaser.Math.Vector2; /** * Sets the aspect mode of this Size component. - * + * * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. - * + * * It can be a number from 0 to 4, or a Size constant: - * + * * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. * @param value The aspect mode value. Default 0. * @returns This Size component instance. @@ -128523,12 +129891,12 @@ declare namespace Phaser { * By setting snap values, when this Size component is modified its dimensions will automatically * be snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) - * + * * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these * values are not multiples of the given snap values, then this can result in un-snapped dimensions. - * + * * Call this method with no arguments to reset the snap values. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. * @param snapWidth The amount to snap the width to. If you don't want to snap the width, pass a value of zero. Default 0. * @param snapHeight The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero. Default snapWidth. @@ -128538,18 +129906,18 @@ declare namespace Phaser { /** * Sets, or clears, the parent of this Size component. - * + * * To clear the parent call this method with no arguments. - * + * * The parent influences the maximum extents to which this Size component can expand, * based on the aspect mode: - * + * * NONE - The parent clamps both the width and height. * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. * FIT - The parent clamps whichever axis is required to ensure the size fits within it. * ENVELOP - The parent is used to ensure the size fully envelops the parent. - * + * * Calling this method automatically calls `setSize`. * @param parent Sets the parent of this Size component. Don't provide a value to clear an existing parent. * @returns This Size component instance. @@ -128558,11 +129926,11 @@ declare namespace Phaser { /** * Set the minimum width and height values this Size component will allow. - * + * * The minimum values can never be below zero, or greater than the maximum values. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here * _can_ be exceeded in some situations. * @param width The minimum allowed width of the Size component. Default 0. @@ -128573,9 +129941,9 @@ declare namespace Phaser { /** * Set the maximum width and height values this Size component will allow. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here * _can_ be exceeded in some situations. * @param width The maximum allowed width of the Size component. Default Number.MAX_VALUE. @@ -128586,16 +129954,16 @@ declare namespace Phaser { /** * Sets the width and height of this Size component based on the aspect mode. - * + * * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current * aspect ratio is honored across all other modes. - * + * * If snapTo values have been set then the given width and height are snapped first, prior to any further * adjustment via min/max values, or a parent. - * + * * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into * that range prior to adjustment, but may still exceed them depending on the aspect mode. - * + * * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will * be clamped to the range specified by the parent. * @param width The new width of the Size component. Default 0. @@ -128606,7 +129974,7 @@ declare namespace Phaser { /** * Sets a new aspect ratio, overriding what was there previously. - * + * * It then calls `setSize` immediately using the current dimensions. * @param ratio The new aspect ratio. * @returns This Size component instance. @@ -128615,7 +129983,7 @@ declare namespace Phaser { /** * Sets a new width and height for this Size component and updates the aspect ratio based on them. - * + * * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. * @param width The new width of the Size component. * @param height The new height of the Size component. If not given, it will use the `width`. Default width. @@ -128641,10 +130009,10 @@ declare namespace Phaser { /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @param width The new width of the Size component. Default 0. @@ -128656,9 +130024,9 @@ declare namespace Phaser { /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * There may be some space inside the target area which is not covered if its aspect ratio differs. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @param width The new width of the Size component. Default 0. @@ -128669,9 +130037,9 @@ declare namespace Phaser { /** * The current `width` and `height` are adjusted so that they fully envelope the given dimensions, while keeping the aspect ratio. - * + * * The size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent * on the longest axis. * @param width The new width of the Size component. Default 0. @@ -128682,7 +130050,7 @@ declare namespace Phaser { /** * Sets the width of this Size component. - * + * * Depending on the aspect mode, changing the width may also update the height and aspect ratio. * @param value The new width of the Size component. * @returns This Size component instance. @@ -128691,7 +130059,7 @@ declare namespace Phaser { /** * Sets the height of this Size component. - * + * * Depending on the aspect mode, changing the height may also update the width and aspect ratio. * @param value The new height of the Size component. * @returns This Size component instance. @@ -128721,20 +130089,20 @@ declare namespace Phaser { /** * Destroys this Size component. - * + * * This clears the local properties and any parent object, if set. - * + * * A destroyed Size component cannot be re-used. */ destroy(): void; /** * The width of this Size component. - * + * * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. - * + * * A width can never be less than zero. - * + * * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. * You can also use the `setWidth` method. */ @@ -128742,11 +130110,11 @@ declare namespace Phaser { /** * The height of this Size component. - * + * * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. - * + * * A height can never be less than zero. - * + * * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. * You can also use the `setHeight` method. */ @@ -128809,26 +130177,26 @@ declare namespace Phaser { namespace Textures { /** * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. - * + * * You can use the properties of this texture to draw to the canvas element directly, using all of the standard * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. - * + * * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading * texture data to it. This restriction does not apply if using the Canvas Renderer. - * + * * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify * sections of the canvas using the `add` method. - * + * * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause * graphical errors. */ class CanvasTexture extends Phaser.Textures.Texture { /** - * + * * @param manager A reference to the Texture Manager this Texture belongs to. * @param key The unique string-based key of this Texture. * @param source The canvas element that is used as the base of this texture. @@ -128916,7 +130284,7 @@ declare namespace Phaser { /** * Sets a pixel in the CanvasTexture to the given color and alpha values. - * + * * This is an expensive operation to run in large quantities, so use sparingly. * @param x The x coordinate of the pixel to set. Must lay within the dimensions of this CanvasTexture and be an integer. * @param y The y coordinate of the pixel to set. Must lay within the dimensions of this CanvasTexture and be an integer. @@ -128954,7 +130322,7 @@ declare namespace Phaser { /** * Get the color of a specific pixel from this texture and store it in a Color object. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. @@ -128966,10 +130334,10 @@ declare namespace Phaser { /** * Returns an array containing all of the pixels in the given region. - * + * * If the requested region extends outside the bounds of this CanvasTexture, * the region is truncated to fit. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * @param x The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. Default 0. @@ -128982,9 +130350,9 @@ declare namespace Phaser { /** * Returns the Image Data index for the given pixel in this CanvasTexture. - * + * * The index can be used to read directly from the `this.data` array. - * + * * The index points to the red value in the array. The subsequent 3 indexes * point to green, blue and alpha respectively. * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. @@ -129043,24 +130411,24 @@ declare namespace Phaser { /** * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of * Game Objects directly to it. - * + * * You can take many complex objects and draw them to this one texture, which can then be used as the * base texture for other Game Objects, such as Sprites. Should you then update this texture, all * Game Objects using it will instantly be updated as well, reflecting the changes immediately. - * + * * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke * expensive GPU uploads on each change. - * + * * ```js * const t = this.textures.addDynamicTexture('player', 64, 128); * // draw objects to t * this.add.sprite(x, y, 'player'); * this.render(); * ``` - * + * * Because this is a standard Texture within Phaser, you can add frames to it, meaning you can use it * to generate sprite sheets, texture atlases or tile sets. - * + * * Under WebGL1, a FrameBuffer, which is what this Dynamic Texture uses internally, cannot be anti-aliased. * This means that when drawing objects such as Shapes or Graphics instances to this texture, they may appear * to be drawn with no aliasing around the edges. This is a technical limitation of WebGL1. To get around it, @@ -129080,7 +130448,7 @@ declare namespace Phaser { */ class DynamicTexture extends Phaser.Textures.Texture { /** - * + * * @param manager A reference to the Texture Manager this Texture belongs to. * @param key The unique string-based key of this Texture. * @param width The width of this Dynamic Texture in pixels. Defaults to 256 x 256. Default 256. @@ -129101,14 +130469,14 @@ declare namespace Phaser { /** * The width of this Dynamic Texture. - * + * * Treat this property as read-only. Use the `setSize` method to change the size. */ width: number; /** * The height of this Dynamic Texture. - * + * * Treat this property as read-only. Use the `setSize` method to change the size. */ height: number; @@ -129132,10 +130500,10 @@ declare namespace Phaser { /** * An internal Camera that can be used to move around this Dynamic Texture. - * + * * Control it just like you would any Scene Camera. The difference is that it only impacts * the placement of **Game Objects** (not textures) that you then draw to this texture. - * + * * You can scroll, zoom and rotate this Camera. */ camera: Phaser.Cameras.Scene2D.Camera; @@ -129148,12 +130516,12 @@ declare namespace Phaser { /** * Resizes this Dynamic Texture to the new dimensions given. - * + * * In WebGL it will destroy and then re-create the frame buffer being used by this Dynamic Texture. * In Canvas it will resize the underlying canvas DOM element. - * + * * Both approaches will erase everything currently drawn to this texture. - * + * * If the dimensions given are the same as those already being used, calling this method will do nothing. * @param width The new width of this Dynamic Texture. * @param height The new height of this Dynamic Texture. If not specified, will be set the same as the `width`. Default width. @@ -129171,10 +130539,10 @@ declare namespace Phaser { /** * Fills this Dynamic Texture with the given color. - * + * * By default it will fill the entire texture, however you can set it to fill a specific * rectangular area by using the x, y, width and height arguments. - * + * * The color should be given in hex format, i.e. 0xff0000 for red, 0x00ff00 for green, etc. * @param rgb The color to fill this Dynamic Texture with, such as 0xff0000 for red. * @param alpha The alpha value used by the fill. Default 1. @@ -129202,9 +130570,9 @@ declare namespace Phaser { * x and y coordinates. You can use the optional 'config' argument to provide * lots more options about how the stamp is applied, including the alpha, * tint, angle, scale and origin. - * + * * By default, the frame will stamp on the x/y coordinates based on its center. - * + * * If you wish to stamp from the top-left, set the config `originX` and * `originY` properties both to zero. * @@ -129235,9 +130603,9 @@ declare namespace Phaser { /** * Draws the given object, or an array of objects, to this Dynamic Texture. - * + * * It can accept any of the following: - * + * * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. * * Tilemap Layers. * * A Group. The contents of which will be iterated and drawn in turn. @@ -129246,7 +130614,7 @@ declare namespace Phaser { * * Another Dynamic Texture, or a Render Texture. * * A Texture Frame instance. * * A string. This is used to look-up the texture from the Texture Manager. - * + * * Note 1: You cannot draw a Dynamic Texture to itself. * * Note 2: GameObjects will use the camera, while textures and frames will not. @@ -129255,14 +130623,14 @@ declare namespace Phaser { * If passing in a Group or Container it will only draw children that return `true` * when their `willRender()` method is called. I.e. a Container with 10 children, * 5 of which have `visible=false` will only draw the 5 visible ones. - * + * * If passing in an array of Game Objects it will draw them all, regardless if * they pass a `willRender` check or not. - * + * * You can pass in a string in which case it will look for a texture in the Texture * Manager matching that string, and draw the base frame. If you need to specify * exactly which frame to draw then use the method `drawFrame` instead. - * + * * You can pass in the `x` and `y` coordinates to draw the objects at. The use of * the coordinates differ based on what objects are being drawn. If the object is * a Group, Container or Display List, the coordinates are _added_ to the positions @@ -129315,11 +130683,11 @@ declare namespace Phaser { * It uses a `TileSprite` internally to draw the frame repeatedly. * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * You can optionally provide a position, width, height, alpha and tint value to apply to * the frames before they are drawn. The position controls the top-left where the repeating * fill will start from. The width and height control the size of the filled area. - * + * * The position can be negative if required, but the dimensions cannot. * * This method respects the camera settings of the Dynamic Texture. @@ -129360,16 +130728,16 @@ declare namespace Phaser { /** * Takes a snapshot of the given area of this Dynamic Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Dynamic Texture see the `snapshot` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Dynamic Texture has, so please be careful how you employ this in your game. * @param x The x coordinate to grab from. @@ -129385,16 +130753,16 @@ declare namespace Phaser { /** * Takes a snapshot of the whole of this Dynamic Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture a portion of this Dynamic Texture see the `snapshotArea` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Dynamic Texture has, so please be careful how you employ this in your game. * @param callback The Function to invoke after the snapshot image is created. @@ -129406,12 +130774,12 @@ declare namespace Phaser { /** * Takes a snapshot of the given pixel from this Dynamic Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Dynamic Texture see the `snapshot` method. * To capture a portion of this Dynamic Texture see the `snapshotArea` method. - * + * * Unlike the two other snapshot methods, this one will send your callback a `Color` object * containing the color data for the requested pixel. It doesn't need to create an internal * Canvas or Image object, so is a lot faster to execute, using less memory than the other snapshot methods. @@ -129462,7 +130830,7 @@ declare namespace Phaser { */ class Frame { /** - * + * * @param texture The Texture this Frame is a part of. * @param name The name of this Frame. The name is unique within the Texture. * @param sourceIndex The index of the TextureSource that this Frame is a part of. @@ -129631,7 +130999,7 @@ declare namespace Phaser { /** * Sets the width, height, x and y of this Frame. - * + * * This is called automatically by the constructor * and should rarely be changed on-the-fly. * @param width The width of the frame before being trimmed. @@ -129656,9 +131024,9 @@ declare namespace Phaser { /** * Sets the scale9 center rectangle values. - * + * * Scale9 is a feature of Texture Packer, allowing you to define a nine-slice scaling grid. - * + * * This is set automatically by the JSONArray and JSONHash parsers. * @param x The left coordinate of the center scale9 rectangle. * @param y The top coordinate of the center scale9 rectangle. @@ -129699,7 +131067,7 @@ declare namespace Phaser { /** * Directly sets the canvas and WebGL UV data for this frame. - * + * * Use this if you need to override the values that are generated automatically * when the Frame is created. * @param width Width of this frame for the Canvas data. @@ -129786,18 +131154,18 @@ declare namespace Phaser { * The Frames represent the different areas of the Texture. For example a texture atlas * may have many Frames, one for each element within the atlas. Where-as a single image would have * just one frame, that encompasses the whole image. - * + * * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. * This frame represents the entirety of the source image. - * + * * Textures are managed by the global TextureManager. This is a singleton class that is * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. - * + * * Sprites and other Game Objects get the texture data they need from the TextureManager. */ class Texture { /** - * + * * @param manager A reference to the Texture Manager this Texture belongs to. * @param key The unique string-based key of this Texture. * @param source An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. @@ -129846,7 +131214,7 @@ declare namespace Phaser { /** * The total number of Frames in this Texture, including the `__BASE` frame. - * + * * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. */ @@ -129863,9 +131231,9 @@ declare namespace Phaser { /** * Adds a new Frame to this Texture. - * + * * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. - * + * * The name given must be unique within this Texture. If it already exists, this method will return `null`. * @param name The name of this Frame. The name is unique within the Texture. * @param sourceIndex The index of the TextureSource that this Frame is a part of. @@ -129879,7 +131247,7 @@ declare namespace Phaser { /** * Removes the given Frame from this Texture. The Frame is destroyed immediately. - * + * * Any Game Objects using this Frame should stop using it _before_ you remove it, * as it does not happen automatically. * @param name The key of the Frame to remove. @@ -129896,7 +131264,7 @@ declare namespace Phaser { /** * Gets a Frame from this Texture based on either the key or the index of the Frame. - * + * * In a Texture Atlas Frames are typically referenced by a key. * In a Sprite Sheet Frames are referenced by an index. * Passing no value for the name returns the base texture. @@ -129926,7 +131294,7 @@ declare namespace Phaser { /** * Based on the given Texture Source Index, this method will get all of the Frames using * that source and then work out the bounds that they encompass, returning them in an object. - * + * * This is useful if this Texture is, for example, a sprite sheet within an Atlas, and you * need to know the total bounds of the sprite sheet. * @param sourceIndex The index of the TextureSource to get the Frame bounds from. Default 0. @@ -129936,7 +131304,7 @@ declare namespace Phaser { /** * Returns an array with all of the names of the Frames in this Texture. - * + * * Useful if you want to randomly assign a Frame to a Game Object, as you can * pick a random element from the returned array. * @param includeBase Include the `__BASE` Frame in the output array? Default false. @@ -129946,7 +131314,7 @@ declare namespace Phaser { /** * Given a Frame name, return the source image it uses to render with. - * + * * This will return the actual DOM Image or Canvas element. * @param name The string-based name, or integer based index, of the Frame to get from this Texture. * @returns The DOM Image, Canvas Element or Render Texture. @@ -129956,7 +131324,7 @@ declare namespace Phaser { /** * Given a Frame name, return the data source image it uses to render with. * You can use this to get the normal map for an image for example. - * + * * This will return the actual DOM Image. * @param name The string-based name, or integer based index, of the Frame to get from this Texture. * @returns The DOM Image or Canvas Element. @@ -129984,7 +131352,7 @@ declare namespace Phaser { /** * Adds a data source image to this Texture. - * + * * An example of a data source image would be a normal map, where all of the Frames for this Texture * equally apply to the normal map. * @@ -129999,11 +131367,11 @@ declare namespace Phaser { /** * Sets the Filter Mode for this Texture. - * + * * The mode can be either Linear, the default, or Nearest. - * + * * For pixel-art you should use Nearest. - * + * * The mode applies to the entire Texture, not just a specific Frame of it. * @param filterMode The Filter Mode. */ @@ -130046,26 +131414,26 @@ declare namespace Phaser { /** * When Phaser boots it will create an instance of this Texture Manager class. - * + * * It is a global manager that handles all textures in your game. You can access it from within * a Scene via the `this.textures` property. - * + * * Its role is as a manager for all textures that your game uses. It can create, update and remove * textures globally, as well as parse texture data from external files, such as sprite sheets * and texture atlases. - * + * * Sprites and other texture-based Game Objects get their texture data directly from this class. */ class TextureManager extends Phaser.Events.EventEmitter { /** - * + * * @param game The Phaser.Game instance this Texture Manager belongs to. */ constructor(game: Phaser.Game); /** * The Game that the Texture Manager belongs to. - * + * * A game will only ever have one instance of a Texture Manager. */ game: Phaser.Game; @@ -130077,11 +131445,11 @@ declare namespace Phaser { /** * This object contains all Textures that belong to this Texture Manager. - * + * * Textures are identified by string-based keys, which are used as the property * within this object. Therefore, you can access any texture directly from this * object without any iteration. - * + * * You should not typically modify this object directly, but instead use the * methods provided by the Texture Manager to add and remove entries from it. */ @@ -130089,9 +131457,9 @@ declare namespace Phaser { /** * An Image Game Object that belongs to this Texture Manager. - * + * * Used as a drawing stamp within Dynamic Textures. - * + * * This is not part of the display list and doesn't render. * * Prior to v4.0.0, this was of the type `Phaser.GameObjects.Image`. @@ -130131,7 +131499,7 @@ declare namespace Phaser { * Removes a Texture from the Texture Manager and destroys it. This will immediately * clear all references to it from the Texture Manager, and if it has one, destroy its * WebGLTexture. This will emit a `removetexture` event. - * + * * Note: If you have any Game Objects still using this texture they will start throwing * errors the next time they try to render. Make sure that removing the texture is the final * step when clearing down to avoid this. @@ -130149,7 +131517,7 @@ declare namespace Phaser { /** * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. - * + * * It works by creating an `Image` DOM object, then setting the `src` attribute to * the given base64 encoded data. As a result, the process is asynchronous by its nature, * so be sure to listen for the events this method dispatches before using the texture. @@ -130161,9 +131529,9 @@ declare namespace Phaser { /** * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. - * + * * You can also provide the image type and encoder options. - * + * * This will only work with bitmap based texture frames, such as those created from Texture Atlases. * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please * see the WebGL Snapshot function instead. @@ -130186,11 +131554,11 @@ declare namespace Phaser { /** * Takes a WebGLTextureWrapper and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. - * + * * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. - * + * * This is a WebGL only feature. - * + * * Prior to Phaser 3.80.0, this method took a bare `WebGLTexture` * as the `glTexture` parameter. You must now wrap the `WebGLTexture` in a * `WebGLTextureWrapper` instance before passing it to this method. @@ -130202,10 +131570,10 @@ declare namespace Phaser { /** * Adds a Compressed Texture to this Texture Manager. - * + * * The texture should typically have been loaded via the `CompressedTextureFile` loader, * in order to prepare the correct data object this method requires. - * + * * You can optionally also pass atlas data to this method, in which case a texture atlas * will be generated from the given compressed texture, combined with the atlas data. * @param key The unique string-based key of the Texture. @@ -130226,7 +131594,7 @@ declare namespace Phaser { /** * Creates a new Texture using a blank Canvas element of the size given. - * + * * Canvas elements are automatically pooled and calling this method will * extract a free canvas from the CanvasPool, or create one if none are available. * @param key The unique string-based key of the Texture. @@ -130248,19 +131616,19 @@ declare namespace Phaser { /** * Creates a Dynamic Texture instance and adds itself to this Texture Manager. - * + * * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of * Game Objects directly to it. - * + * * You can take many complex objects and draw them to this one texture, which can then be used as the * base texture for other Game Objects, such as Sprites. Should you then update this texture, all * Game Objects using it will instantly be updated as well, reflecting the changes immediately. - * + * * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke * expensive GPU uploads on each change. - * + * * See the methods available on the `DynamicTexture` class for more details. - * + * * Optionally, you can also pass a Dynamic Texture instance to this method to have * it added to the Texture Manager. * @param key The string-based key of this Texture. Must be unique within the Texture Manager. Or, a DynamicTexture instance. @@ -130298,12 +131666,12 @@ declare namespace Phaser { /** * Adds a Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a JSON data file, * such as those exported by applications like Texture Packer. - * + * * The frame data of the atlas must be stored in an Array within the JSON. - * + * * This is known as a JSON Array in software such as Texture Packer. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -130317,12 +131685,12 @@ declare namespace Phaser { /** * Adds a Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a JSON data file, * such as those exported by applications like Texture Packer. - * + * * The frame data of the atlas must be stored in an Object within the JSON. - * + * * This is known as a JSON Hash in software such as Texture Packer. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -130356,10 +131724,10 @@ declare namespace Phaser { /** * Adds a Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a data file, * such as those exported by applications like Texture Packer. - * + * * The frame data of the atlas must be stored in an XML file. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -130373,10 +131741,10 @@ declare namespace Phaser { /** * Adds a Unity Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a data file, * such as those exported by applications like Texture Packer or Unity. - * + * * The frame data of the atlas must be stored in a Unity YAML file. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -130390,12 +131758,12 @@ declare namespace Phaser { /** * Adds a Sprite Sheet to this Texture Manager. - * + * * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact * same size and cannot be trimmed or rotated. This is different to a Texture Atlas, created by tools such as * Texture Packer, and more akin with the fixed-frame exports you get from apps like Aseprite or old arcade * games. - * + * * As of Phaser 3.60 you can use this method to add a sprite sheet to an existing Phaser Texture. * @param key The unique string-based key of the Texture. Give an empty string if you provide a Phaser Texture as the 2nd argument. * @param source The source Image element, or a Phaser Texture. @@ -130407,7 +131775,7 @@ declare namespace Phaser { /** * Adds a Sprite Sheet to this Texture Manager, where the Sprite Sheet exists as a Frame within a Texture Atlas. - * + * * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact * same size and cannot be trimmed or rotated. * @param key The unique string-based key of the Texture. @@ -130418,9 +131786,9 @@ declare namespace Phaser { /** * Creates a texture from an array of colour data. - * + * * This is only available in WebGL mode. - * + * * If the dimensions provided are powers of two, the resulting texture * will be automatically set to wrap by the WebGL Renderer. * @param key The unique string-based key of the Texture. @@ -130469,13 +131837,13 @@ declare namespace Phaser { /** * Returns a Texture from the Texture Manager that matches the given key. - * + * * If the key is `undefined` it will return the `__DEFAULT` Texture. - * + * * If the key is an instance of a Texture, it will return the instance. - * + * * If the key is an instance of a Frame, it will return the frames parent Texture instance. - * + * * Finally, if the key is given, but not found, and not a Texture or Frame instance, it will return the `__MISSING` Texture. * @param key The unique string-based key of the Texture, or a Texture, or Frame instance. * @returns The Texture matching the given key. @@ -130500,9 +131868,9 @@ declare namespace Phaser { /** * Parses the 'key' parameter and returns a Texture Frame instance. - * + * * It can accept the following formats: - * + * * 1) A string * 2) An array where the elements are: [ key, [frame] ] * 3) An object with the properties: { key, [frame] } @@ -130556,9 +131924,9 @@ declare namespace Phaser { /** * Changes the key being used by a Texture to the new key provided. - * + * * The old key is removed, allowing it to be re-used. - * + * * Game Objects are linked to Textures by a reference to the Texture object, so * all existing references will be retained. * @param currentKey The current string-based key of the Texture you wish to rename. @@ -130615,7 +131983,7 @@ declare namespace Phaser { */ class TextureSource { /** - * + * * @param texture The Texture this TextureSource belongs to. * @param source The source image data. * @param width Optional width of the source image. If not given it's derived from the source itself. @@ -130636,9 +132004,9 @@ declare namespace Phaser { /** * The source of the image data. - * + * * This is either an Image Element, a Canvas Element, a Video Element, a RenderTexture or a WebGLTextureWrapper. - * + * * In Phaser 3.60 and above it can also be a Compressed Texture data object. */ source: Phaser.Types.Textures.TextureSource; @@ -130729,9 +132097,9 @@ declare namespace Phaser { /** * Sets the Filter Mode for this Texture. - * + * * The mode can be either Linear, the default, or Nearest. - * + * * For pixel-art you should use Nearest. * @param filterMode The Filter Mode. */ @@ -139488,7 +140856,7 @@ declare namespace Phaser { */ class Clock { /** - * + * * @param scene The Scene which owns this Clock. */ constructor(scene: Phaser.Scene); @@ -139505,28 +140873,28 @@ declare namespace Phaser { /** * The current time of the Clock, in milliseconds. - * + * * If accessed externally, this is equivalent to the `time` parameter normally passed to a Scene's `update` method. */ now: number; /** * The time the Clock (and Scene) started, in milliseconds. - * + * * This can be compared to the `time` parameter passed to a Scene's `update` method. */ startTime: number; /** * The scale of the Clock's time delta. - * + * * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Clock and anything which uses it, such as its Timer Events. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing the Clock. */ timeScale: number; /** * Whether the Clock is paused (`true`) or active (`false`). - * + * * When paused, the Clock will not update any of its Timer Events, thus freezing time. */ paused: boolean; @@ -139536,11 +140904,11 @@ declare namespace Phaser { * * You can pass in either a `TimerEventConfig` object, from which a new `TimerEvent` will * be created, or you can pass in a `TimerEvent` instance. - * + * * If passing an instance please make sure that this instance hasn't been used before. * If it has ever entered a 'completed' state then it will no longer be suitable to * run again. - * + * * Also, if the `TimerEvent` instance is being used by _another_ Clock (in another Scene) * it will still be updated by that Clock as well, so be careful when using this feature. * @param config The configuration for the Timer Event, or an existing Timer Event object. @@ -139550,7 +140918,7 @@ declare namespace Phaser { /** * Creates a Timer Event and adds it to the Clock at the start of the frame. - * + * * This is a shortcut for {@link #addEvent} which can be shorter and is compatible with the syntax of the GreenSock Animation Platform (GSAP). * @param delay The delay of the function call, in milliseconds. * @param callback The function to call after the delay expires. @@ -139568,7 +140936,7 @@ declare namespace Phaser { /** * Removes the given Timer Event, or an array of Timer Events, from this Clock. - * + * * The events are removed from all internal lists (active, pending and removal), * freeing the event up to be re-used. * @param events The Timer Event, or an array of Timer Events, to remove from this Clock. @@ -139598,27 +140966,27 @@ declare namespace Phaser { /** * A Timeline is a way to schedule events to happen at specific times in the future. - * + * * You can think of it as an event sequencer for your game, allowing you to schedule the * running of callbacks, events and other actions at specific times in the future. - * + * * A Timeline is a Scene level system, meaning you can have as many Timelines as you like, each * belonging to a different Scene. You can also have multiple Timelines running at the same time. - * + * * If the Scene is paused, the Timeline will also pause. If the Scene is destroyed, the Timeline * will be automatically destroyed. However, you can control the Timeline directly, pausing, * resuming and stopping it at any time. - * + * * Create an instance of a Timeline via the Game Object Factory: - * + * * ```js * const timeline = this.add.timeline(); * ``` - * + * * The Timeline always starts paused. You must call `play` on it to start it running. - * + * * You can also pass in a configuration object on creation, or an array of them: - * + * * ```js * const timeline = this.add.timeline({ * at: 1000, @@ -139626,12 +140994,12 @@ declare namespace Phaser { * this.add.sprite(400, 300, 'logo'); * } * }); - * + * * timeline.play(); * ``` - * + * * In this example we sequence a few different events: - * + * * ```js * const timeline = this.add.timeline([ * { @@ -139657,22 +141025,22 @@ declare namespace Phaser { * } * } * ]); - * + * * timeline.play(); * ``` - * + * * The Timeline can also be looped with the repeat method: * * ```js * timeline.repeat().play(); * ``` - * + * * There are lots of options available to you via the configuration object. See the * {@link Phaser.Types.Time.TimelineEventConfig} typedef for more details. */ class Timeline extends Phaser.Events.EventEmitter { /** - * + * * @param scene The Scene which owns this Timeline. * @param config The configuration object for this Timeline Event, or an array of them. */ @@ -139690,17 +141058,17 @@ declare namespace Phaser { /** * The elapsed time counter. - * + * * Treat this as read-only. */ elapsed: number; /** * The Timeline's delta time scale. - * + * * Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. * A value of 0 freezes time and is effectively equivalent to pausing the Timeline. - * + * * This doesn't affect the delta time scale of any Tweens created by the Timeline. * You will have to set the `timeScale` of each Tween or the Tween Manager if you want them to match. */ @@ -139710,10 +141078,10 @@ declare namespace Phaser { * Whether the Timeline is paused (`true`) or active (`false`). * * When paused, the Timeline will not run any of its actions. - * + * * By default a Timeline is always paused and should be started by * calling the `Timeline.play` method. - * + * * You can use the `Timeline.pause` and `Timeline.resume` methods to control * this value in a chainable way. */ @@ -139721,12 +141089,12 @@ declare namespace Phaser { /** * Whether the Timeline is complete (`true`) or not (`false`). - * + * * A Timeline is considered complete when all of its events have been run. - * + * * If you wish to reset a Timeline after it has completed, you can do so * by calling the `Timeline.reset` method. - * + * * You can also use the `Timeline.stop` method to stop a running Timeline, * at any point, without resetting it. */ @@ -139734,9 +141102,9 @@ declare namespace Phaser { /** * The total number of events that have been run. - * + * * This value is reset to zero if the Timeline is restarted. - * + * * Treat this as read-only. */ totalComplete: number; @@ -139750,7 +141118,7 @@ declare namespace Phaser { /** * The number of times this Timeline has looped. - * + * * This value is incremented each loop if looping is enabled. */ iteration: number; @@ -139769,19 +141137,19 @@ declare namespace Phaser { /** * Called automatically by the Scene update step. - * + * * Iterates through all of the Timeline Events and checks to see if they should be run. * * If they should be run, then the event's callbacks and actions are invoked. * * If the `TimelineEvent.once` property is `true` then the event is removed from the Timeline. - * + * * If the `TimelineEvent.event` property is set then the Timeline emits that event. - * + * * If the `TimelineEvent.run` property is set then the Timeline invokes that method. - * + * * If the `TimelineEvent.loop` property is set then the Timeline invokes that method when repeated. - * + * * If the `TimelineEvent.target` property is set then the Timeline invokes the `run` method on that target. * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. @@ -139790,10 +141158,10 @@ declare namespace Phaser { /** * Starts this Timeline running. - * + * * If the Timeline is already running and the `fromStart` parameter is `true`, * then calling this method will reset the Timeline events as incomplete. - * + * * If you wish to resume a paused Timeline, then use the `Timeline.resume` method instead. * @param fromStart Reset this Timeline back to the start before playing. Default true. * @returns This Timeline instance. @@ -139802,9 +141170,9 @@ declare namespace Phaser { /** * Pauses this Timeline. - * + * * To resume it again, call the `Timeline.resume` method or set the `Timeline.paused` property to `false`. - * + * * If the Timeline is paused while processing the current game step, then it * will carry on with all events that are due to run during that step and pause * from the next game step. @@ -139816,7 +141184,7 @@ declare namespace Phaser { /** * Repeats this Timeline. - * + * * If the value for `amount` is positive, the Timeline will repeat that many additional times. * For example a value of 1 will actually run this Timeline twice. * @@ -139831,7 +141199,7 @@ declare namespace Phaser { /** * Resumes this Timeline from a paused state. - * + * * The Timeline will carry on from where it left off. * * If you need to reset the Timeline to the start, then call the `Timeline.reset` method.undefined @@ -139841,7 +141209,7 @@ declare namespace Phaser { /** * Stops this Timeline. - * + * * This will set the `paused` and `complete` properties to `true`. * * If you wish to reset the Timeline to the start, then call the `Timeline.reset` method.undefined @@ -139851,12 +141219,12 @@ declare namespace Phaser { /** * Resets this Timeline back to the start. - * + * * This will set the elapsed time to zero and set all events to be incomplete. - * + * * If the Timeline had any events that were set to `once` that have already * been removed, they will **not** be present again after calling this method. - * + * * If the Timeline isn't currently running (i.e. it's paused or complete) then * calling this method resets those states, the same as calling `Timeline.play(true)`. * @@ -139868,9 +141236,9 @@ declare namespace Phaser { /** * Adds one or more events to this Timeline. - * + * * You can pass in a single configuration object, or an array of them: - * + * * ```js * const timeline = this.add.timeline({ * at: 1000, @@ -139903,14 +141271,14 @@ declare namespace Phaser { /** * Returns a number between 0 and 1 representing the progress of this Timeline. - * + * * A value of 0 means the Timeline has just started, 0.5 means it's half way through, * and 1 means it's complete. * * If the Timeline has no events, or all events have been removed, this will return `NaN`. * * If the Timeline is paused, this will return the progress value at the time it was paused. - * + * * Note that the value returned is based on the number of events that have been completed, * not the 'duration' of the events (as this is unknown to the Timeline).undefined * @returns A number between 0 and 1 representing the progress of this Timeline. @@ -139919,11 +141287,11 @@ declare namespace Phaser { /** * Destroys this Timeline. - * + * * This will remove all events from the Timeline and stop it from processing. - * + * * Any Tweens that were currently running as a result of this Timeline will be stopped. - * + * * This method is called automatically when the Scene shuts down, but you may * also call it directly should you need to destroy the Timeline earlier. */ @@ -139933,12 +141301,12 @@ declare namespace Phaser { /** * A Timer Event represents a delayed function call. It's managed by a Scene's {@link Clock} and will call its function after a set amount of time has passed. The Timer Event can optionally repeat - i.e. call its function multiple times before finishing, or loop indefinitely. - * + * * Because it's managed by a Clock, a Timer Event is based on game time, will be affected by its Clock's time scale, and will pause if its Clock pauses. */ class TimerEvent { /** - * + * * @param config The configuration for the Timer Event, including its delay and callback. */ constructor(config: Phaser.Types.Time.TimerEventConfig); @@ -139990,7 +141358,7 @@ declare namespace Phaser { /** * The time in milliseconds which has elapsed since the Timer Event's creation. - * + * * This value is local for the Timer Event and is relative to its Clock. As such, it's influenced by the Clock's time scale and paused state, the Timer Event's initial {@link #startAt} property, and the Timer Event's {@link #timeScale} and {@link #paused} state. */ elapsed: number; @@ -140002,7 +141370,7 @@ declare namespace Phaser { /** * Whether the Timer Event's function has been called. - * + * * When the Timer Event fires, this property will be set to `true` before the callback function is invoked and will be reset immediately afterward if the Timer Event should repeat. The value of this property does not directly influence whether the Timer Event will be removed from its Clock, but can prevent it from firing. */ hasDispatched: boolean; @@ -140078,7 +141446,7 @@ declare namespace Phaser { /** * Destroys all object references in the Timer Event, i.e. its callback, scope, and arguments. - * + * * Normally, this method is only called by the Clock when it shuts down. As such, it doesn't stop the Timer Event. If called manually, the Timer Event will still be updated by the Clock, but it won't do anything when it fires. */ destroy(): void; @@ -140688,7 +142056,7 @@ declare namespace Phaser { /** * Extracts an array of targets from a Tween configuration object. - * + * * The targets will be looked for in a `targets` property. If it's a function, its return value will be used as the result. * @param config The Tween configuration object containing the `targets` property to extract. * @returns An array of targets (may contain only one element), or `null` if no targets were specified. @@ -140697,20 +142065,20 @@ declare namespace Phaser { /** * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. - * + * * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. - * + * * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. * A string can be provided to specify a relative end value which consists of an operation * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current * value, or `/=` to divide the current value) followed by its operand. - * + * * A function can be provided to allow greater control over the end value; it will receive the target * object being tweened, the name of the property being tweened, and the current value of the property * as its arguments and must return a value. - * + * * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` * property is provided, the property will be used as the effective value under the same rules described here. @@ -140738,14 +142106,14 @@ declare namespace Phaser { /** * Creates a Stagger function to be used by a Tween property. - * + * * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. - * + * * This is only worth using if the tween has multiple targets. - * + * * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 * over the duration specified: - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -140755,10 +142123,10 @@ declare namespace Phaser { * delay: this.tweens.stagger(100) * }); * ``` - * + * * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering * from the center out, using a cubic ease. - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -140823,15 +142191,15 @@ declare namespace Phaser { namespace Events { /** * The Tween Active Event. - * + * * This event is dispatched by a Tween when it becomes active within the Tween Manager. - * + * * An 'active' Tween is one that is now progressing, although it may not yet be updating * any target properties, due to settings such as `delay`. If you need an event for when * the Tween starts actually updating its first property, see `TWEEN_START`. - * + * * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.create({ * targets: image, @@ -140842,7 +142210,7 @@ declare namespace Phaser { * tween.on('active', listener); * this.tweens.existing(tween); * ``` - * + * * Note that this event is usually dispatched already by the time you call `this.tweens.add()`, and is * meant for use with `tweens.create()` and/or `tweens.existing()`. */ @@ -140850,16 +142218,16 @@ declare namespace Phaser { /** * The Tween Complete Event. - * + * * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. - * + * * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched * unless the `Tween.stop` method is called. - * + * * If a Tween has a `completeDelay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -140874,18 +142242,18 @@ declare namespace Phaser { /** * The Tween Loop Event. - * + * * This event is dispatched by a Tween when it loops. - * + * * This event will only be dispatched if the Tween has a loop count set. - * + * * If a Tween has a `loopDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -140901,11 +142269,11 @@ declare namespace Phaser { /** * The Tween Pause Event. - * + * * This event is dispatched by a Tween when it is paused. - * + * * Listen to it from a Tween instance using `Tween.on('pause', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -140922,18 +142290,18 @@ declare namespace Phaser { /** * The Tween Repeat Event. - * + * * This event is dispatched by a Tween when one of the properties it is tweening repeats. - * + * * This event will only be dispatched if the Tween has a property with a repeat count set. - * + * * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -140949,11 +142317,11 @@ declare namespace Phaser { /** * The Tween Resume Event. - * + * * This event is dispatched by a Tween when it is resumed from a paused state. - * + * * Listen to it from a Tween instance using `Tween.on('resume', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -140970,15 +142338,15 @@ declare namespace Phaser { /** * The Tween Start Event. - * + * * This event is dispatched by a Tween when it starts tweening its first property. - * + * * A Tween will only emit this event once, as it can only start once. - * + * * If a Tween has a `delay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -140993,11 +142361,11 @@ declare namespace Phaser { /** * The Tween Stop Event. - * + * * This event is dispatched by a Tween when it is stopped. - * + * * Listen to it from a Tween instance using `Tween.on('stop', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -141012,15 +142380,15 @@ declare namespace Phaser { /** * The Tween Update Event. - * + * * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. - * + * * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. - * + * * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. - * + * * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -141035,19 +142403,19 @@ declare namespace Phaser { /** * The Tween Yoyo Event. - * + * * This event is dispatched by a Tween whenever a property it is tweening yoyos. - * + * * This event will only be dispatched if the Tween has a property with `yoyo` set. - * + * * If the Tween has a `hold` value, this event is dispatched when the hold expires. - * + * * This event is dispatched for every property, and for every target, that yoyos. * For example, if a Tween was updating 2 properties and had 10 targets, this event * would be dispatched 20 times (twice per target). So be careful how you use it! - * + * * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -141066,13 +142434,13 @@ declare namespace Phaser { /** * As the name implies, this is the base Tween class that both the Tween and TweenChain * inherit from. It contains shared properties and methods common to both types of Tween. - * + * * Typically you would never instantiate this class directly, although you could certainly * use it to create your own variation of Tweens from. */ class BaseTween extends Phaser.Events.EventEmitter { /** - * + * * @param parent A reference to the Tween Manager, or Tween Chain, that owns this Tween. */ constructor(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.TweenChain); @@ -141085,7 +142453,7 @@ declare namespace Phaser { /** * The main data array. For a Tween, this contains all of the `TweenData` objects, each * containing a unique property and target that is being tweened. - * + * * For a TweenChain, this contains an array of `Tween` instances, which are being played * through in sequence. */ @@ -141098,7 +142466,7 @@ declare namespace Phaser { /** * The time in milliseconds before the 'onStart' event fires. - * + * * For a Tween, this is the shortest `delay` value across all of the TweenDatas it owns. * For a TweenChain, it is whatever delay value was given in the configuration. */ @@ -141106,37 +142474,37 @@ declare namespace Phaser { /** * Has this Tween started playback yet? - * + * * This boolean is toggled when the Tween leaves the 'start delayed' state and begins running. */ readonly hasStarted: boolean; /** * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * + * * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * + * * This value is multiplied by the `TweenManager.timeScale`. */ timeScale: number; /** * The number of times this Tween will loop. - * + * * Can be -1 for an infinite loop, zero for none, or a positive integer. - * + * * Typically this is set in the configuration object, but can also be set directly * as long as this Tween is paused and hasn't started playback. - * + * * When enabled it will play through ALL Tweens again. - * + * * Use TweenData.repeat to loop a single element. */ loop: number; /** * The time in milliseconds before the Tween loops. - * + * * Only used if `loop` is > 0. */ loopDelay: number; @@ -141148,7 +142516,7 @@ declare namespace Phaser { /** * The time in milliseconds before the 'onComplete' event fires. - * + * * This never fires if `loop = -1` as it never completes because it has been * set to loop forever. */ @@ -141166,20 +142534,20 @@ declare namespace Phaser { /** * Is the Tween currently paused? - * + * * A paused Tween needs to be started with the `play` method, or resumed with the `resume` method. - * + * * This property can be toggled at runtime if required. */ paused: boolean; /** * An object containing the different Tween callback functions. - * + * * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * + * * The types available are: - * + * * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. @@ -141187,9 +142555,9 @@ declare namespace Phaser { * `onStop` - Invoked only if the `Tween.stop` method is called. * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. - * + * * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. - * + * * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. * `onUpdate` - When a TweenData updates a property on a source target during playback. @@ -141198,7 +142566,7 @@ declare namespace Phaser { /** * The scope (or context) in which all of the callbacks are invoked. - * + * * This defaults to be this Tween, but you can override this property * to set it to whatever object you require. */ @@ -141208,10 +142576,10 @@ declare namespace Phaser { * Will this Tween persist after playback? A Tween that persists will _not_ be destroyed by the * Tween Manager, or when calling `Tween.stop`, and can be re-played as required. You can either * set this property when creating the tween in the tween config, or set it _prior_ to playback. - * + * * However, it's up to you to ensure you destroy persistent tweens when you are finished with them, * or they will retain references you may no longer require and waste memory. - * + * * By default, `Tweens` are set to _not_ persist, so they are automatically cleaned-up by * the Tween Manager. */ @@ -141220,9 +142588,9 @@ declare namespace Phaser { /** * Sets the value of the time scale applied to this Tween. A value of 1 runs in real-time. * A value of 0.5 runs 50% slower, and so on. - * + * * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * + * * This value is multiplied by the `TweenManager.timeScale`. * @param value The time scale value to set. * @returns This Tween instance. @@ -141282,10 +142650,10 @@ declare namespace Phaser { /** * Flags the Tween as being complete, whatever stage of progress it is at. - * + * * If an `onComplete` callback has been defined it will automatically invoke it, unless a `delay` * argument is provided, in which case the Tween will delay for that period of time before calling the callback. - * + * * If you don't need a delay or don't have an `onComplete` callback then call `Tween.stop` instead. * @param delay The time to wait before invoking the complete callback. If zero it will fire immediately. Default 0. * @returns This Tween instance. @@ -141294,10 +142662,10 @@ declare namespace Phaser { /** * Flags the Tween as being complete only once the current loop has finished. - * + * * This is a useful way to stop an infinitely looping tween once a complete cycle is over, * rather than abruptly. - * + * * If you don't have a loop then call `Tween.stop` instead. * @param loops The number of loops that should finish before this tween completes. Zero means complete just the current loop. Default 0. * @returns This Tween instance. @@ -141307,7 +142675,7 @@ declare namespace Phaser { /** * Immediately removes this Tween from the TweenManager and all of its internal arrays, * no matter what stage it is at. Then sets the tween state to `REMOVED`. - * + * * You should dispose of your reference to this tween after calling this method, to * free it from memory. If you no longer require it, call `Tween.destroy()` on it.undefined * @returns This Tween instance. @@ -141316,13 +142684,13 @@ declare namespace Phaser { /** * Stops the Tween immediately, whatever stage of progress it is at. - * + * * If not a part of a Tween Chain it is also flagged for removal by the Tween Manager. - * + * * If an `onStop` callback has been defined it will automatically invoke it. - * + * * The Tween will be removed during the next game frame, but should be considered 'destroyed' from this point on. - * + * * Typically, you cannot play a Tween that has been stopped. If you just wish to pause the tween, not destroy it, * then call the `pause` method instead and use `resume` to continue playback. If you wish to restart the Tween, * use the `restart` or `seek` methods.undefined @@ -141353,11 +142721,11 @@ declare namespace Phaser { /** * Sets an event based callback to be invoked during playback. - * + * * Calling this method will replace a previously set callback for the given type, if any exists. - * + * * The types available are: - * + * * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. @@ -141365,9 +142733,9 @@ declare namespace Phaser { * `onStop` - Invoked only if the `Tween.stop` method is called. * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. - * + * * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. - * + * * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. * `onUpdate` - When a TweenData updates a property on a source target during playback. @@ -141490,13 +142858,13 @@ declare namespace Phaser { * BaseTweenData is the class that the TweenData and TweenFrameData classes * extend from. You should not typically instantiate this class directly, but instead * use it to form your own tween data classes from, should you require it. - * + * * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, * to make it responsible for its own state and updating. */ class BaseTweenData { /** - * + * * @param tween The tween this TweenData instance belongs to. * @param targetIndex The target index within the Tween targets array. * @param delay Function that returns the time in milliseconds before tween will start. @@ -141535,7 +142903,7 @@ declare namespace Phaser { /** * The time, in milliseconds, before this tween will start playing. - * + * * This value is generated by the `getDelay` function. */ delay: number; @@ -141558,11 +142926,11 @@ declare namespace Phaser { /** * The number of times this tween will repeat. - * + * * The tween will always run once regardless of this value, * so a repeat value of '1' will play the tween twice: I.e. the original * play-through and then it repeats that once (1). - * + * * If this value is set to -1 this tween will repeat forever. */ repeat: number; @@ -141728,14 +143096,14 @@ declare namespace Phaser { /** * Internal method that resets this Tween Data entirely, including the progress and elapsed values. - * + * * Called automatically by the parent Tween. Should not be called directly. */ reset(): void; /** * Internal method that handles repeating or yoyo'ing this TweenData. - * + * * Called automatically by `setStateFromStart` and `setStateFromEnd`. * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. * @param setStart Set the TweenData start values? @@ -142528,14 +143896,14 @@ declare namespace Phaser { namespace Array { /** * Adds the given item, or array of items, to the array. - * + * * Each item must be unique within the array. * * The array is modified in-place. The added item, or array of added items, is returned. Returns `null` if no items were added (e.g. the array is already at the limit, or all items already exist in the array). * * You can optionally specify a limit to the maximum size of the array. If the quantity of items being * added will take the array length over this limit, it will stop adding once the limit is reached. - * + * * You can optionally specify a callback to be invoked for each item successfully added to the array. * @param array The array to be added to. * @param item The item, or array of items, to add to the array. Each item must be unique within the array. @@ -142548,16 +143916,16 @@ declare namespace Phaser { /** * Adds the given item, or array of items, to the array starting at the index specified. - * + * * Each item must be unique within the array. - * + * * Existing elements in the array are shifted up. * * The array is modified in-place. The inserted item, or array of inserted items, is returned. Returns `null` if no items were added (e.g. the array is full, or all items were already present). * * You can optionally specify a limit to the maximum size of the array. If the quantity of items being * added will take the array length over this limit, it will stop adding once the limit is reached. - * + * * You can optionally specify a callback to be invoked for each item successfully added to the array. * @param array The array to be added to. * @param item The item, or array of items, to add to the array. @@ -142636,7 +144004,7 @@ declare namespace Phaser { /** * Returns all elements in the array. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. * * For example: `GetAll('visible', true)` would return only elements that have their visible property set to `true`. @@ -142655,14 +144023,14 @@ declare namespace Phaser { /** * Returns the first element in the array. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. * * For example: `GetFirst('visible', true)` would return the first element that had its `visible` property set to `true`. * * Optionally you can specify a start and end index. For example if the array had 100 elements, * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. - * + * * You can also specify a negative `startIndex`, such as `-1`, which would start the search at the end of the array * * You can also specify a negative `startIndex`, such as `-1`, which would start the search at the end of the array @@ -142739,16 +144107,16 @@ declare namespace Phaser { /** * Create an array representing the range of numbers (usually integers), between, and inclusive of, * the given `start` and `end` arguments. For example: - * + * * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` - * + * * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. - * + * * You can optionally provide a prefix and / or suffix string. If given the array will contain * strings, not integers. For example: - * + * * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` * @param start The minimum value the array starts with. @@ -142776,12 +144144,12 @@ declare namespace Phaser { /** * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. - * + * * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; * The k-th element will have the (k - left + 1)th smallest value in [left, right]. - * + * * The array is modified in-place. - * + * * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) * @param arr The array to rearrange in-place. * @param k The k-th element index. @@ -142793,31 +144161,31 @@ declare namespace Phaser { /** * Creates an array populated with a range of values, based on the given arguments and configuration object. - * + * * Range ([a,b,c], [1,2,3]) = * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2,3], qty = 3) = * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * + * * Range ([a,b,c], [1,2,3], repeat x1) = * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * + * * Range ([a], [1,2,3,4,5], random = true) = * a4, a1, a5, a2, a3 - * + * * Range ([a, b], [1,2,3], random = true) = * b3, a2, a1, b1, a3, b2 - * + * * Range ([a, b, c], [1,2,3], randomB = true) = * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * + * * Range ([a], [1,2,3,4,5], yoyo = true) = * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * + * * Range ([a, b], [1,2,3], yoyo = true) = * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 * @param a The first array of range elements. @@ -142829,9 +144197,9 @@ declare namespace Phaser { /** * Removes the given item, or array of items, from the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for each item successfully removed from the array. * @param array The array to be modified. * @param item The item, or array of items, to be removed from the array. @@ -142843,9 +144211,9 @@ declare namespace Phaser { /** * Removes the item from the given position in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. * @param array The array to be modified. * @param index The array index to remove the item from. The index must be in bounds or it will throw an error. @@ -142859,7 +144227,7 @@ declare namespace Phaser { * Removes all items within the given index range from the array. * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. * @param array The array to be modified. * @param startIndex The start index to remove from. @@ -142950,7 +144318,7 @@ declare namespace Phaser { /** * Shuffles the contents of the given array using the Fisher-Yates implementation. - * + * * The original array is modified directly and returned. * @param array The array to shuffle. This array is modified in place. * @returns The shuffled array. @@ -142960,7 +144328,7 @@ declare namespace Phaser { /** * Takes the given array and runs a numeric sort on it, ignoring any non-digits that * may be in the entries. - * + * * You should only run this on arrays containing strings. * @param array The input array of strings. * @returns The sorted input array. @@ -142978,9 +144346,9 @@ declare namespace Phaser { /** * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. - * + * * This is an implementation of merge sort, without recursion. - * + * * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable * @param array The input array to be sorted. * @param compare The comparison function. @@ -143238,9 +144606,9 @@ declare namespace Phaser { namespace Base64 { /** * Converts an ArrayBuffer into a base64 string. - * + * * The resulting string can optionally be a data uri if the `mediaType` argument is provided. - * + * * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. * @param arrayBuffer The Array Buffer to encode. * @param mediaType An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. @@ -143315,7 +144683,7 @@ declare namespace Phaser { * { * x: { randInt: [min, max] } * } - * + * * Random float between min and max: * { * x: { randFloat: [min, max] } @@ -143352,11 +144720,11 @@ declare namespace Phaser { /** * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. - * + * * The key is a string, which can be split based on the use of the period character. - * + * * For example: - * + * * ```javascript * const source = { * lives: 3, @@ -143366,12 +144734,12 @@ declare namespace Phaser { * } * } * } - * + * * const lives = GetValue(source, 'lives', 1); * const width = GetValue(source, 'render.screen.width', 800); * const height = GetValue(source, 'render.screen.height', 600); * ``` - * + * * In the code above, `lives` will be 3 because it's defined at the top level of `source`. * The `width` value will be 1024 because it can be found inside the `render.screen` object. * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. @@ -143453,9 +144821,9 @@ declare namespace Phaser { /** * Sets a value in an object, allowing for dot notation to control the depth of the property. - * + * * For example: - * + * * ```javascript * var data = { * world: { @@ -143465,9 +144833,9 @@ declare namespace Phaser { * } * } * }; - * + * * SetValue(data, 'world.position.y', 300); - * + * * console.log(data.world.position.y); // 300 * ``` * @param source The object to set the value in. @@ -143483,7 +144851,7 @@ declare namespace Phaser { /** * Takes a string and replaces instances of markers with values in the given array. * The markers take the form of `%1`, `%2`, etc. I.e.: - * + * * `Format("The %1 is worth %2 gold", [ 'Sword', 500 ])` * @param string The string containing the replacement markers. * @param values An array containing values that will replace the markers. If no value exists an empty string is inserted instead. @@ -143494,21 +144862,21 @@ declare namespace Phaser { /** * Takes the given string and pads it out, to the length required, using the character * specified. For example if you need a string to be 6 characters long, you can call: - * + * * `pad('bob', 6, '-', 2)` - * + * * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. - * + * * You can also use it to pad numbers (they are always returned as strings): - * + * * `pad(512, 6, '0', 1)` - * + * * Would return: `000512` with the string padded to the left. - * + * * If you don't specify a direction it'll pad to both sides: - * + * * `pad('c64', 7, '*')` - * + * * Would return: `**c64**` * @param str The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. * @param len The total length of the resulting padded string. Default 0. @@ -143520,7 +144888,7 @@ declare namespace Phaser { /** * Takes a string and removes the character at the given index. - * + * * The index is zero based. * @param string The string to be worked on. * @param index The index of the character to be removed. This value is zero-based. @@ -143538,7 +144906,7 @@ declare namespace Phaser { /** * Creates and returns an RFC4122 version 4 compliant UUID. - * + * * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b.undefined * @returns The UUID string. @@ -143642,4 +145010,3 @@ declare module 'phaser' { export = Phaser; } - From 01db825531252e4854fabd4acad15f8b301c4e92 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Thu, 7 May 2026 18:05:55 -0400 Subject: [PATCH 2/3] Add event name for parallel texture units --- src/renderer/events/SET_PARALLEL_TEXTURE_UNITS_EVENT.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/events/SET_PARALLEL_TEXTURE_UNITS_EVENT.js b/src/renderer/events/SET_PARALLEL_TEXTURE_UNITS_EVENT.js index 9423a2d335..dc4db19396 100644 --- a/src/renderer/events/SET_PARALLEL_TEXTURE_UNITS_EVENT.js +++ b/src/renderer/events/SET_PARALLEL_TEXTURE_UNITS_EVENT.js @@ -20,7 +20,7 @@ * The primary consumer of this event is batch render nodes. * * @event Phaser.Renderer.Events#SET_PARALLEL_TEXTURE_UNITS - * @type {string} + * @type {'setparalleltextureunits'} * @since 4.0.0 * * @param {number} units - The number of texture units advised. From b4adc48f3e154a52dc87ba2e74012eca55f1446b Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Thu, 7 May 2026 18:07:18 -0400 Subject: [PATCH 3/3] Re generate types --- types/phaser.d.ts | 11696 +++++++++++++++++++------------------------- 1 file changed, 5167 insertions(+), 6529 deletions(-) diff --git a/types/phaser.d.ts b/types/phaser.d.ts index ed975e6e66..c622e33960 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -168,11 +168,11 @@ declare namespace Phaser { /** * Takes an array of Game Objects and aligns them next to each other. - * + * * The alignment position is controlled by the `position` parameter, which should be one * of the Phaser.Display.Align constants, such as `Phaser.Display.Align.TOP_LEFT`, * `Phaser.Display.Align.TOP_CENTER`, etc. - * + * * The first item isn't moved. The second item is aligned next to the first, * then the third next to the second, and so on. * @param items The array of items to be updated by this action. @@ -186,9 +186,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `angle` property, * and then adds the given value to each of their `angle` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `Angle(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount, in degrees, to be added to the `angle` property. @@ -244,7 +244,7 @@ declare namespace Phaser { * Takes an array of objects and returns the first element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the first item which had the property `scaleX` set to 0.5 and `alpha` set to 1. - * + * * To use this with a Group: `GetFirst(group.getChildren(), compare, index)` * @param items The array of items to be searched by this action. * @param compare The comparison object. Each property in this object will be checked against the items of the array. @@ -257,7 +257,7 @@ declare namespace Phaser { * Takes an array of objects and returns the last element in the array that has properties which match * all of those specified in the `compare` object. For example, if the compare object was: `{ scaleX: 0.5, alpha: 1 }` * then it would return the last item which had the property `scaleX` set to 0.5 and `alpha` set to 1. - * + * * To use this with a Group: `GetLast(group.getChildren(), compare, index)` * @param items The array of items to be searched by this action. * @param compare The comparison object. Each property in this object will be checked against the items of the array. @@ -289,9 +289,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `alpha` property, * and then adds the given value to each of their `alpha` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncAlpha(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `alpha` property. @@ -305,9 +305,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `x` property, * and then adds the given value to each of their `x` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `x` property. @@ -321,9 +321,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, * and then adds the given value to each of them. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncXY(group.getChildren(), x, y, stepX, stepY)` * @param items The array of items to be updated by this action. * @param x The amount to be added to the `x` property. @@ -339,9 +339,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `y` property, * and then adds the given value to each of their `y` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `IncY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `y` property. @@ -354,7 +354,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. - * + * * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param circle The Circle to position the Game Objects on. @@ -393,7 +393,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. - * + * * Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. * If the `shift` parameter is given you can offset where placement begins. * @param items An array of Game Objects. The contents of this array are updated by this Action. @@ -405,7 +405,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. - * + * * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param triangle The Triangle to position the Game Objects on. @@ -416,7 +416,7 @@ declare namespace Phaser { /** * Play an animation on all Game Objects in the array that have an Animation component. - * + * * You can pass either an animation key, or an animation configuration object for more control over the playback. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. @@ -428,9 +428,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then adds the given value to it. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `PropertyValueInc(group.getChildren(), key, value, step)` * @param items The array of items to be updated by this action. * @param key The property to be updated. @@ -445,9 +445,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` * @param items The array of items to be updated by this action. * @param key The property to be updated. @@ -461,7 +461,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations within the Circle. - * + * * If you wish to pass a `Phaser.GameObjects.Circle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param circle The Circle to position the Game Objects within. @@ -471,7 +471,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. - * + * * If you wish to pass a `Phaser.GameObjects.Ellipse` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param ellipse The Ellipse to position the Game Objects within. @@ -481,7 +481,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations on the Line. - * + * * If you wish to pass a `Phaser.GameObjects.Line` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param line The Line to position the Game Objects randomly on. @@ -499,7 +499,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects and positions them at random locations within the Triangle. - * + * * If you wish to pass a `Phaser.GameObjects.Triangle` Shape to this function, you should pass its `geom` property. * @param items An array of Game Objects. The contents of this array are updated by this Action. * @param triangle The Triangle to position the Game Objects within. @@ -510,9 +510,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `rotation` property, * and then adds the given value to each of their `rotation` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `Rotate(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `rotation` property (in radians). @@ -545,9 +545,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have a public `scaleX` property, * and then adds the given value to each of their `scaleX` properties. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `ScaleX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to be added to the `scaleX` property. @@ -561,9 +561,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, * and then adds the given value to each of them. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `ScaleXY(group.getChildren(), scaleX, scaleY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param scaleX The amount to be added to the `scaleX` property. @@ -611,7 +611,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `blendMode` * and then sets it to the given value. - * + * * To use this with a Group: `SetBlendMode(group.getChildren(), value)` * @param items The array of items to be updated by this action. * @param value The Blend Mode to be set. @@ -628,7 +628,7 @@ declare namespace Phaser { * of those with lower values. * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetDepth(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The depth value to assign to each item. @@ -651,9 +651,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetOrigin(group.getChildren(), originX, originY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param originX The amount to set the `originX` property to. @@ -669,9 +669,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `rotation` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetRotation(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to (in radians). @@ -685,9 +685,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScale(group.getChildren(), scaleX, scaleY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param scaleX The amount to set the `scaleX` property to. @@ -735,9 +735,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `scrollFactorX` and `scrollFactorY` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScrollFactor(group.getChildren(), scrollFactorX, scrollFactorY, stepX, stepY)` * @param items The array of items to be updated by this action. * @param scrollFactorX The amount to set the `scrollFactorX` property to. @@ -753,9 +753,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorX` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScrollFactorX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. @@ -769,9 +769,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorY` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetScrollFactorY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. @@ -796,7 +796,7 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `visible` * and then sets it to the given value. - * + * * To use this with a Group: `SetVisible(group.getChildren(), value)` * @param items The array of items to be updated by this action. * @param value The visible state to set on each item. Set to `true` to make items visible, or `false` to hide them. @@ -809,9 +809,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `x` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetX(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The x coordinate, in pixels, to set on each item. @@ -825,9 +825,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` * and then sets them to the given values. - * + * * The optional `stepX` and `stepY` properties are applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetXY(group.getChildren(), x, y, stepX, stepY)` * @param items The array of items to be updated by this action. * @param x The amount to set the `x` property to. @@ -843,9 +843,9 @@ declare namespace Phaser { /** * Takes an array of Game Objects, or any objects that have the public property `y` * and then sets it to the given value. - * + * * The optional `step` property is applied incrementally, multiplied by each item in the array. - * + * * To use this with a Group: `SetY(group.getChildren(), value, step)` * @param items The array of items to be updated by this action. * @param value The amount to set the property to. @@ -861,18 +861,18 @@ declare namespace Phaser { * `y` properties and then iterates through them. As this function iterates, it moves * the position of the current element to be that of the previous entry in the array. * This repeats until all items have been moved. - * + * * The direction controls the order of iteration. A value of 0 (the default) assumes * that the final item in the array is the 'head' item. - * + * * A direction value of 1 assumes that the first item in the array is the 'head' item. - * + * * The position of the 'head' item is set to the x/y values given to this function. * Every other item in the array is then updated, in sequence, to be that of the * previous (or next) entry in the array. - * + * * The final x/y coords are returned, or set in the 'output' Vector2. - * + * * Think of it as being like the game Snake, where the 'head' is moved and then * each body piece is moved into the space of the previous piece. * @param items An array of Game Objects, or objects with public x and y positions. The contents of this array are updated by this Action. @@ -897,15 +897,15 @@ declare namespace Phaser { * based on its position, creating a smooth ease-in/ease-out transition across the items. * * Smoothstep is a sigmoid-like interpolation and clamping function. - * + * * The function depends on three parameters, the input x, the "left edge" * and the "right edge", with the left edge being assumed smaller than the right edge. - * + * * The function receives a real number x as an argument and returns 0 if x is less than * or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly * interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The slope of the * smoothstep function is zero at both edges. - * + * * This is convenient for creating a sequence of transitions using smoothstep to interpolate * each segment as an alternative to using more sophisticated or expensive interpolation techniques. * @param items An array of Game Objects. The contents of this array are updated by this Action. @@ -937,11 +937,11 @@ declare namespace Phaser { /** * Takes an array of Game Objects and then modifies their `property` so the value equals, or is incremented, by the * calculated spread value. - * + * * The spread value is derived from the given `min` and `max` values and the total number of items in the array. - * + * * For example, to cause an array of Sprites to change in alpha from 0 to 1 you could call: - * + * * ```javascript * Phaser.Actions.Spread(itemsArray, 'alpha', 0, 1); * ``` @@ -978,21 +978,21 @@ declare namespace Phaser { namespace Animations { /** * A Frame based Animation. - * + * * Animations in Phaser consist of a sequence of `AnimationFrame` objects, which are managed by * this class, along with properties that impact playback, such as the animation's frame rate * or delay. - * + * * This class contains all of the properties and methods needed to handle playback of the animation * directly to an `AnimationState` instance, which is owned by a Sprite, or similar Game Object. - * + * * You don't typically create an instance of this class directly, but instead go via * either the `AnimationManager` or the `AnimationState` and use their `create` methods, * depending on if you need a global animation, or local to a specific Sprite. */ class Animation { /** - * + * * @param manager A reference to the global Animation Manager * @param key The unique identifying string for this animation. * @param config The Animation configuration. @@ -1250,7 +1250,7 @@ declare namespace Phaser { */ class AnimationFrame { /** - * + * * @param textureKey The key of the Texture this AnimationFrame uses. * @param textureFrame The key of the Frame within the Texture that this AnimationFrame uses. * @param index The index of this AnimationFrame within the Animation sequence. @@ -1346,7 +1346,7 @@ declare namespace Phaser { */ class AnimationManager extends Phaser.Events.EventEmitter { /** - * + * * @param game A reference to the Phaser.Game instance. */ constructor(game: Phaser.Game); @@ -1363,21 +1363,21 @@ declare namespace Phaser { /** * The global time scale of the Animation Manager. - * + * * This scales the time delta between two frames, thus influencing the speed of time for the Animation Manager. */ globalTimeScale: number; /** * The Animations registered in the Animation Manager. - * + * * This map should be modified with the {@link #add} and {@link #create} methods of the Animation Manager. */ protected anims: Phaser.Structs.Map; /** * A list of animation mix times. - * + * * See the {@link #setMix} method for more details. */ mixes: Phaser.Structs.Map; @@ -1399,21 +1399,21 @@ declare namespace Phaser { /** * Adds a mix between two animations. - * + * * Mixing allows you to specify a unique delay between a pairing of animations. - * + * * When playing Animation A on a Game Object, if you then play Animation B, and a * mix exists, it will wait for the specified delay to be over before playing Animation B. - * + * * This allows you to customise smoothing between different types of animation, such * as blending between an idle and a walk state, or a running and a firing state. - * + * * Note that mixing is only applied if you use the `Sprite.play` method. If you opt to use * `playAfterRepeat` or `playAfterDelay` instead, those will take priority and the mix * delay will not be used. - * + * * To update an existing mix, just call this method with the new delay. - * + * * To remove a mix pairing, see the `removeMix` method. * @param animA The string-based key, or instance of, Animation A. * @param animB The string-based key, or instance of, Animation B. @@ -1424,13 +1424,13 @@ declare namespace Phaser { /** * Removes a mix between two animations. - * + * * Mixing allows you to specify a unique delay between a pairing of animations. - * + * * Calling this method lets you remove those pairings. You can either remove * it between `animA` and `animB`, or if you do not provide the `animB` parameter, * it will remove all `animA` mixes. - * + * * If you wish to update an existing mix instead, call the `addMix` method with the * new delay. * @param animA The string-based key, or instance of, Animation A. @@ -1462,7 +1462,7 @@ declare namespace Phaser { /** * Checks to see if the given key is already in use within the Animation Manager or not. - * + * * Animations are global. Keys created in one scene can be used from any other Scene in your game. They are not Scene specific. * @param key The key of the Animation to check. * @returns `true` if the Animation already exists in the Animation Manager, or `false` if the key is available. @@ -1471,41 +1471,41 @@ declare namespace Phaser { /** * Create one, or more animations from a loaded Aseprite JSON file. - * + * * Aseprite is a powerful animated sprite editor and pixel art tool. - * + * * You can find more details at https://www.aseprite.org/ - * + * * To export a compatible JSON file in Aseprite, please do the following: - * + * * 1. Go to "File - Export Sprite Sheet" - * + * * 2. On the **Layout** tab: * 2a. Set the "Sheet type" to "Packed" * 2b. Set the "Constraints" to "None" * 2c. Check the "Merge Duplicates" checkbox - * + * * 3. On the **Sprite** tab: * 3a. Set "Layers" to "Visible layers" * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags - * + * * 4. On the **Borders** tab: * 4a. Check the "Trim Sprite" and "Trim Cells" options * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) - * + * * 5. On the **Output** tab: * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type * 5b. Check "JSON Data" and give your json file a name * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. * 5d. Make sure "Tags" is checked in the Meta options * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. - * + * * 6. Click export - * + * * This was tested with Aseprite 1.2.25. - * + * * This will export a png and json file which you can load using the Aseprite Loader, i.e.: - * + * * ```javascript * function preload () * { @@ -1513,28 +1513,28 @@ declare namespace Phaser { * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); * } * ``` - * + * * Once loaded, you can call this method from within a Scene with the 'atlas' key: - * + * * ```javascript * this.anims.createFromAseprite('paladin'); * ``` - * + * * Any animations defined in the JSON will now be available to use in Phaser and you play them * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, * you can play it in Phaser using that Tag name: - * + * * ```javascript * this.add.sprite(400, 300).play('War Cry'); * ``` - * + * * When calling this method you can optionally provide an array of tag names, and only those animations * will be created. For example: - * + * * ```javascript * this.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); * ``` - * + * * This will only create the 3 animations defined. Note that the tag names are case-sensitive. * @param key The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. * @param tags An array of Tag names. If provided, only animations found in this array will be created. @@ -1545,15 +1545,15 @@ declare namespace Phaser { /** * Creates a new Animation and adds it to the Animation Manager. - * + * * Animations are global. Once created, you can use them in any Scene in your game. They are not Scene specific. - * + * * If an invalid key is given this method will return `false`. - * + * * If you pass the key of an animation that already exists in the Animation Manager, that animation will be returned. - * + * * A brand new animation is only created if the key is valid and not already in use. - * + * * If you wish to re-use an existing key, call `AnimationManager.remove` first, then this method. * @param config The configuration settings for the Animation. * @returns The Animation that was created, or `false` if the key is already in use. @@ -1570,21 +1570,21 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. - * + * * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. - * + * * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. - * + * * Example: - * + * * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', start: 1, end: 6, zeroPad: 4 })`. - * + * * The `end` value tells it to select frames 1 through 6, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'ruby', @@ -1596,7 +1596,7 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Please see the animation examples for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frame names. @@ -1606,23 +1606,23 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. - * + * * If you're working with a texture atlas, see the `generateFrameNames` method instead. - * + * * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. - * + * * Example: - * + * * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: - * + * * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 11 })`. - * + * * The `end` value of 11 tells it to stop after the 12th frame has been added, because it started at zero. - * + * * To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'boom', @@ -1632,15 +1632,15 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. - * + * * To specify an animation in reverse, swap the `start` and `end` values. - * + * * If the frames are not sequential, you may pass an array of frame numbers instead, for example: - * + * * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` - * + * * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frames. @@ -1686,24 +1686,24 @@ declare namespace Phaser { * Takes an array of Game Objects that have an Animation Component and then * starts the given animation playing on them. The start time of each Game Object * is offset, incrementally, by the `stagger` amount. - * + * * For example, if you pass an array with 4 children and a stagger time of 1000, * the delays will be: - * + * * child 1: 1000ms delay * child 2: 2000ms delay * child 3: 3000ms delay * child 4: 4000ms delay - * + * * If you set the `staggerFirst` parameter to `false` they would be: - * + * * child 1: 0ms delay * child 2: 1000ms delay * child 3: 2000ms delay * child 4: 3000ms delay - * + * * You can also set `stagger` to be a negative value. If it was -1000, the above would be: - * + * * child 1: 3000ms delay * child 2: 2000ms delay * child 3: 1000ms delay @@ -1718,7 +1718,7 @@ declare namespace Phaser { /** * Removes an Animation from this Animation Manager, based on the given key. - * + * * This is a global action. Once an Animation has been removed, no Game Objects * can carry on using it. * @param key The key of the animation to remove. @@ -1751,33 +1751,33 @@ declare namespace Phaser { /** * The Animation State Component. - * + * * This component provides features to apply animations to Game Objects. It is responsible for * loading, queuing animations for later playback, mixing between animations and setting * the current animation frame to the Game Object that owns this component. - * + * * This component lives as an instance within any Game Object that has it defined, such as Sprites. - * + * * You can access its properties and methods via the `anims` property, i.e. `Sprite.anims`. - * + * * As well as playing animations stored in the global Animation Manager, this component * can also create animations that are stored locally within it. See the `create` method * for more details. - * + * * Prior to Phaser 3.50 this component was called just `Animation` and lived in the * `Phaser.GameObjects.Components` namespace. It was renamed to `AnimationState` * in 3.50 to help better identify its true purpose when browsing the documentation. */ class AnimationState { /** - * + * * @param parent The Game Object to which this animation component belongs. */ constructor(parent: Phaser.GameObjects.GameObject); /** * The Game Object to which this animation component belongs. - * + * * You can typically access this component from the Game Object * via the `this.anims` property. */ @@ -1795,7 +1795,7 @@ declare namespace Phaser { /** * The Animations stored locally in this Animation component. - * + * * Do not modify the contents of this Map directly, instead use the * `add`, `create` and `remove` methods of this class instead. */ @@ -1813,14 +1813,14 @@ declare namespace Phaser { /** * The current Animation loaded into this Animation component. - * + * * Will be `null` if no animation is yet loaded. */ currentAnim: Phaser.Animations.Animation | null; /** * The current AnimationFrame being displayed by this Animation component. - * + * * Will be `null` if no animation is yet loaded. */ currentFrame: Phaser.Animations.AnimationFrame | null; @@ -1828,34 +1828,34 @@ declare namespace Phaser { /** * The key, instance, or config of the next Animation to be loaded into this Animation component * when the current animation completes. - * + * * Will be `null` if no animation has been queued. */ nextAnim: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig | null; /** * A queue of Animations to be loaded into this Animation component when the current animation completes. - * + * * Populate this queue via the `chain` method. */ nextAnimsQueue: any[]; /** * The Time Scale factor. - * + * * You can adjust this value to modify the passage of time for the animation that is currently * playing. For example, setting it to 2 will make the animation play twice as fast. Or setting * it to 0.5 will slow the animation down. - * + * * You can change this value at run-time, or set it via the `PlayAnimationConfig`. - * + * * Prior to Phaser 3.50 this property was private and called `_timeScale`. */ timeScale: number; /** * The frame rate of playback, of the current animation, in frames per second. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the frame rate, provide a new value in the `PlayAnimationConfig` object. @@ -1864,7 +1864,7 @@ declare namespace Phaser { /** * The duration of the current animation, in milliseconds. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the duration, provide a new value in the `PlayAnimationConfig` object. @@ -1874,7 +1874,7 @@ declare namespace Phaser { /** * The number of milliseconds per frame, not including frame specific modifiers that may be present in the * Animation data. - * + * * This value is calculated when a new animation is loaded into this component and should * be treated as read-only. Changing it will not alter playback speed. */ @@ -1892,36 +1892,36 @@ declare namespace Phaser { /** * The delay before starting playback of the current animation, in milliseconds. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the delay, provide a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_delay`. */ delay: number; /** * The number of times to repeat playback of the current animation. - * + * * If -1, it means the animation will repeat forever. - * + * * This value is set when a new animation is loaded into this component and should * be treated as read-only, as changing it once playback has started will not alter * the animation. To change the number of repeats, provide a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_repeat`. */ repeat: number; /** * The number of milliseconds to wait before starting the repeat playback of the current animation. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time. - * + * * You can change the repeat delay by providing a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_repeatDelay`. */ repeatDelay: number; @@ -1930,12 +1930,12 @@ declare namespace Phaser { * Should the current animation yoyo? An animation that yoyos will play in reverse, from the end * to the start, before then repeating or completing. An animation that does not yoyo will just * play from the start to the end. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time. - * + * * You can change the yoyo by providing a new value in the `PlayAnimationConfig` object. - * + * * Prior to Phaser 3.50 this property was private and called `_yoyo`. */ yoyo: boolean; @@ -1945,7 +1945,7 @@ declare namespace Phaser { * controls when the first frame is set on the Sprite. If this property * is 'false' then the frame is set only after the delay has expired. * This is the default behavior. - * + * * If this property is 'true' then the first frame of this animation * is set immediately, and then when the delay expires, playback starts. */ @@ -1953,9 +1953,9 @@ declare namespace Phaser { /** * Should the GameObject's `visible` property be set to `true` when the animation starts to play? - * + * * This will happen _after_ any delay that may have been set. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time, assuming the animation is currently delayed. */ @@ -1963,7 +1963,7 @@ declare namespace Phaser { /** * Should the GameObject's `visible` property be set to `false` when the animation completes? - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time, assuming the animation is still actively playing. */ @@ -1978,28 +1978,28 @@ declare namespace Phaser { * An internal trigger that tells the component if it should plays the animation * in reverse mode ('true') or not ('false'). This is used because `forward` can * be changed by the `yoyo` feature. - * + * * Prior to Phaser 3.50 this property was private and called `_reverse`. */ inReverse: boolean; /** * Internal time overflow accumulator. - * + * * This has the `delta` time added to it as part of the `update` step. */ accumulator: number; /** * The time point at which the next animation frame will change. - * + * * This value is compared against the `accumulator` as part of the `update` step. */ nextTick: number; /** * A counter keeping track of how much delay time, in milliseconds, is left before playback begins. - * + * * This is set via the `playAfterDelay` method, although it can be modified at run-time * if required, as long as the animation has not already started playing. */ @@ -2007,7 +2007,7 @@ declare namespace Phaser { /** * A counter that keeps track of how many repeats are left to run. - * + * * This value is set when a new animation is loaded into this component, but can also be modified * at run-time. */ @@ -2020,16 +2020,16 @@ declare namespace Phaser { /** * Sets an animation, or an array of animations, to be played in the future, after the current one completes or stops. - * + * * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, * or have one of the `stop` methods called. - * + * * An animation set to repeat forever will never enter a completed state unless stopped. - * + * * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` event). - * + * * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. - * + * * Call this method with no arguments to reset all currently chained animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. * @returns The Game Object that owns this Animation Component. @@ -2075,14 +2075,14 @@ declare namespace Phaser { /** * Waits for the specified delay, in milliseconds, then starts playback of the given animation. - * + * * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. - * + * * If an animation is already running and a new animation is given to this method, it will wait for * the given delay before starting the new animation. - * + * * If no animation is currently running, the given one begins after the delay. - * + * * Prior to Phaser 3.50 this method was called 'delayedPlay' and the parameters were in the reverse order. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param delay The delay, in milliseconds, to wait before starting the animation playing. @@ -2093,10 +2093,10 @@ declare namespace Phaser { /** * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback * of the given animation. - * + * * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an * idle animation to a walking animation, by making them blend smoothly into each other. - * + * * If no animation is currently running, the given one will start immediately. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param repeatCount How many times should the animation repeat before the next one starts? Default 1. @@ -2106,15 +2106,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -2122,37 +2122,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).play('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If this animation is already playing then ignore this call. Default false. @@ -2162,15 +2162,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite, in reverse. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -2178,37 +2178,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).playReverse('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. @@ -2232,7 +2232,7 @@ declare namespace Phaser { /** * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. - * + * * The value is based on the current frame and how far that is in the animation, it is not based on * the duration of the animation.undefined * @returns The progress of the current animation in frames, between 0 and 1. @@ -2241,9 +2241,9 @@ declare namespace Phaser { /** * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. - * + * * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. - * + * * The value is based on the current frame and how far that is in the animation, it is not based on * the duration of the animation. * @param value The progress value, between 0 and 1. Default 0. @@ -2254,10 +2254,10 @@ declare namespace Phaser { /** * Sets the number of times that the animation should repeat after its first play through. * For example, if repeat is 1, the animation will play a total of twice: the initial play plus 1 repeat. - * + * * To repeat indefinitely, use -1. * The value should always be an integer. - * + * * Calling this method only works if the animation is already running. Otherwise, any * value specified here will be overwritten when the next animation loads in. To avoid this, * use the `repeat` property of the `PlayAnimationConfig` object instead. @@ -2275,11 +2275,11 @@ declare namespace Phaser { /** * Restarts the current animation from its beginning. - * + * * You can optionally reset the delay and repeat counters as well. - * + * * Calling this will fire the `ANIMATION_RESTART` event immediately. - * + * * If you `includeDelay` then it will also fire the `ANIMATION_START` event once * the delay has expired, otherwise, playback will just begin immediately. * @param includeDelay Whether to include the delay value of the animation when restarting. Default false. @@ -2290,9 +2290,9 @@ declare namespace Phaser { /** * The current animation has completed. This dispatches the `ANIMATION_COMPLETE` event. - * + * * This method is called by the Animation instance and should not usually be invoked directly. - * + * * If no animation is loaded, no events will be dispatched. * * If another animation has been queued for playback, it will be started after the events fire.undefined @@ -2302,7 +2302,7 @@ declare namespace Phaser { /** * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. * * If there is another animation in the queue (set via the `chain` method) then it will start playing.undefined @@ -2312,11 +2312,11 @@ declare namespace Phaser { /** * Stops the current animation from playing after the specified time delay, given in milliseconds. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param delay The number of milliseconds to wait before stopping this animation. @@ -2326,14 +2326,14 @@ declare namespace Phaser { /** * Stops the current animation from playing when it next repeats. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. - * + * * Prior to Phaser 3.50 this method was called `stopOnRepeat` and had no parameters. * @param repeatCount How many times should the animation repeat before stopping? Default 1. * @returns The Game Object that owns this Animation Component. @@ -2343,11 +2343,11 @@ declare namespace Phaser { /** * Stops the current animation from playing when it next sets the given frame. * If this frame doesn't exist within the animation it will not stop it from playing. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param frame The frame to check before stopping this animation. @@ -2364,7 +2364,7 @@ declare namespace Phaser { /** * The internal update loop for the AnimationState Component. - * + * * This is called automatically by the `Sprite.preUpdate` method. * @param time The current timestamp. * @param delta The delta time, in ms, elapsed since the last frame. @@ -2382,7 +2382,7 @@ declare namespace Phaser { /** * Advances the animation to the next frame, regardless of the time or animation state. * If the animation is set to repeat, or yoyo, this will still take effect. - * + * * Calling this does not change the direction of the animation. I.e. if it was currently * playing in reverse, calling this method doesn't then change the direction to forwards.undefined * @returns The Game Object this Animation Component belongs to. @@ -2392,7 +2392,7 @@ declare namespace Phaser { /** * Advances the animation to the previous frame, regardless of the time or animation state. * If the animation is set to repeat, or yoyo, this will still take effect. - * + * * Calling this does not change the direction of the animation. I.e. if it was currently * playing in forwards, calling this method doesn't then change the direction to backwards.undefined * @returns The Game Object this Animation Component belongs to. @@ -2401,7 +2401,7 @@ declare namespace Phaser { /** * Get an Animation instance that has been created locally on this Sprite. - * + * * See the `create` method for more details. * @param key The key of the Animation to retrieve. * @returns The Animation, or `null` if the key is invalid. @@ -2417,19 +2417,19 @@ declare namespace Phaser { /** * Creates a new Animation that is local specifically to this Sprite. - * + * * When a Sprite owns an animation, it is kept out of the global Animation Manager, which means * you're free to use keys that may be already defined there. Unless you specifically need a Sprite * to have a unique animation, you should favor using global animations instead, as they allow for * the same animation to be used across multiple Sprites, saving on memory. However, if this Sprite * is the only one to use this animation, it's sensible to create it here. - * + * * If an invalid key is given this method will return `false`. - * + * * If you pass the key of an animation that already exists locally, that animation will be returned. - * + * * A brand new animation is only created if the key is valid and not already in use by this Sprite. - * + * * If you wish to re-use an existing key, call the `remove` method first, then this method. * @param config The configuration settings for the Animation. * @returns The Animation that was created, or `false` if the key is already in use. @@ -2438,41 +2438,41 @@ declare namespace Phaser { /** * Create one, or more animations from a loaded Aseprite JSON file. - * + * * Aseprite is a powerful animated sprite editor and pixel art tool. - * + * * You can find more details at https://www.aseprite.org/ - * + * * To export a compatible JSON file in Aseprite, please do the following: - * + * * 1. Go to "File - Export Sprite Sheet" - * + * * 2. On the **Layout** tab: * 2a. Set the "Sheet type" to "Packed" * 2b. Set the "Constraints" to "None" * 2c. Check the "Merge Duplicates" checkbox - * + * * 3. On the **Sprite** tab: * 3a. Set "Layers" to "Visible layers" * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags - * + * * 4. On the **Borders** tab: * 4a. Check the "Trim Sprite" and "Trim Cells" options * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) - * + * * 5. On the **Output** tab: * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type * 5b. Check "JSON Data" and give your json file a name * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. * 5d. Make sure "Tags" is checked in the Meta options * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. - * + * * 6. Click export - * + * * This was tested with Aseprite 1.2.25. - * + * * This will export a png and json file which you can load using the Aseprite Loader, i.e.: - * + * * ```javascript * function preload () * { @@ -2480,34 +2480,34 @@ declare namespace Phaser { * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); * } * ``` - * + * * Once loaded, you can call this method on a Sprite with the 'atlas' key: - * + * * ```javascript * const sprite = this.add.sprite(400, 300); - * + * * sprite.anims.createFromAseprite('paladin'); * ``` - * + * * Any animations defined in the JSON will now be available to use on this Sprite and you play them * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, * you can play it on the Sprite using that Tag name: - * + * * ```javascript * const sprite = this.add.sprite(400, 300); - * + * * sprite.anims.createFromAseprite('paladin'); - * + * * sprite.play('War Cry'); * ``` - * + * * When calling this method you can optionally provide an array of tag names, and only those animations * will be created. For example: - * + * * ```javascript * sprite.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); * ``` - * + * * This will only create the 3 animations defined. Note that the tag names are case-sensitive. * @param key The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. * @param tags An array of Tag names. If provided, only animations found in this array will be created. @@ -2517,20 +2517,20 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. - * + * * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. - * + * * Example: - * + * * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. - * + * * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'ruby', @@ -2542,7 +2542,7 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Please see the animation examples for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frame names. @@ -2552,20 +2552,20 @@ declare namespace Phaser { /** * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. - * + * * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. - * + * * If you're working with a texture atlas, see the `generateFrameNames` method instead. - * + * * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. * * Example: - * + * * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 11 })`. - * + * * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: - * + * * ```javascript * this.anims.create({ * key: 'boom', @@ -2575,15 +2575,15 @@ declare namespace Phaser { * }) * }); * ``` - * + * * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. - * + * * To specify an animation in reverse, swap the `start` and `end` values. - * + * * If the frames are not sequential, you may pass an array of frame numbers instead, for example: - * + * * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` - * + * * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frames. @@ -2593,7 +2593,7 @@ declare namespace Phaser { /** * Removes a locally created Animation from this Sprite, based on the given key. - * + * * Once an Animation has been removed, this Sprite cannot play it again without re-creating it. * @param key The key of the animation to remove. * @returns The Animation instance that was removed from this Sprite, if the key was valid. @@ -2602,7 +2602,7 @@ declare namespace Phaser { /** * Destroy this Animation component. - * + * * Unregisters event listeners and cleans up its references. */ destroy(): void; @@ -2617,9 +2617,9 @@ declare namespace Phaser { namespace Events { /** * The Add Animation Event. - * + * * This event is dispatched when a new animation is added to the global Animation Manager. - * + * * This can happen either as a result of an animation instance being added to the Animation Manager, * or the Animation Manager creating a new animation directly. */ @@ -2627,206 +2627,206 @@ declare namespace Phaser { /** * The Animation Complete Event. - * + * * This event is dispatched by a Sprite when an animation playing on it completes playback. * This happens when the animation gets to the end of its sequence, factoring in any delays * or repeats it may have to process. - * + * * An animation that is set to loop, or repeat forever, will never fire this event, because * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` * event instead, as this is emitted when the animation is stopped directly. - * + * * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ - const ANIMATION_COMPLETE: string; + const ANIMATION_COMPLETE: 'animationcomplete'; /** * The Animation Complete Dynamic Key Event. - * + * * This event is dispatched by a Sprite when an animation playing on it completes playback. * This happens when the animation gets to the end of its sequence, factoring in any delays * or repeats it may have to process. - * + * * An animation that is set to loop, or repeat forever, will never fire this event, because * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` * event instead, as this is emitted when the animation is stopped directly. - * + * * The difference between this and the `ANIMATION_COMPLETE` event is that this one has a * dynamic event name that contains the name of the animation within it. For example, * if you had an animation called `explode` you could listen for the completion of that * specific animation by using: `sprite.on('animationcomplete-explode', listener)`. Or, if you * wish to use types: `sprite.on(Phaser.Animations.Events.ANIMATION_COMPLETE_KEY + 'explode', listener)`. - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_COMPLETE_KEY: string; /** * The Animation Repeat Event. - * + * * This event is dispatched by a Sprite when an animation repeats playing on it. * This happens if the animation was created, or played, with a `repeat` value specified. - * + * * An animation will repeat when it reaches the end of its sequence. - * + * * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ - const ANIMATION_REPEAT: string; + const ANIMATION_REPEAT: 'animationrepeat'; /** * The Animation Restart Event. - * + * * This event is dispatched by a Sprite when an animation restarts playing on it. * This only happens when the `Sprite.anims.restart` method is called. - * + * * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ - const ANIMATION_RESTART: string; + const ANIMATION_RESTART: 'animationrestart'; /** * The Animation Start Event. - * + * * This event is dispatched by a Sprite when an animation starts playing on it. * This happens when the animation is played, factoring in any delay that may have been specified. * This event happens after the delay has expired and prior to the first update event. - * + * * Listen for it on the Sprite using `sprite.on('animationstart', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ - const ANIMATION_START: string; + const ANIMATION_START: 'animationstart'; /** * The Animation Stop Event. - * + * * This event is dispatched by a Sprite when an animation is stopped on it. An animation * will only be stopped if a method such as `Sprite.stop` or `Sprite.anims.stopAfterDelay` * is called. It can also be emitted if a new animation is started before the current one completes. - * + * * Listen for it on the Sprite using `sprite.on('animationstop', listener)` - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ - const ANIMATION_STOP: string; + const ANIMATION_STOP: 'animationstop'; /** * The Animation Update Event. - * + * * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame. * An animation will change frame based on the frame rate and other factors like `timeScale` and `delay`. It can also change * frame when stopped or restarted. - * + * * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` - * + * * If an animation is playing faster than the game frame-rate can handle, it's entirely possible for it to emit several * update events in a single game frame, so please be aware of this in your code. The **final** event received that frame * is the one that is rendered to the game. - * + * * The animation event flow is as follows: - * + * * 1. `ANIMATION_START` * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) - * + * * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. - * + * * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ - const ANIMATION_UPDATE: string; + const ANIMATION_UPDATE: 'animationupdate'; /** * The Pause All Animations Event. - * + * * This event is dispatched when the global Animation Manager is told to pause. - * + * * When this happens all current animations will stop updating, although it doesn't necessarily mean * that the game has paused as well. */ - const PAUSE_ALL: string; + const PAUSE_ALL: 'pauseall'; /** * The Remove Animation Event. - * + * * This event is dispatched when an animation is removed from the global Animation Manager. */ - const REMOVE_ANIMATION: string; + const REMOVE_ANIMATION: 'remove'; /** * The Resume All Animations Event. - * + * * This event is dispatched when the global Animation Manager resumes, having been previously paused. - * + * * When this happens all current animations will continue updating again. */ - const RESUME_ALL: string; + const RESUME_ALL: 'resumeall'; } @@ -2843,7 +2843,7 @@ declare namespace Phaser { class BaseCache { /** * The Map in which the cache objects are stored. - * + * * You can query the Map directly or use the BaseCache methods. */ entries: Phaser.Structs.Map; @@ -2912,7 +2912,7 @@ declare namespace Phaser { /** * The Cache Manager is the global cache owned and maintained by the Game instance. - * + * * Various systems, such as the file Loader, rely on this cache in order to store the files * they have loaded. The manager itself doesn't store any files, but instead owns multiple BaseCache * instances, one per type of file. Built-in caches are provided for binary files, bitmap fonts, @@ -2923,7 +2923,7 @@ declare namespace Phaser { */ class CacheManager { /** - * + * * @param game A reference to the Phaser.Game instance that owns this CacheManager. */ constructor(game: Phaser.Game); @@ -3020,17 +3020,17 @@ declare namespace Phaser { namespace Events { /** * The Cache Add Event. - * + * * This event is dispatched by any Cache that extends the BaseCache each time a new object is added to it. */ - const ADD: string; + const ADD: 'add'; /** * The Cache Remove Event. - * + * * This event is dispatched by any Cache that extends the BaseCache each time an object is removed from it. */ - const REMOVE: string; + const REMOVE: 'remove'; } @@ -3040,34 +3040,34 @@ declare namespace Phaser { namespace Scene2D { /** * A Base Camera class. - * + * * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, * and can be positioned, rotated, zoomed and scrolled accordingly. - * + * * A Camera consists of two elements: The viewport and the scroll values. - * + * * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are * created the same size as your game, but their position and size can be set to anything. This means if you * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). - * + * * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the * viewport, and changing the viewport has no impact on the scrolling. - * + * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. - * + * * The Base Camera is extended by the Camera class, which adds in special effects including Fade, * Flash and Camera Shake, as well as the ability to follow Game Objects. - * + * * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate * to when they were added to the Camera class. */ class BaseCamera extends Phaser.Events.EventEmitter implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.Visible { /** - * + * * @param x The x position of the Camera, relative to the top-left of the game canvas. * @param y The y position of the Camera, relative to the top-left of the game canvas. * @param width The width of the Camera, in pixels. @@ -3113,7 +3113,7 @@ declare namespace Phaser { /** * Is this Camera visible or not? - * + * * A visible camera will render and perform input tests. * An invisible camera will not render anything and will skip input tests. */ @@ -3121,7 +3121,7 @@ declare namespace Phaser { /** * Is this Camera using a bounds to restrict scrolling movement? - * + * * Set this property along with the bounds via `Camera.setBounds`. */ useBounds: boolean; @@ -3136,7 +3136,7 @@ declare namespace Phaser { /** * Is this Camera dirty? - * + * * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame. * * This flag is cleared during rendering with the new values. @@ -3178,9 +3178,9 @@ declare namespace Phaser { /** * The mid-point of the Camera in 'world' coordinates. - * + * * Use it to obtain exactly where in the world the center of the camera is currently looking. - * + * * This value is updated in the preRender method, after the scroll values and follower * have been processed. */ @@ -3188,24 +3188,24 @@ declare namespace Phaser { /** * The horizontal origin of rotation for this Camera. - * + * * By default the camera rotates around the center of the viewport. - * + * * Changing the origin allows you to adjust the point in the viewport from which rotation happens. * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. - * + * * See `setOrigin` to set both origins in a single, chainable call. */ originX: number; /** * The vertical origin of rotation for this Camera. - * + * * By default the camera rotates around the center of the viewport. - * + * * Changing the origin allows you to adjust the point in the viewport from which rotation happens. * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. - * + * * See `setOrigin` to set both origins in a single, chainable call. */ originY: number; @@ -3219,9 +3219,9 @@ declare namespace Phaser { /** * This array is populated with all of the Game Objects that this Camera has rendered * in the previous (or current, depending on when you inspect it) frame. - * + * * It is cleared at the start of `Camera.preUpdate`, or if the Camera is destroyed. - * + * * You should not modify this array as it is used internally by the input system, * however you can read it as required. Note that Game Objects may appear in this * list multiple times if they belong to multiple non-exclusive Containers. @@ -3244,7 +3244,7 @@ declare namespace Phaser { /** * Can this Camera render rounded pixel values? - * + * * This property is updated during the `preRender` method and should not be * set directly. It is set based on the `roundPixels` property of the Camera * combined with the zoom level. If the zoom is an integer then the WebGL @@ -3271,11 +3271,11 @@ declare namespace Phaser { /** * Sets the rotation origin of this Camera. - * + * * The values are given in the range 0 to 1 and are only used when calculating Camera rotation. - * + * * By default the camera rotates around the center of the viewport. - * + * * Changing the origin allows you to adjust the point in the viewport from which rotation happens. * A value of 0 would rotate from the top-left of the viewport. A value of 1 from the bottom right. * @param x The horizontal origin value. Default 0.5. @@ -3381,7 +3381,7 @@ declare namespace Phaser { /** * Set the rotation of this Camera. This causes everything it renders to appear rotated. - * + * * Rotating a camera does not rotate the viewport itself, it is applied during rendering. * @param value The camera's angle of rotation, given in degrees. Default 0. * @returns This Camera instance. @@ -3390,10 +3390,10 @@ declare namespace Phaser { /** * Sets the background color for this Camera. - * + * * By default a Camera has a transparent background but it can be given a solid color, with any level * of transparency, via this method. - * + * * The color value can be specified using CSS color notation, hex or numbers. * @param color The color value. In CSS, hex or numeric color notation. Default 'rgba(0,0,0,0)'. * @returns This Camera instance. @@ -3402,15 +3402,15 @@ declare namespace Phaser { /** * Set the bounds of the Camera. The bounds are an axis-aligned rectangle. - * + * * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the * edges and into blank space. It does not limit the placement of Game Objects, or where * the Camera viewport can be positioned. - * + * * Temporarily disable the bounds by changing the boolean `Camera.useBounds`. - * + * * Clear the bounds entirely by calling `Camera.removeBounds`. - * + * * If you set bounds that are smaller than the viewport it will stop the Camera from being * able to scroll. The bounds can be positioned where-ever you wish. By default they are from * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of @@ -3439,9 +3439,9 @@ declare namespace Phaser { /** * Returns a rectangle containing the bounds of the Camera. - * + * * If the Camera does not have any bounds the rectangle will be empty. - * + * * The rectangle is a copy of the bounds, so is safe to modify. * @param out An optional Rectangle to store the bounds in. If not given, a new Rectangle will be created. * @returns A rectangle containing the bounds of this Camera. @@ -3458,7 +3458,7 @@ declare namespace Phaser { /** * Set the position of the Camera viewport within the game. - * + * * This does not change where the camera is 'looking'. See `setScroll` to control that. * @param x The top-left x coordinate of the Camera viewport. * @param y The top-left y coordinate of the Camera viewport. Default x. @@ -3468,7 +3468,7 @@ declare namespace Phaser { /** * Set the rotation of this Camera. This causes everything it renders to appear rotated. - * + * * Rotating a camera does not rotate the viewport itself, it is applied during rendering. * @param value The rotation of the Camera, in radians. Default 0. * @returns This Camera instance. @@ -3477,7 +3477,7 @@ declare namespace Phaser { /** * Should the Camera round pixel values to whole integers when rendering Game Objects? - * + * * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing. * @param value `true` to round Camera pixels, `false` to not. * @returns This Camera instance. @@ -3496,7 +3496,7 @@ declare namespace Phaser { * Set the position of where the Camera is looking within the game. * You can also modify the properties `Camera.scrollX` and `Camera.scrollY` directly. * Use this method, or the scroll properties, to move your camera around the game world. - * + * * This does not change where the camera viewport is placed. See `setPosition` to control that. * @param x The x coordinate of the Camera in the game world. * @param y The y coordinate of the Camera in the game world. Default x. @@ -3506,7 +3506,7 @@ declare namespace Phaser { /** * Set the size of the Camera viewport. - * + * * By default a Camera is the same size as the game, but can be made smaller via this method, * allowing you to create mini-cam style effects by creating and positioning a smaller Camera * viewport within your game. @@ -3518,11 +3518,11 @@ declare namespace Phaser { /** * This method sets the position and size of the Camera viewport in a single call. - * + * * If you're trying to change where the Camera is looking at in your game, then see * the method `Camera.setScroll` instead. This method is for changing the viewport * itself, not what the camera can see. - * + * * By default a Camera is the same size as the game, but can be made smaller via this method, * allowing you to create mini-cam style effects by creating and positioning a smaller Camera * viewport within your game. @@ -3546,14 +3546,14 @@ declare namespace Phaser { /** * Set the zoom value of the Camera. - * + * * Changing to a smaller value, such as 0.5, will cause the camera to 'zoom out'. * Changing to a larger value, such as 2, will cause the camera to 'zoom in'. - * + * * A value of 1 means 'no zoom' and is the default. - * + * * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. - * + * * As of Phaser 3.50 you can now set the horizontal and vertical zoom values independently. * @param x The horizontal zoom value of the Camera. The minimum it can be is 0.001. Default 1. * @param y The vertical zoom value of the Camera. The minimum it can be is 0.001. Default x. @@ -3569,7 +3569,7 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Camera it will be immediately replaced. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Camera will use when rendering. @@ -3587,7 +3587,7 @@ declare namespace Phaser { /** * Sets the visibility of this Camera. - * + * * An invisible Camera will skip rendering and input tests of everything it can see. * @param value The visible state of the Camera. * @returns This Camera instance. @@ -3617,9 +3617,9 @@ declare namespace Phaser { /** * Destroys this Camera instance and its internal properties and references. * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager. - * + * * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default. - * + * * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction, * rather than calling this method directly. */ @@ -3641,7 +3641,7 @@ declare namespace Phaser { /** * The width of the Camera viewport, in pixels. - * + * * The viewport is the area into which the Camera renders. Setting the viewport does * not restrict where the Camera can scroll to. */ @@ -3649,7 +3649,7 @@ declare namespace Phaser { /** * The height of the Camera viewport, in pixels. - * + * * The viewport is the area into which the Camera renders. Setting the viewport does * not restrict where the Camera can scroll to. */ @@ -3657,63 +3657,63 @@ declare namespace Phaser { /** * The horizontal scroll position of this Camera. - * + * * Change this value to cause the Camera to scroll around your Scene. - * + * * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, * will automatically adjust the Camera scroll values accordingly. - * + * * You can set the bounds within which the Camera can scroll via the `setBounds` method. */ scrollX: number; /** * The vertical scroll position of this Camera. - * + * * Change this value to cause the Camera to scroll around your Scene. - * + * * Alternatively, setting the Camera to follow a Game Object, via the `startFollow` method, * will automatically adjust the Camera scroll values accordingly. - * + * * You can set the bounds within which the Camera can scroll via the `setBounds` method. */ scrollY: number; /** * The Camera zoom value. Change this value to zoom in, or out of, a Scene. - * + * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel * now takes up 2 pixels when rendered. - * + * * Set to 1 to return to the default zoom level. - * + * * Be careful to never set this value to zero. */ zoom: number; /** * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. - * + * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel * now takes up 2 pixels when rendered. - * + * * Set to 1 to return to the default zoom level. - * + * * Be careful to never set this value to zero. */ zoomX: number; /** * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. - * + * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel * now takes up 2 pixels when rendered. - * + * * Set to 1 to return to the default zoom level. - * + * * Be careful to never set this value to zero. */ zoomY: number; @@ -3730,10 +3730,10 @@ declare namespace Phaser { /** * The displayed width of the camera viewport, factoring in the camera zoom level. - * + * * If a camera has a viewport width of 800 and a zoom of 0.5 then its display width * would be 1600, as it's displaying twice as many pixels as zoom level 1. - * + * * Equally, a camera with a width of 800 and zoom of 2 would have a display width * of 400 pixels. */ @@ -3741,10 +3741,10 @@ declare namespace Phaser { /** * The displayed height of the camera viewport, factoring in the camera zoom level. - * + * * If a camera has a viewport height of 600 and a zoom of 0.5 then its display height * would be 1200, as it's displaying twice as many pixels as zoom level 1. - * + * * Equally, a camera with a height of 600 and zoom of 2 would have a display height * of 300 pixels. */ @@ -3768,9 +3768,9 @@ declare namespace Phaser { * * The Camera is the way in which all games are rendered in Phaser. They provide a view into your game world, * and can be positioned, rotated, zoomed and scrolled accordingly. - * + * * A Camera consists of two elements: The viewport and the scroll values. - * + * * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are * created the same size as your game, but their position and size can be set to anything. This means if you * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, @@ -3784,10 +3784,10 @@ declare namespace Phaser { * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the * viewport, and changing the viewport has no impact on the scrolling. - * + * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. - * + * * A Camera also has built-in special effects including Fade, Flash and Camera Shake. * * You can apply full-camera filters. @@ -3797,7 +3797,7 @@ declare namespace Phaser { */ class Camera extends Phaser.Cameras.Scene2D.BaseCamera { /** - * + * * @param x The x position of the Camera, relative to the top-left of the game canvas. * @param y The y position of the Camera, relative to the top-left of the game canvas. * @param width The width of the Camera, in pixels. @@ -3864,14 +3864,14 @@ declare namespace Phaser { /** * The linear interpolation value to use when following a target. - * + * * Can also be set via `setLerp` or as part of the `startFollow` call. * * The default value of 1 means the camera will instantly snap to the target coordinates. * A lower value, such as 0.1 means the camera will more slowly track the target, giving * a smooth transition. You can set the horizontal and vertical values independently, and also * adjust this value in real-time during your game. - * + * * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. */ lerp: Phaser.Math.Vector2; @@ -3885,20 +3885,20 @@ declare namespace Phaser { /** * The Camera dead zone. - * + * * The deadzone is only used when the camera is following a target. - * + * * It defines a rectangular region within which if the target is present, the camera will not scroll. * If the target moves outside of this area, the camera will begin scrolling in order to follow it. - * + * * The `lerp` values that you can set for a follower target also apply when using a deadzone. - * + * * You can directly set this property to be an instance of a Rectangle. Or, you can use the * `setDeadzone` method for a chainable approach. - * + * * The rectangle you provide can have its dimensions adjusted dynamically, however, please * note that its position is updated every frame, as it is constantly re-centered on the cameras mid point. - * + * * Calling `setDeadzone` with no arguments will reset an active deadzone, as will setting this property * to `null`. */ @@ -3906,18 +3906,18 @@ declare namespace Phaser { /** * Sets the Camera dead zone. - * + * * The deadzone is only used when the camera is following a target. - * + * * It defines a rectangular region within which if the target is present, the camera will not scroll. * If the target moves outside of this area, the camera will begin scrolling in order to follow it. - * + * * The deadzone rectangle is re-positioned every frame so that it is centered on the mid-point * of the camera. This allows you to use the object for additional game related checks, such as * testing if an object is within it or not via a Rectangle.contains call. - * + * * The `lerp` values that you can set for a follower target also apply when using a deadzone. - * + * * Calling this method with no arguments will reset an active deadzone. * @param width The width of the deadzone rectangle in pixels. If not specified the deadzone is removed. * @param height The height of the deadzone rectangle in pixels. @@ -4095,12 +4095,12 @@ declare namespace Phaser { /** * Sets the linear interpolation value to use when following a target. - * + * * The default values of 1 means the camera will instantly snap to the target coordinates. * A lower value, such as 0.1 means the camera will more slowly track the target, giving * a smooth transition. You can set the horizontal and vertical values independently, and also * adjust this value in real-time during your game. - * + * * Be sure to keep the value between 0 and 1. A value of zero will disable tracking on that axis. * @param x The horizontal linear interpolation value for the follow target. A value between 0 and 1. Default 1. * @param y The vertical linear interpolation value for the follow target. A value between 0 and 1. Default 1. @@ -4119,13 +4119,13 @@ declare namespace Phaser { /** * Sets the Camera to follow a Game Object. - * + * * When enabled the Camera will automatically adjust its scroll position to keep the target Game Object * in its center. - * + * * You can set the linear interpolation value used in the follow code. * Use low lerp values (such as 0.1) to automatically smooth the camera motion. - * + * * If you find you're getting a slight "jitter" effect when following an object it's probably to do with sub-pixel * rendering of the targets position. This can be rounded by setting the `roundPixels` argument to `true` to * force full pixel rounding rendering. Note that this can still be broken if you have specified a non-integer zoom @@ -4162,7 +4162,7 @@ declare namespace Phaser { /** * Destroys this Camera instance. You rarely need to call this directly. - * + * * Called by the Camera Manager. If you wish to destroy a Camera please use `CameraManager.remove` as * cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that. */ @@ -4180,37 +4180,37 @@ declare namespace Phaser { /** * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras. - * + * * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed * in your game config. - * + * * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add * the new Camera in using the `addExisting` method. - * + * * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly. - * + * * A Camera consists of two elements: The viewport and the scroll values. - * + * * The viewport is the physical position and size of the Camera within your game. Cameras, by default, are * created the same size as your game, but their position and size can be set to anything. This means if you * wanted to create a camera that was 320x200 in size, positioned in the bottom-right corner of your game, * you'd adjust the viewport to do that (using methods like `setViewport` and `setSize`). - * + * * If you wish to change where the Camera is looking in your game, then you scroll it. You can do this * via the properties `scrollX` and `scrollY` or the method `setScroll`. Scrolling has no impact on the * viewport, and changing the viewport has no impact on the scrolling. - * + * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore * Game Objects, make sure it's one of the first 31 created. - * + * * A Camera also has built-in special effects including Fade, Flash, Camera Shake, Pan and Zoom. */ class CameraManager { /** - * + * * @param scene The Scene that owns the Camera Manager plugin. */ constructor(scene: Phaser.Scene); @@ -4245,11 +4245,11 @@ declare namespace Phaser { * A handy reference to the 'main' camera. By default this is the first Camera the * Camera Manager creates. You can also set it directly, or use the `makeMain` argument * in the `add` and `addExisting` methods. It allows you to access it from your game: - * + * * ```javascript * var cam = this.cameras.main; * ``` - * + * * Also see the properties `camera1`, `camera2` and so on. */ main: Phaser.Cameras.Scene2D.Camera; @@ -4264,19 +4264,19 @@ declare namespace Phaser { /** * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras. - * + * * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas. - * + * * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake, * pan and zoom. - * + * * By default Cameras are transparent and will render anything that they can see based on their `scrollX` * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after creation if required. - * + * * See the Camera class documentation for more details. * @param x The horizontal position of the Camera viewport. Default 0. * @param y The vertical position of the Camera viewport. Default 0. @@ -4290,15 +4290,15 @@ declare namespace Phaser { /** * Adds an existing Camera into the Camera Manager. - * + * * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after addition if required. - * + * * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the * manager. As long as it doesn't already exist in the manager it will be added then returned. - * + * * If this method returns `null` then the Camera already exists in this Camera Manager. * @param camera The Camera to be added to the Camera Manager. * @param makeMain Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. Default false. @@ -4308,7 +4308,7 @@ declare namespace Phaser { /** * Gets the total number of Cameras in this Camera Manager. - * + * * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. * @param isVisible Set to `true` to only include visible Cameras in the total. Default false. * @returns The total number of Cameras in this Camera Manager. @@ -4317,7 +4317,7 @@ declare namespace Phaser { /** * Populates this Camera Manager based on the given configuration object, or an array of config objects. - * + * * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure. * @param config A Camera configuration object, or an array of them, to be added to this Camera Manager. * @returns This Camera Manager instance. @@ -4326,7 +4326,7 @@ declare namespace Phaser { /** * Gets a Camera based on its name. - * + * * Camera names are optional and don't have to be set, so this method is only of any use if you * have given your Cameras unique names. * @param name The name of the Camera. @@ -4336,7 +4336,7 @@ declare namespace Phaser { /** * Returns an array of all cameras below the given Pointer. - * + * * The first camera in the array is the top-most camera in the camera list. * @param pointer The Pointer to check against. * @returns An array of cameras below the Pointer. @@ -4345,10 +4345,10 @@ declare namespace Phaser { /** * Removes the given Camera, or an array of Cameras, from this Camera Manager. - * + * * If found in the Camera Manager it will be immediately removed from the local cameras array. * If also currently the 'main' camera, 'main' will be reset to be camera 0. - * + * * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default. * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references * and internal data until destroyed or re-added to a Camera Manager. @@ -4360,7 +4360,7 @@ declare namespace Phaser { /** * The internal render method. This is called automatically by the Scene and should not be invoked directly. - * + * * It will iterate through all local cameras and render them in turn, as long as they're visible and have * an alpha level > 0. * @param renderer The Renderer that will render the children to this camera. @@ -4380,7 +4380,7 @@ declare namespace Phaser { /** * Resets this Camera Manager. - * + * * This will iterate through all current Cameras, destroying them all, then it will reset the * cameras array, reset the ID counter and create 1 new single camera using the default values.undefined * @returns The freshly created main Camera. @@ -4413,18 +4413,18 @@ declare namespace Phaser { namespace Effects { /** * A Camera Fade effect. - * + * * This effect will fade the camera viewport to the given color, over the duration specified. - * + * * Only the camera viewport is faded. None of the objects it is displaying are impacted, i.e. their colors do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect, if required. */ class Fade { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4441,7 +4441,7 @@ declare namespace Phaser { /** * Has this effect finished running? - * + * * This is different from `isRunning` because it remains set to `true` when the effect is over, * until the effect is either reset or started again. */ @@ -4518,18 +4518,18 @@ declare namespace Phaser { /** * A Camera Flash effect. - * + * * This effect will flash the camera viewport to the given color, over the duration specified. - * + * * Only the camera viewport is flashed. None of the objects it is displaying are impacted, i.e. their colors do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect, if required. */ class Flash { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4614,19 +4614,19 @@ declare namespace Phaser { /** * A Camera Pan effect. - * + * * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, * over the duration and with the ease specified. - * + * * Only the camera scroll is moved. None of the objects it is displaying are impacted, i.e. their positions do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect if required. */ class Pan { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4719,22 +4719,22 @@ declare namespace Phaser { * * This effect will rotate the Camera so that its viewport finishes at the given angle in radians, * over the duration and with the ease specified. - * + * * Camera rotation always takes place based on the Camera viewport. By default, rotation happens * in the center of the viewport. You can adjust this with the `originX` and `originY` properties. - * + * * Rotation influences the rendering of _all_ Game Objects visible by this Camera. However, it does not * rotate the Camera viewport itself, which always remains an axis-aligned rectangle. * * Only the camera is rotated. None of the objects it is displaying are impacted, i.e. their positions do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect if required. */ class RotateTo { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4831,18 +4831,18 @@ declare namespace Phaser { /** * A Camera Shake effect. - * + * * This effect will shake the camera viewport by a random amount, bounded by the specified intensity, each frame. - * + * * Only the camera viewport is moved. None of the objects it is displaying are impacted, i.e. their positions do * not change. - * + * * The effect will dispatch several events on the Camera itself and you can also specify an `onUpdate` callback, * which is invoked each frame for the duration of the effect if required. */ class Shake { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -4932,7 +4932,7 @@ declare namespace Phaser { */ class Zoom { /** - * + * * @param camera The camera this effect is acting upon. */ constructor(camera: Phaser.Cameras.Scene2D.Camera); @@ -5016,279 +5016,279 @@ declare namespace Phaser { namespace Events { /** * The Destroy Camera Event. - * + * * This event is dispatched by a Camera instance when it is destroyed by the Camera Manager. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('cameradestroy', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.DESTROY, () => {}); * ``` */ - const DESTROY: string; + const DESTROY: 'cameradestroy'; /** * The Camera Fade In Complete Event. - * + * * This event is dispatched by a Camera instance when the Fade In Effect completes. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeincomplete', listener)`. */ - const FADE_IN_COMPLETE: string; + const FADE_IN_COMPLETE: 'camerafadeincomplete'; /** * The Camera Fade In Start Event. - * + * * This event is dispatched by a Camera instance when the Fade In Effect starts. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeinstart', listener)`. */ - const FADE_IN_START: string; + const FADE_IN_START: 'camerafadeinstart'; /** * The Camera Fade Out Complete Event. - * + * * This event is dispatched by a Camera instance when the Fade Out Effect completes. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeoutcomplete', listener)`. */ - const FADE_OUT_COMPLETE: string; + const FADE_OUT_COMPLETE: 'camerafadeoutcomplete'; /** * The Camera Fade Out Start Event. - * + * * This event is dispatched by a Camera instance when the Fade Out Effect starts. - * + * * Listen to it from a Camera instance using `Camera.on('camerafadeoutstart', listener)`. */ - const FADE_OUT_START: string; + const FADE_OUT_START: 'camerafadeoutstart'; /** * The Camera Flash Complete Event. - * + * * This event is dispatched by a Camera instance when the Flash Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('cameraflashcomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.FLASH_COMPLETE, () => {}); * ``` */ - const FLASH_COMPLETE: string; + const FLASH_COMPLETE: 'cameraflashcomplete'; /** * The Camera Flash Start Event. - * + * * This event is dispatched by a Camera instance when the Flash Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('cameraflashstart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.FLASH_START, () => {}); * ``` */ - const FLASH_START: string; + const FLASH_START: 'cameraflashstart'; /** * The Camera Follower Update Event. - * + * * This event is dispatched by a Camera instance when it is following a * Game Object and the Camera position has been updated as a result of * that following. - * + * * Listen to it from a Camera instance using: `camera.on('followupdate', listener)`. */ - const FOLLOW_UPDATE: string; + const FOLLOW_UPDATE: 'followupdate'; /** * The Camera Pan Complete Event. - * + * * This event is dispatched by a Camera instance when the Pan Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerapancomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.PAN_COMPLETE, () => {}); * ``` */ - const PAN_COMPLETE: string; + const PAN_COMPLETE: 'camerapancomplete'; /** * The Camera Pan Start Event. - * + * * This event is dispatched by a Camera instance when the Pan Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerapanstart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.PAN_START, () => {}); * ``` */ - const PAN_START: string; + const PAN_START: 'camerapanstart'; /** * The Camera Post-Render Event. - * + * * This event is dispatched by a Camera instance after is has finished rendering. * It is dispatched whether the Camera is rendering to a texture or to the main canvas. * * Listen to it from a Camera instance using: `camera.on('postrender', listener)`. */ - const POST_RENDER: string; + const POST_RENDER: 'postrender'; /** * The Camera Pre-Render Event. - * + * * This event is dispatched by a Camera instance when it is about to render. * It is only dispatched if the Camera is rendering to a texture. - * + * * Listen to it from a Camera instance using: `camera.on('prerender', listener)`. */ - const PRE_RENDER: string; + const PRE_RENDER: 'prerender'; /** * The Camera Rotate Complete Event. - * + * * This event is dispatched by a Camera instance when the Rotate Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerarotatecomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ROTATE_COMPLETE, () => {}); * ``` */ - const ROTATE_COMPLETE: string; + const ROTATE_COMPLETE: 'camerarotatecomplete'; /** * The Camera Rotate Start Event. - * + * * This event is dispatched by a Camera instance when the Rotate Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerarotatestart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ROTATE_START, () => {}); * ``` */ - const ROTATE_START: string; + const ROTATE_START: 'camerarotatestart'; /** * The Camera Shake Complete Event. - * + * * This event is dispatched by a Camera instance when the Shake Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerashakecomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.SHAKE_COMPLETE, () => {}); * ``` */ - const SHAKE_COMPLETE: string; + const SHAKE_COMPLETE: 'camerashakecomplete'; /** * The Camera Shake Start Event. - * + * * This event is dispatched by a Camera instance when the Shake Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerashakestart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.SHAKE_START, () => {}); * ``` */ - const SHAKE_START: string; + const SHAKE_START: 'camerashakestart'; /** * The Camera Zoom Complete Event. - * + * * This event is dispatched by a Camera instance when the Zoom Effect completes. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerazoomcomplete', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ZOOM_COMPLETE, () => {}); * ``` */ - const ZOOM_COMPLETE: string; + const ZOOM_COMPLETE: 'camerazoomcomplete'; /** * The Camera Zoom Start Event. - * + * * This event is dispatched by a Camera instance when the Zoom Effect starts. - * + * * Listen for it via either of the following: - * + * * ```js * this.cameras.main.on('camerazoomstart', () => {}); * ``` - * + * * or use the constant, to avoid having to remember the correct event string: - * + * * ```js * this.cameras.main.on(Phaser.Cameras.Scene2D.Events.ZOOM_START, () => {}); * ``` */ - const ZOOM_START: string; + const ZOOM_START: 'camerazoomstart'; } @@ -5312,14 +5312,14 @@ declare namespace Phaser { * speed: float OR { x: 0, y: 0 } * }); * ``` - * + * * Movement is precise and has no 'smoothing' applied to it. - * + * * You must call the `update` method of this controller every frame. */ class FixedKeyControl { /** - * + * * @param config The Fixed Key Control configuration object. */ constructor(config: Phaser.Types.Cameras.Controls.FixedKeyControlConfig); @@ -5410,7 +5410,7 @@ declare namespace Phaser { /** * Applies the results of pressing the control keys to the Camera. - * + * * You must call this every step, it is not called automatically. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -5426,10 +5426,10 @@ declare namespace Phaser { /** * A Smoothed Key Camera Control. - * + * * This allows you to control the movement and zoom of a camera using the defined keys. * Unlike the Fixed Camera Control you can also provide physics values for acceleration, drag and maxSpeed for smoothing effects. - * + * * ```javascript * var controlConfig = { * camera: this.cameras.main, @@ -5445,12 +5445,12 @@ declare namespace Phaser { * maxSpeed: 1.0 * }; * ``` - * + * * You must call the `update` method of this controller every frame. */ class SmoothedKeyControl { /** - * + * * @param config The Smoothed Key Control configuration object. */ constructor(config: Phaser.Types.Cameras.Controls.SmoothedKeyControlConfig); @@ -5561,7 +5561,7 @@ declare namespace Phaser { /** * Applies the results of pressing the control keys to the Camera. - * + * * You must call this every step, it is not called automatically. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ @@ -5655,7 +5655,7 @@ declare namespace Phaser { * for handling the boot process, parsing the configuration values, creating the renderer, * and setting-up all of the global Phaser systems, such as sound and input. * Once that is complete it will start the Scene Manager and then begin the main game loop. - * + * * You should generally avoid accessing any of the systems created by Game, and instead use those * made available to you via the Phaser.Scene Systems class instead. */ @@ -5668,7 +5668,7 @@ declare namespace Phaser { /** * The parsed Game Configuration object. - * + * * The values stored within this object are read-only and should not be changed at run-time. */ readonly config: Phaser.Core.Config; @@ -5680,10 +5680,10 @@ declare namespace Phaser { /** * A reference to an HTML Div Element used as the DOM Element Container. - * + * * Only set if `createDOMContainer` is `true` in the game config (by default it is `false`) and * if you provide a parent element to insert the Phaser Game inside. - * + * * See the DOM Element Game Object for more details. */ domContainer: HTMLDivElement; @@ -5721,21 +5721,21 @@ declare namespace Phaser { /** * An instance of the Animation Manager. - * + * * The Animation Manager is a global system responsible for managing all animations used within your game. */ anims: Phaser.Animations.AnimationManager; /** * An instance of the Texture Manager. - * + * * The Texture Manager is a global system responsible for managing all textures being used by your game. */ textures: Phaser.Textures.TextureManager; /** * An instance of the Cache Manager. - * + * * The Cache Manager is a global system responsible for caching, accessing and releasing external game assets. */ cache: Phaser.Cache.CacheManager; @@ -5749,21 +5749,21 @@ declare namespace Phaser { /** * An instance of the Input Manager. - * + * * The Input Manager is a global system responsible for the capture of browser-level input events. */ input: Phaser.Input.InputManager; /** * An instance of the Scene Manager. - * + * * The Scene Manager is a global system responsible for creating, modifying and updating the Scenes in your game. */ scene: Phaser.Scenes.SceneManager; /** * A reference to the Device inspector. - * + * * Contains information about the device running this game, such as OS, browser vendor and feature support. * Used by various systems to determine capabilities and code paths. */ @@ -5771,23 +5771,23 @@ declare namespace Phaser { /** * An instance of the Scale Manager. - * + * * The Scale Manager is a global system responsible for handling scaling of the game canvas. */ scale: Phaser.Scale.ScaleManager; /** * An instance of the base Sound Manager. - * + * * The Sound Manager is a global system responsible for the playback and updating of all audio in your game. - * + * * You can disable the inclusion of the Sound Manager in your build by toggling the webpack `FEATURE_SOUND` flag. */ sound: Phaser.Sound.NoAudioSoundManager | Phaser.Sound.HTML5AudioSoundManager | Phaser.Sound.WebAudioSoundManager; /** * An instance of the Time Step. - * + * * The Time Step is a global system responsible for setting-up and responding to the browser frame events, processing * them and calculating delta values. It then automatically calls the game step. */ @@ -5795,7 +5795,7 @@ declare namespace Phaser { /** * An instance of the Plugin Manager. - * + * * The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install * those plugins into Scenes as required. */ @@ -5831,9 +5831,9 @@ declare namespace Phaser { /** * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of * Request Animation Frame, or Set Timeout on very old browsers.) - * + * * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. - * + * * It will then render each Scene in turn, via the Renderer. This process emits `prerender` and `postrender` events. * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. @@ -5842,12 +5842,12 @@ declare namespace Phaser { /** * A special version of the Game Step for the HEADLESS renderer only. - * + * * The main Game Step. Called automatically by the Time Step, once per browser frame (typically as a result of * Request Animation Frame, or Set Timeout on very old browsers.) - * + * * The step will update the global managers first, then proceed to update each Scene in turn, via the Scene Manager. - * + * * This process emits `prerender` and `postrender` events, even though nothing actually displays. * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. @@ -5862,9 +5862,9 @@ declare namespace Phaser { /** * This will pause the entire game and emit a `PAUSE` event. - * + * * All of Phaser's internal systems will be paused and the game will not re-render. - * + * * Note that it does not pause any Loader requests that are currently in-flight. */ pause(): void; @@ -5877,7 +5877,7 @@ declare namespace Phaser { /** * This will resume the entire game and emit a `RESUME` event. - * + * * All of Phaser's internal systems will be resumed and the game will start rendering again. */ resume(): void; @@ -5910,7 +5910,7 @@ declare namespace Phaser { /** * Flags this Game instance as needing to be destroyed on the _next frame_, making this an asynchronous operation. - * + * * It will wait until the current frame has completed and then call `runDestroy` internally. * * If you need to react to the game's eventual destruction, listen for the `DESTROY` event. @@ -5934,7 +5934,7 @@ declare namespace Phaser { */ class Config { /** - * + * * @param GameConfig The configuration object for your Phaser Game instance. */ constructor(GameConfig?: Phaser.Types.Core.GameConfig); @@ -6483,11 +6483,11 @@ declare namespace Phaser { /** * The core runner class that Phaser uses to handle the game loop. It can use either Request Animation Frame, * or SetTimeout, based on browser support and config settings, to create a continuous loop within the browser. - * + * * Each time the loop fires, `TimeStep.step` is called and this is then passed onto the core Game update loop, * it is the core heartbeat of your game. It will fire as often as Request Animation Frame is capable of handling * on the target device. - * + * * Note that there are lots of situations where a browser will stop updating your game. Such as if the player * switches tabs, or covers up the browser window with another application. In these cases, the 'heartbeat' * of your game will pause, and only resume when focus is returned to it by the player. There is no way to avoid @@ -6496,7 +6496,7 @@ declare namespace Phaser { */ class TimeStep { /** - * + * * @param game A reference to the Phaser.Game instance that owns this Time Step. * @param config The FPS configuration object, as parsed by the Game Config. */ @@ -6527,7 +6527,7 @@ declare namespace Phaser { /** * The minimum fps rate you want the Time Step to run at. - * + * * Setting this cannot guarantee the browser runs at this rate, it merely influences * the internal timing values to help the Timestep know when it has gone out of sync. */ @@ -6535,7 +6535,7 @@ declare namespace Phaser { /** * The target fps rate for the Time Step to run at. - * + * * Setting this value will not actually change the speed at which the browser runs, that is beyond * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step * is spiraling out of control. @@ -6546,27 +6546,27 @@ declare namespace Phaser { * Enforce a frame rate limit. This forces how often the Game step will run. By default it is zero, * which means it will run at whatever limit the browser (via RequestAnimationFrame) can handle, which * is the optimum rate for fast-action or responsive games. - * + * * However, if you are building a non-game app, like a graphics generator, or low-intensity game that doesn't * require 60fps, then you can lower the step rate via this Game Config value: - * + * * ```js * fps: { * limit: 30 * } * ``` - * + * * Setting this _beyond_ the rate of RequestAnimationFrame will make no difference at all. - * + * * Use it purely to _restrict_ updates in low-intensity situations only. */ fpsLimit: number; /** * Is the FPS rate limited? - * + * * This is set by setting the Game Config `limit` value to a value above zero. - * + * * Consider this property as read-only. */ hasFpsLimit: boolean; @@ -6578,7 +6578,7 @@ declare namespace Phaser { /** * The time at which the next fps rate update will take place. - * + * * When an fps update happens, the `framesThisSecond` value is reset. */ readonly nextFpsUpdate: number; @@ -6601,7 +6601,7 @@ declare namespace Phaser { /** * The time, updated each step by adding the elapsed delta time to the previous value. - * + * * This differs from the `TimeStep.now` value, which is the high resolution time value * as provided by Request Animation Frame. */ @@ -6609,14 +6609,14 @@ declare namespace Phaser { /** * The time at which the game started running. - * + * * This value is adjusted if the game is then paused and resumes. */ startTime: number; /** * The time of the previous step. - * + * * This is typically a high resolution timer value, as provided by Request Animation Frame. */ lastTime: number; @@ -6629,7 +6629,7 @@ declare namespace Phaser { /** * Is the browser currently considered in focus by the Page Visibility API? - * + * * This value is set in the `blur` method, which is called automatically by the Game instance. */ readonly inFocus: boolean; @@ -6656,7 +6656,7 @@ declare namespace Phaser { /** * The maximum number of delta values that are retained in order to calculate a smoothed moving average. - * + * * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. */ deltaSmoothingMax: number; @@ -6664,14 +6664,14 @@ declare namespace Phaser { /** * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually * as a result of switching tabs and regaining focus. - * + * * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. */ panicMax: number; /** * The actual elapsed time in ms between one update and the next. - * + * * Unlike with `delta`, no smoothing, capping, or averaging is applied to this value. * So please be careful when using this value in math calculations. */ @@ -6679,9 +6679,9 @@ declare namespace Phaser { /** * The time, set at the start of the current step. - * + * * This is typically a high resolution timer value, as provided by Request Animation Frame. - * + * * This can differ from the `time` value in that it isn't calculated based on the delta value. */ now: number; @@ -6690,7 +6690,7 @@ declare namespace Phaser { * Apply smoothing to the delta value used within Phaser's internal calculations? * * This can be changed in the Game Config via the `fps.smoothStep` property. The default is `true`. - * + * * Smoothing helps settle down the delta values after browser tab switches, or other situations * which could cause significant delta spikes or dips. By default it has been enabled in Phaser 3 * since the first version, but is now exposed under this property (and the corresponding game config @@ -6733,7 +6733,7 @@ declare namespace Phaser { /** * Takes the delta value and smooths it based on the previous frames. - * + * * Called automatically as part of the step. * @param delta The delta value for this step. * @returns The smoothed delta value. @@ -6746,7 +6746,7 @@ declare namespace Phaser { * moving average of all frames per second, with an alpha of 0.25. This * means that more recent seconds affect the estimated frame rate more than * older seconds. - * + * * When a browser window is NOT minimized, but is covered up (i.e. you're using * another app which has spawned a window over the top of the browser), then it * will start to throttle the raf callback time. It waits for a while, and then @@ -6756,11 +6756,11 @@ declare namespace Phaser { * * When they make the game visible again, the frame rate is increased at a rate of * approx. 8fps, back up to 60fps (or the max it can obtain) - * + * * There is no easy way to determine if this drop in frame rate is because the * browser is throttling raf, or because the game is struggling with performance * because you're asking it to do too much on the device. - * + * * Compute the new exponential moving average with an alpha of 0.25. * @param time The timestamp passed in from RequestAnimationFrame or setTimeout. */ @@ -6851,7 +6851,7 @@ declare namespace Phaser { * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps * tab, or if they simply remove focus from the browser to another app. */ - const BLUR: string; + const BLUR: 'blur'; /** * The Game Boot Event. @@ -6859,7 +6859,7 @@ declare namespace Phaser { * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running. * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required. */ - const BOOT: string; + const BOOT: 'boot'; /** * The Game Context Lost Event. @@ -6868,7 +6868,7 @@ declare namespace Phaser { * * The renderer halts all rendering and cannot resume after this happens. */ - const CONTEXT_LOST: string; + const CONTEXT_LOST: 'contextlost'; /** * The Game Destroy Event. @@ -6877,7 +6877,7 @@ declare namespace Phaser { * Lots of internal systems listen to this event in order to clear themselves out. * Custom plugins and game code should also do the same. */ - const DESTROY: string; + const DESTROY: 'destroy'; /** * The Game Focus Event. @@ -6885,7 +6885,7 @@ declare namespace Phaser { * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it. */ - const FOCUS: string; + const FOCUS: 'focus'; /** * The Game Hidden Event. @@ -6897,14 +6897,14 @@ declare namespace Phaser { * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games) */ - const HIDDEN: string; + const HIDDEN: 'hidden'; /** * The Game Pause Event. * * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler. */ - const PAUSE: string; + const PAUSE: 'pause'; /** * The Game Post-Render Event. @@ -6914,7 +6914,7 @@ declare namespace Phaser { * Every Scene will have rendered and been drawn to the canvas by the time this event is fired. * Use it for any last minute post-processing before the next game step begins. */ - const POST_RENDER: string; + const POST_RENDER: 'postrender'; /** * The Game Post-Step Event. @@ -6922,7 +6922,7 @@ declare namespace Phaser { * This event is dispatched after the Scene Manager has updated. * Hook into it from plugins or systems that need to do things before the render starts. */ - const POST_STEP: string; + const POST_STEP: 'poststep'; /** * The Game Pre-Render Event. @@ -6931,7 +6931,7 @@ declare namespace Phaser { * * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet. */ - const PRE_RENDER: string; + const PRE_RENDER: 'prerender'; /** * The Game Pre-Step Event. @@ -6939,7 +6939,7 @@ declare namespace Phaser { * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened. * Hook into it from plugins or systems that need to update before the Scene Manager does. */ - const PRE_STEP: string; + const PRE_STEP: 'prestep'; /** * The Game Ready Event. @@ -6947,14 +6947,14 @@ declare namespace Phaser { * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready, * and all local systems are now able to start. */ - const READY: string; + const READY: 'ready'; /** * The Game Resume Event. * * This event is dispatched when the game loop leaves a paused state and resumes running. */ - const RESUME: string; + const RESUME: 'resume'; /** * The Game Step Event. @@ -6962,7 +6962,7 @@ declare namespace Phaser { * This event is dispatched after the Game Pre-Step and before the Scene Manager steps. * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have. */ - const STEP: string; + const STEP: 'step'; /** * This event is dispatched when the Scene Manager has created the System Scene, @@ -6970,7 +6970,7 @@ declare namespace Phaser { * * This event is dispatched just once by the Game instance. */ - const SYSTEM_READY: string; + const SYSTEM_READY: 'systemready'; /** * The Game Visible Event. @@ -6980,7 +6980,7 @@ declare namespace Phaser { * * Only browsers that support the Visibility API will cause this event to be emitted. */ - const VISIBLE: string; + const VISIBLE: 'visible'; } @@ -7001,7 +7001,7 @@ declare namespace Phaser { */ class CubicBezier extends Phaser.Curves.Curve { /** - * + * * @param p0 Start point, or an array of point pairs. * @param p1 Control Point 1. * @param p2 Control Point 2. @@ -7090,7 +7090,7 @@ declare namespace Phaser { */ class Curve { /** - * + * * @param type The curve type. */ constructor(type: string); @@ -7127,7 +7127,7 @@ declare namespace Phaser { /** * Draws this curve on the given Graphics object. - * + * * The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is. * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. * @param graphics The Graphics instance onto which this curve will be drawn. @@ -7138,7 +7138,7 @@ declare namespace Phaser { /** * Returns a Rectangle where the position and dimensions match the bounds of this Curve. - * + * * You can control the accuracy of the bounds. The value given is used to work out how many points * to plot across the curve. Higher values are more accurate at the cost of calculation speed. * @param out The Rectangle to store the bounds in. If falsey a new object will be created. @@ -7193,15 +7193,15 @@ declare namespace Phaser { /** * Get a sequence of evenly spaced points from the curve. - * + * * You can pass `divisions`, `stepRate`, or neither. - * + * * The number of divisions will be - * + * * 1. `divisions`, if `divisions` > 0; or * 2. `this.getLength / stepRate`, if `stepRate` > 0; or * 3. `this.defaultDivisions` - * + * * `1 + divisions` points will be returned. * @param divisions The number of divisions to make. * @param stepRate The curve distance between points, implying `divisions`. @@ -7219,7 +7219,7 @@ declare namespace Phaser { /** * Get a sequence of equally spaced points (by arc distance) from the curve. - * + * * `1 + divisions` points will be returned. * @param divisions The number of divisions to make. Default this.defaultDivisions. * @param stepRate Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. @@ -7294,7 +7294,7 @@ declare namespace Phaser { */ class Ellipse extends Phaser.Curves.Curve { /** - * + * * @param x The x coordinate of the ellipse, or an Ellipse Curve configuration object. Default 0. * @param y The y coordinate of the ellipse. Default 0. * @param xRadius The horizontal radius of ellipse. Default 0. @@ -7459,7 +7459,7 @@ declare namespace Phaser { */ class Line extends Phaser.Curves.Curve { /** - * + * * @param p0 The first endpoint. * @param p1 The second endpoint. */ @@ -7539,7 +7539,7 @@ declare namespace Phaser { /** * Draws this curve on the given Graphics object. - * + * * The curve is drawn using `Graphics.lineBetween` so will be drawn at whatever the present Graphics line color is. * The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it. * @param graphics The Graphics instance onto which this curve will be drawn. @@ -8054,7 +8054,7 @@ declare namespace Phaser { */ class DataManager { /** - * + * * @param parent The object that this DataManager belongs to. * @param eventEmitter The DataManager's event emitter. */ @@ -8079,13 +8079,13 @@ declare namespace Phaser { * The public values list. You can use this to access anything you have stored * in this Data Manager. For example, if you set a value called `gold` you can * access it via: - * + * * ```javascript * this.data.values.gold; * ``` - * + * * You can also modify it directly: - * + * * ```javascript * this.data.values.gold += 1000; * ``` @@ -8099,25 +8099,25 @@ declare namespace Phaser { /** * Retrieves the value for the given key, or undefined if it doesn't exist. - * + * * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * + * * ```javascript * this.data.get('gold'); * ``` - * + * * Or access the value directly: - * + * * ```javascript * this.data.values.gold; * ``` - * + * * You can also pass in an array of keys, in which case an array of values will be returned: - * + * * ```javascript * this.data.get([ 'gold', 'armor', 'health' ]); * ``` - * + * * This approach is useful for destructuring arrays in ES6. * @param key The key of the value to retrieve, or an array of keys. * @returns The value belonging to the given key, or an array of values, the order of which will match the input array. @@ -8139,35 +8139,35 @@ declare namespace Phaser { /** * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * + * * ```javascript * data.set('name', 'Red Gem Stone'); * ``` - * + * * You can also pass in an object of key value pairs as the first argument: - * + * * ```javascript * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); * ``` - * + * * To get a value back again you can call `get`: - * + * * ```javascript * data.get('gold'); * ``` - * + * * Or you can access the value directly via the `values` property, where it works like any other variable: - * + * * ```javascript * data.values.gold += 50; * ``` - * + * * When the value is first set, a `setdata` event is emitted. - * + * * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * + * * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @param key The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. @@ -8210,7 +8210,7 @@ declare namespace Phaser { /** * Merge the given object of key value pairs into this DataManager. - * + * * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) * will emit a `changedata` event. * @param data The data to merge. @@ -8221,12 +8221,12 @@ declare namespace Phaser { /** * Remove the value for the given key. - * + * * If the key is found in this Data Manager it is removed from the internal lists and a * `removedata` event is emitted. - * + * * You can also pass in an array of keys, in which case all keys in the array will be removed: - * + * * ```javascript * this.data.remove([ 'gold', 'armor', 'health' ]); * ``` @@ -8244,7 +8244,7 @@ declare namespace Phaser { /** * Determines whether the given key is set in this Data Manager. - * + * * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @param key The key to check. @@ -8295,7 +8295,7 @@ declare namespace Phaser { */ class DataManagerPlugin extends Phaser.Data.DataManager { /** - * + * * @param scene A reference to the Scene that this DataManager belongs to. */ constructor(scene: Phaser.Scene); @@ -8322,22 +8322,22 @@ declare namespace Phaser { namespace Events { /** * The Change Data Event. - * + * * This event is dispatched by a Data Manager when an item in the data store is changed. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * a change data event from a Game Object you would use: `sprite.on('changedata', listener)`. - * + * * This event is dispatched for all items that change in the Data Manager. * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event. */ - const CHANGE_DATA: string; + const CHANGE_DATA: 'changedata'; /** * The Change Data Key Event. - * + * * This event is dispatched by a Data Manager when an item in the data store is changed. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * the change of a specific data item from a Game Object you would use: `sprite.on('changedata-key', listener)`, * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold` @@ -8347,30 +8347,30 @@ declare namespace Phaser { /** * The Data Manager Destroy Event. - * + * * The Data Manager will listen for the destroy event from its parent, and then close itself down. */ - const DESTROY: string; + const DESTROY: 'destroy'; /** * The Remove Data Event. - * + * * This event is dispatched by a Data Manager when an item is removed from it. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * the removal of a data item on a Game Object you would use: `sprite.on('removedata', listener)`. */ - const REMOVE_DATA: string; + const REMOVE_DATA: 'removedata'; /** * The Set Data Event. - * + * * This event is dispatched by a Data Manager when a new item is added to the data store. - * + * * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for * the addition of a new data item on a Game Object you would use: `sprite.on('setdata', listener)`. */ - const SET_DATA: string; + const SET_DATA: 'setdata'; } @@ -8728,9 +8728,9 @@ declare namespace Phaser { /** * Determines the video support of the browser running this Phaser Game instance. - * + * * These values are read-only and populated during the boot sequence of the game. - * + * * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.video` from within any Scene. */ @@ -10215,7 +10215,7 @@ declare namespace Phaser { */ class Color { /** - * + * * @param red The red color value. A number between 0 and 255. Default 0. * @param green The green color value. A number between 0 and 255. Default 0. * @param blue The blue color value. A number between 0 and 255. Default 0. @@ -10489,9 +10489,9 @@ declare namespace Phaser { /** * Converts a HSV (hue, saturation and value) color set to RGB. - * + * * Conversion formula from https://en.wikipedia.org/wiki/HSL_and_HSV - * + * * Assumes HSV values are contained in the set [0, 1]. * @param h The hue, in the range 0 - 1. This is the base color. * @param s The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you a greyscale color. @@ -10553,7 +10553,7 @@ declare namespace Phaser { /** * Converts a CSS 'web' string into a Phaser Color object. - * + * * The web string can be in the format `'rgb(r,g,b)'` or `'rgba(r,g,b,a)'` where r/g/b are in the range [0..255] and a is in the range [0..1]. * @param rgb The CSS format color string, using the `rgb` or `rgba` format. * @param color An optional Color object to populate with the parsed values. If not provided, a new Color object is created and returned. @@ -10617,12 +10617,12 @@ declare namespace Phaser { * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only * make a masked pixel fully visible or fully invisible without changing its alpha (opacity). - * + * * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s) * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and * alpha of the pixel from the Geometry Mask do not matter. - * + * * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects. * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility * of any masked objects), whereas moving or transforming a masked object will not affect the mask. @@ -10636,7 +10636,7 @@ declare namespace Phaser { */ class GeometryMask { /** - * + * * @param scene This parameter is not used. * @param graphicsGeometry The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List. */ @@ -10670,7 +10670,7 @@ declare namespace Phaser { /** * Destroys this GeometryMask and nulls any references it holds. - * + * * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, * so be sure to call `clearMask` on any Game Object using it, before destroying it. */ @@ -10692,13 +10692,13 @@ declare namespace Phaser { * * BaseShaders are stored in the Shader Cache, available in a Scene via `this.cache.shaders` and are referenced * by a unique key-based string. Retrieve them via `this.cache.shaders.get(key)`. - * + * * BaseShaders are created automatically by the GLSL File Loader when loading an external shader resource. * They can also be created at runtime, allowing you to use dynamically generated shader source code. */ class BaseShader { /** - * + * * @param key The key of this shader. Must be unique within the shader cache. * @param glsl The GLSL source code for the shader. * @param metadata Additional metadata for this shader code. @@ -10858,14 +10858,14 @@ declare namespace Phaser { /** * The RAF step function. - * + * * Invokes the callback and schedules another call to requestAnimationFrame. */ step: FrameRequestCallback; /** * The SetTimeout step function. - * + * * Invokes the callback and schedules another call to setTimeout. */ stepTimeout: Function; @@ -11194,9 +11194,9 @@ declare namespace Phaser { /** * The quality of the blur effect. - * + * * This can be: - * + * * 0 for Low Quality * 1 for Medium Quality * 2 for High Quality @@ -11205,7 +11205,7 @@ declare namespace Phaser { * and the more processing time is spent on the GPU calculating * the final blur. This value is used in conjunction with the * `steps` value, as one has a direct impact on the other. - * + * * Keep this value as low as you can, while still achieving the * desired effect you need for your game. */ @@ -11277,7 +11277,7 @@ declare namespace Phaser { * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. - * + * * This effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature * effect by blurring everything except a small area of the image. This effect is achieved by blurring the * top and bottom elements, while keeping the center area in focus. @@ -11311,7 +11311,7 @@ declare namespace Phaser { /** * The radius of the bokeh effect. - * + * * This is a float value, where a radius of 0 will result in no effect being applied, * and a radius of 1 will result in a strong bokeh. However, you can exceed this value * for even stronger effects. @@ -11341,14 +11341,14 @@ declare namespace Phaser { /** * If a Tilt Shift effect this controls the amount of horizontal blur. - * + * * Setting this value on a non-Tilt Shift effect will have no effect. */ blurX: number; /** * If a Tilt Shift effect this controls the amount of vertical blur. - * + * * Setting this value on a non-Tilt Shift effect will have no effect. */ blurY: number; @@ -15828,53 +15828,43 @@ declare namespace Phaser { * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} */ - function BuildGameObject(scene: Phaser.Scene, gameObject: Phaser.GameObjects.GameObject, config: Phaser.Types.GameObjects.GameObjectConfig): Phaser.GameObjects.GameObject; - - /** - * Adds an Animation component to a Sprite and populates it based on the given config. - * @param sprite The sprite to add an Animation component to. - * @param config The animation config. - */ - function BuildGameObjectAnimation(sprite: Phaser.GameObjects.Sprite, config: object): Phaser.GameObjects.Sprite; - - /** - * The Display List plugin. - * - * Display Lists belong to a Scene and maintain the list of Game Objects to render every frame. - * - * Some of these Game Objects may also be part of the Scene's [Update List]{@link Phaser.GameObjects.UpdateList}, for updating. - */ - class DisplayList extends Phaser.Structs.List { + class DynamicBitmapText extends Phaser.GameObjects.BitmapText { /** - * - * @param scene The Scene that this Display List belongs to. + * + * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. + * @param x The x coordinate of this Game Object in world space. + * @param y The y coordinate of this Game Object in world space. + * @param font The key of the font to use from the Bitmap Font cache. + * @param text The string, or array of strings, to be set as the content of this Bitmap Text. + * @param size The font size of this Bitmap Text. + * @param align The alignment of the text in a multi-line BitmapText object. Default 0. */ - constructor(scene: Phaser.Scene); + constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: number); /** - * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + * The horizontal scroll position of the Bitmap Text. */ - sortChildrenFlag: boolean; + scrollX: number; /** - * The Scene that this Display List belongs to. + * The vertical scroll position of the Bitmap Text. */ - scene: Phaser.Scene; + scrollY: number; /** - * The Scene's Systems. + * The crop width of the Bitmap Text. */ - systems: Phaser.Scenes.Systems; + cropWidth: number; /** - * The Scene's Event Emitter. + * The crop height of the Bitmap Text. */ - events: Phaser.Events.EventEmitter; + cropHeight: number; /** - * Force a sort of the display list on the next call to depthSort. + * A callback that alters how each character of the Bitmap Text is rendered. */ - queueDepthSort(): void; + displayCallback: Phaser.Types.GameObjects.BitmapText.DisplayCallback; /** * The data object that is populated during rendering, then passed to the displayCallback. @@ -15884,7 +15874,7 @@ declare namespace Phaser { * Please note that if you need a reference to this object locally in your game code then you * should shallow copy it, as it's updated and re-used for every glyph in the text. */ - depthSort(): void; + callbackData: Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig; /** * Set the crop size of this Bitmap Text. @@ -15892,7 +15882,7 @@ declare namespace Phaser { * @param height The height of the crop. * @returns This Game Object. */ - sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): number; + setSize(width: number, height: number): this; /** * Set a callback that alters how each character of the Bitmap Text is rendered. @@ -15905,36 +15895,21 @@ declare namespace Phaser { * @param callback The display callback to set. * @returns This Game Object. */ - getChildren(): Phaser.GameObjects.GameObject[]; - - } - - /** - * The base class that all Game Objects extend. - * You don't create GameObjects directly and they cannot be added to the display list. - * Instead, use them as the base for your own custom classes. - */ - class GameObject extends Phaser.Events.EventEmitter { - /** - * - * @param scene The Scene to which this Game Object belongs. - * @param type A textual representation of the type of Game Object, i.e. `sprite`. - */ - constructor(scene: Phaser.Scene, type: string); + setDisplayCallback(callback: Phaser.Types.GameObjects.BitmapText.DisplayCallback): this; /** * Set the horizontal scroll position of this Bitmap Text. * @param value The horizontal scroll position to set. * @returns This Game Object. */ - scene: Phaser.Scene; + setScrollX(value: number): this; /** * Set the vertical scroll position of this Bitmap Text. * @param value The vertical scroll position to set. * @returns This Game Object. */ - displayList: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer; + setScrollY(value: number): this; /** * The Camera used for filters. @@ -16163,7 +16138,7 @@ declare namespace Phaser { * Immediately sets the alpha levels back to 1 (fully opaque).undefined * @returns This Game Object instance. */ - type: string; + clearAlpha(): this; /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. @@ -16177,7 +16152,7 @@ declare namespace Phaser { * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. * @returns This Game Object instance. */ - state: number | string; + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The alpha value of the Game Object, between 0 (fully transparent) and 1 (fully opaque). @@ -16186,33 +16161,31 @@ declare namespace Phaser { * all four corner alpha values (`alphaTopLeft`, `alphaTopRight`, `alphaBottomLeft`, * `alphaBottomRight`) to the same value. The input is clamped to the range [0, 1]. */ - parentContainer: Phaser.GameObjects.Container; + alpha: number; /** - * The name of this Game Object. - * Empty by default and never populated by Phaser, this is left for developers to use. + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. */ - name: string; + alphaTopLeft: number; /** - * The active state of this Game Object. - * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. - * An active object is one which is having its logic and internal systems updated. + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. */ - active: boolean; + alphaTopRight: number; /** - * The Tab Index of the Game Object. - * Reserved for future use by plugins and the Input Manager. + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. */ - tabIndex: number; + alphaBottomLeft: number; /** - * A Data Manager. - * It allows you to store, query and get key/value paired information specific to this Game Object. - * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. */ - data: Phaser.Data.DataManager; + alphaBottomRight: number; /** * Sets the Blend Mode being used by this Game Object. @@ -16236,7 +16209,7 @@ declare namespace Phaser { * reasons try to be careful about the construction of your Scene and the frequency with which blend modes * are used. */ - renderFlags: number; + blendMode: Phaser.BlendModes | string | number; /** * Sets the Blend Mode being used by this Game Object. @@ -16262,13 +16235,20 @@ declare namespace Phaser { * @param value The BlendMode value. Either a string, a CONST or a number. * @returns This Game Object instance. */ - cameraFilter: number; + setBlendMode(value: string | Phaser.BlendModes | number): this; /** - * If this Game Object is enabled for input then this property will contain an InteractiveObject instance. - * Not usually set directly. Instead call `GameObject.setInteractive()`. + * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. */ - input: Phaser.Types.Input.InteractiveObject | null; + depth: number; /** * Sets the depth of this Game Object. If the `value` argument is not provided, the depth defaults to `0`. @@ -16282,7 +16262,7 @@ declare namespace Phaser { * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. * @returns This Game Object instance. */ - body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody | MatterJS.BodyType | null; + setDepth(value: number): this; /** * Sets this Game Object to be at the top of the display list, or the top of its parent container. @@ -16292,7 +16272,7 @@ declare namespace Phaser { * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined * @returns This Game Object instance. */ - ignoreDestroy: boolean; + setToTop(): this; /** * Sets this Game Object to the back of the display list, or the back of its parent container. @@ -16302,7 +16282,7 @@ declare namespace Phaser { * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined * @returns This Game Object instance. */ - setActive(value: boolean): this; + setToBack(): this; /** * Move this Game Object so that it appears above the given Game Object. @@ -16315,7 +16295,7 @@ declare namespace Phaser { * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. */ - setName(value: string): this; + setAbove(gameObject: Phaser.GameObjects.GameObject): this; /** * Move this Game Object so that it appears below the given Game Object. @@ -16328,7 +16308,7 @@ declare namespace Phaser { * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. */ - setState(value: number | string): this; + setBelow(gameObject: Phaser.GameObjects.GameObject): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -16339,7 +16319,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - setDataEnabled(): this; + getCenter(output?: O, includeParent?: boolean): O; /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. @@ -16350,7 +16330,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - setData(key: (string|T), data?: any): this; + getTopLeft(output?: O, includeParent?: boolean): O; /** * Gets the top-center coordinate of this Game Object, regardless of origin. @@ -16361,7 +16341,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - incData(key: string, amount?: number): this; + getTopCenter(output?: O, includeParent?: boolean): O; /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. @@ -16372,7 +16352,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - toggleData(key: string): this; + getTopRight(output?: O, includeParent?: boolean): O; /** * Gets the left-center coordinate of this Game Object, regardless of origin. @@ -16383,7 +16363,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - getData(key: string | string[]): any; + getLeftCenter(output?: O, includeParent?: boolean): O; /** * Gets the right-center coordinate of this Game Object, regardless of origin. @@ -16394,7 +16374,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - setInteractive(hitArea?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; + getRightCenter(output?: O, includeParent?: boolean): O; /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. @@ -16405,7 +16385,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - disableInteractive(resetCursor?: boolean): this; + getBottomLeft(output?: O, includeParent?: boolean): O; /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. @@ -16416,7 +16396,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - removeInteractive(resetCursor?: boolean): this; + getBottomCenter(output?: O, includeParent?: boolean): O; /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. @@ -16427,7 +16407,7 @@ declare namespace Phaser { * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. * @returns The values stored in the output object. */ - addedToScene(): void; + getBottomRight(output?: O, includeParent?: boolean): O; /** * Gets the axis-aligned bounding rectangle of this Game Object, regardless of origin. @@ -16441,7 +16421,7 @@ declare namespace Phaser { * @param output An object to store the values in. If not provided a new Rectangle will be created. * @returns The values stored in the output object. */ - removedFromScene(): void; + getBounds(output?: O): O; /** * Controls whether this Game Object participates in the WebGL lighting system. @@ -16521,7 +16501,7 @@ declare namespace Phaser { * @param destroyMask Destroy the mask before clearing it? Default false. * @returns This Game Object instance. */ - willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; + clearMask(destroyMask?: boolean): this; /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, @@ -16539,15 +16519,23 @@ declare namespace Phaser { * @param graphics A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. * @returns This Geometry Mask that was created. */ - protected scene: Phaser.Scene; + createGeometryMask(graphics?: Phaser.GameObjects.Graphics | Phaser.GameObjects.Shape): Phaser.Display.Masks.GeometryMask; /** - * A reference to the Scene.Systems. + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + * Set this value with `setOrigin()`. */ originX: number; /** - * A reference to the Scene Event Emitter. + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + * Set this value with `setOrigin()`. */ originY: number; @@ -16557,7 +16545,7 @@ declare namespace Phaser { * calculated pixel offset derived from the Game Object's width multiplied by its `originX` value. * Setting this property updates `originX` accordingly. */ - protected displayList: Phaser.GameObjects.DisplayList; + displayOriginX: number; /** * The vertical display origin of this Game Object, expressed in pixels. @@ -16565,7 +16553,7 @@ declare namespace Phaser { * calculated pixel offset derived from the Game Object's height multiplied by its `originY` value. * Setting this property updates `originY` accordingly. */ - protected updateList: Phaser.GameObjects.UpdateList; + displayOriginY: number; /** * Sets the origin of this Game Object. @@ -16575,7 +16563,7 @@ declare namespace Phaser { * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. * @returns This Game Object instance. */ - existing(child: G): G; + setOrigin(x?: number, y?: number): this; /** * Sets the origin of this Game Object based on the Pivot values in its Frame. @@ -16584,7 +16572,7 @@ declare namespace Phaser { * resetting the origin to the default value of 0.5 for both axes.undefined * @returns This Game Object instance. */ - static register(factoryType: string, factoryFunction: Function): void; + setOriginFromFrame(): this; /** * Sets the display origin of this Game Object. @@ -16593,7 +16581,7 @@ declare namespace Phaser { * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. * @returns This Game Object instance. */ - static remove(factoryType: string): void; + setDisplayOrigin(x?: number, y?: number): this; /** * Customized WebGL render nodes of this Game Object. @@ -16679,7 +16667,7 @@ declare namespace Phaser { * the scroll factor is a visual adjustment to where the textures are rendered, which can offset * them from physics bodies if not accounted for in your code. */ - particles(x?: number, y?: number, texture?: string | Phaser.Textures.Texture, config?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig): Phaser.GameObjects.Particles.ParticleEmitter; + scrollFactorX: number; /** * The vertical scroll factor of this Game Object. @@ -16698,7 +16686,7 @@ declare namespace Phaser { * the scroll factor is a visual adjustment to where the textures are rendered, which can offset * them from physics bodies if not accounted for in your code. */ - follower(path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.PathFollower; + scrollFactorY: number; /** * Sets the horizontal and vertical scroll factor of this Game Object. If only the `x` value is @@ -16722,68 +16710,17 @@ declare namespace Phaser { * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. * @returns This Game Object instance. */ - plane(x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number, width?: number, height?: number, tile?: boolean): Phaser.GameObjects.Plane; + setScrollFactor(x: number, y?: number): this; /** - * Creates a new Point Light Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Point Light Game Object has been built into Phaser. - * - * The Point Light Game Object provides a way to add a point light effect into your game, - * without the expensive shader processing requirements of the traditional Light Game Object. - * - * The difference is that the Point Light renders using a custom shader, designed to give the - * impression of a point light source, of variable radius, intensity and color, in your game. - * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their - * normal maps for calcuations. This makes them extremely fast to render compared to Lights - * and perfect for special effects, such as flickering torches or muzzle flashes. - * - * For maximum performance you should batch Point Light Game Objects together. This means - * ensuring they follow each other consecutively on the display list. Ideally, use a Layer - * Game Object and then add just Point Lights to it, so that it can batch together the rendering - * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in - * your game then it's perfectly safe to mix them into the display list as normal. However, if - * you're using a large number of them, please consider how they are mixed into the display list. - * - * The renderer will automatically cull Point Lights. Those with a radius that does not intersect - * with the Camera will be skipped in the rendering list. This happens automatically and the - * culled state is refreshed every frame, for every camera. - * - * The origin of a Point Light is always 0.5 and it cannot be changed. - * - * Point Lights are a WebGL only feature and do not have a Canvas counterpart. - * @param x The horizontal position of this Point Light in the world. - * @param y The vertical position of this Point Light in the world. - * @param color The color of the Point Light, given as a hex value. Default 0xffffff. - * @param radius The radius of the Point Light. Default 128. - * @param intensity The intensity, or color blend, of the Point Light. Default 1. - * @param attenuation The attenuation of the Point Light. This is the reduction of light from the center point. Default 0.1. + * The Texture this Game Object is using to render with. */ - pointlight(x: number, y: number, color?: number, radius?: number, intensity?: number, attenuation?: number): Phaser.GameObjects.PointLight; + texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; /** - * Creates a new Render Texture Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Render Texture Game Object has been built into Phaser. - * - * A Render Texture is a combination of Dynamic Texture and an Image Game Object, that uses the - * Dynamic Texture to display itself with. - * - * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of - * Game Objects directly to it. - * - * You can take many complex objects and draw them to this one texture, which can then be used as the - * base texture for other Game Objects, such as Sprites. Should you then update this texture, all - * Game Objects using it will instantly be updated as well, reflecting the changes immediately. - * - * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke - * expensive GPU uploads on each change. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param width The width of the Render Texture. Default 32. - * @param height The height of the Render Texture. Default 32. + * The Texture Frame this Game Object is using to render with. */ - renderTexture(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.RenderTexture; + frame: Phaser.Textures.Frame; /** * Sets the texture and frame this Game Object will use to render with. @@ -16799,7 +16736,7 @@ declare namespace Phaser { * @param updateOrigin Should this call change the origin of the Game Object? Default true. * @returns This Game Object instance. */ - rope(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number, points?: Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]): Phaser.GameObjects.Rope; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** * Sets the frame this Game Object will use to render with. @@ -16817,35 +16754,35 @@ declare namespace Phaser { * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. * @returns This Game Object instance. */ - shader(key: string | Phaser.Display.BaseShader, x?: number, y?: number, width?: number, height?: number, textures?: string[], textureData?: object): Phaser.GameObjects.Shader; + setFrame(frame: string | number | Phaser.Textures.Frame, updateSize?: boolean, updateOrigin?: boolean): this; /** * The tint value being applied to the top-left vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - arc(x?: number, y?: number, radius?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + tintTopLeft: number; /** * The tint value being applied to the top-right vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - circle(x?: number, y?: number, radius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + tintTopRight: number; /** * The tint value being applied to the bottom-left vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - curve(x?: number, y?: number, curve?: Phaser.Curves.Curve, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Curve; + tintBottomLeft: number; /** * The tint value being applied to the bottom-right vertex of the Game Object. * This value is interpolated from the corner to the center of the Game Object. * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. */ - ellipse(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Ellipse; + tintBottomRight: number; /** * The tint mode to use when applying the tint to the texture. @@ -16870,7 +16807,7 @@ declare namespace Phaser { * which results in no visible change to the texture.undefined * @returns This Game Object instance. */ - isobox(x?: number, y?: number, size?: number, height?: number, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoBox; + clearTint(): this; /** * Sets the tint color on this Game Object. @@ -16897,7 +16834,7 @@ declare namespace Phaser { * @param bottomRight The tint being applied to the bottom-right of the Game Object. * @returns This Game Object instance. */ - isotriangle(x?: number, y?: number, size?: number, height?: number, reversed?: boolean, fillTop?: number, fillLeft?: number, fillRight?: number): Phaser.GameObjects.IsoTriangle; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets the tint mode to use when applying the tint to the texture. @@ -16922,7 +16859,7 @@ declare namespace Phaser { * color value is applied to all four corner tint properties (`tintTopLeft`, * `tintTopRight`, `tintBottomLeft`, and `tintBottomRight`) simultaneously. */ - polygon(x?: number, y?: number, points?: any, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Polygon; + tint: number; /** * Does this Game Object have a tint applied? @@ -16932,319 +16869,74 @@ declare namespace Phaser { * Returns `false` when all four tint values are 0xffffff and the tint mode * is `MULTIPLY`, which is the default untinted state. */ - rectangle(x?: number, y?: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Rectangle; + readonly isTinted: boolean; /** - * Creates a new Star Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Star Game Object has been built into Phaser. - * - * The Star Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * As the name implies, the Star shape will display a star in your game. You can control several - * aspects of it including the number of points that constitute the star. The default is 5. If - * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky - * star shape. - * - * You can also control the inner and outer radius, which is how 'long' each point of the star is. - * Modify these values to create more interesting shapes. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param points The number of points on the star. Default 5. - * @param innerRadius The inner radius of the star. Default 32. - * @param outerRadius The outer radius of the star. Default 64. - * @param fillColor The color the star will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the star will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * A property indicating that a Game Object has this component. */ - star(x?: number, y?: number, points?: number, innerRadius?: number, outerRadius?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Star; + readonly hasTransformComponent: boolean; /** - * Creates a new Triangle Shape Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Triangle Game Object has been built into Phaser. - * - * The Triangle Shape is a Game Object that can be added to a Scene, Group or Container. You can - * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling - * it for input or physics. It provides a quick and easy way for you to render this shape in your - * game without using a texture, while still taking advantage of being fully batched in WebGL. - * - * This shape supports both fill and stroke colors. - * - * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the - * position of each point of these lines. The triangle is always closed and cannot have an open - * face. If you require that, consider using a Polygon instead. - * @param x The horizontal position of this Game Object in the world. Default 0. - * @param y The vertical position of this Game Object in the world. Default 0. - * @param x1 The horizontal position of the first point in the triangle. Default 0. - * @param y1 The vertical position of the first point in the triangle. Default 128. - * @param x2 The horizontal position of the second point in the triangle. Default 64. - * @param y2 The vertical position of the second point in the triangle. Default 0. - * @param x3 The horizontal position of the third point in the triangle. Default 128. - * @param y3 The vertical position of the third point in the triangle. Default 128. - * @param fillColor The color the triangle will be filled with, i.e. 0xff0000 for red. - * @param fillAlpha The alpha the triangle will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. + * The x position of this Game Object. */ - triangle(x?: number, y?: number, x1?: number, y1?: number, x2?: number, y2?: number, x3?: number, y3?: number, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Triangle; + x: number; /** - * Creates a new Sprite Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Sprite Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. + * The y position of this Game Object. */ - sprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Sprite; + y: number; /** - * Creates a new Text Game Object and adds it to the Scene. - * - * A Text Game Object. - * - * Text objects work by creating their own internal hidden Canvas and then renders text to it using - * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered - * to your game during the render pass. - * - * Because it uses the Canvas API you can take advantage of all the features this offers, such as - * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts - * loaded externally, such as Google or TypeKit Web fonts. - * - * You can only display fonts that are currently loaded and available to the browser: therefore fonts must - * be pre-loaded. Phaser does not do this for you, so you will require the use of a 3rd party font loader, - * or have the fonts ready available in the CSS on the page in which your Phaser game resides. - * - * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts - * across mobile browsers. - * - * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being - * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the - * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of - * Text objects in your game. If you run into performance issues you would be better off using Bitmap Text - * instead, as it benefits from batching and avoids expensive Canvas API calls. - * - * Note: This method will only be available if the Text Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param text The text this Text object will display. - * @param style The Text style configuration object. + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ - text(x: number, y: number, text: string | string[], style?: Phaser.Types.GameObjects.Text.TextStyle): Phaser.GameObjects.Text; + z: number; /** - * Creates a new TileSprite Game Object and adds it to the Scene. - * - * Note: This method will only be available if the TileSprite Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param width The width of the Game Object. If zero it will use the size of the texture frame. - * @param height The height of the Game Object. If zero it will use the size of the texture frame. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. Cannot be a DynamicTexture. - * @param frame An optional frame from the Texture this Game Object is rendering with. + * The w position of this Game Object. */ - tileSprite(x: number, y: number, width: number, height: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.TileSprite; + w: number; /** - * Creates a new Video Game Object and adds it to the Scene. - * - * This Game Object is capable of handling playback of a video file, video stream or media stream. - * - * You can optionally 'preload' the video into the Phaser Video Cache: - * - * ```javascript - * preload () { - * this.load.video('ripley', 'assets/aliens.mp4'); - * } - * - * create () { - * this.add.video(400, 300, 'ripley'); - * } - * ``` - * - * You don't have to 'preload' the video. You can also play it directly from a URL: - * - * ```javascript - * create () { - * this.add.video(400, 300).loadURL('assets/aliens.mp4'); - * } - * ``` - * - * To all intents and purposes, a video is a standard Game Object, just like a Sprite. And as such, you can do - * all the usual things to it, such as scaling, rotating, cropping, tinting, making interactive, giving a - * physics body, etc. - * - * Transparent videos are also possible via the WebM file format. Providing the video file has was encoded with - * an alpha channel, and providing the browser supports WebM playback (not all of them do), then it will render - * in-game with full transparency. - * - * ### Autoplaying Videos - * - * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. - * The policies that control autoplaying are vast and vary between browser. You can, and should, read more about - * it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * - * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, - * and it will often allow the video to play immediately: - * - * ```javascript - * preload () { - * this.load.video('pixar', 'nemo.mp4', true); - * } - * ``` - * - * The 3rd parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without - * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies - * the browsers MEI settings. See the MDN Autoplay Guide for further details. - * - * Or: - * - * ```javascript - * create () { - * this.add.video(400, 300).loadURL('assets/aliens.mp4', true); - * } - * ``` - * - * You can set the `noAudio` parameter to `true` even if the video does contain audio. It will still allow the video - * to play immediately, but the audio will not start. - * - * Note that due to a bug in IE11 you cannot play a video texture to a Sprite in WebGL. For IE11 force Canvas mode. - * - * More details about video playback and the supported media formats can be found on MDN: - * - * https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement - * https://developer.mozilla.org/en-US/docs/Web/Media/Formats - * - * Note: This method will only be available if the Video Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param key Optional key of the Video this Game Object will play, as stored in the Video Cache. + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. */ - video(x: number, y: number, key?: string): Phaser.GameObjects.Video; + scale: number; /** - * Creates a new Zone Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Zone Game Object has been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param width The width of the Game Object. - * @param height The height of the Game Object. + * The horizontal scale of this Game Object. */ - zone(x: number, y: number, width: number, height: number): Phaser.GameObjects.Zone; + scaleX: number; /** - * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. - * When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing - * from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map - * data. For an empty map, you should specify tileWidth, tileHeight, width & height. - * @param key The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param tileWidth The width of a tile in pixels. Pass in `null` to leave as the - * default. Default 32. - * @param tileHeight The height of a tile in pixels. Pass in `null` to leave as the - * default. Default 32. - * @param width The width of the map in tiles. Pass in `null` to leave as the - * default. Default 10. - * @param height The height of the map in tiles. Pass in `null` to leave as the - * default. Default 10. - * @param data Instead of loading from the cache, you can also load directly from - * a 2D array of tile indexes. Pass in `null` for no data. - * @param insertNull Controls how empty tiles, tiles with an index of -1, in the - * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty - * location will get a Tile object with an index of -1. If you've a large sparsely populated map and - * the tile data doesn't need to change then setting this value to `true` will help with memory - * consumption. However if your map is small or you need to update the tiles dynamically, then leave - * the default value set. Default false. + * The vertical scale of this Game Object. */ - tilemap(key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number, data?: number[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; + scaleY: number; /** - * A Timeline is a way to schedule events to happen at specific times in the future. - * - * You can think of it as an event sequencer for your game, allowing you to schedule the - * running of callbacks, events and other actions at specific times in the future. - * - * A Timeline is a Scene level system, meaning you can have as many Timelines as you like, each - * belonging to a different Scene. You can also have multiple Timelines running at the same time. - * - * If the Scene is paused, the Timeline will also pause. If the Scene is destroyed, the Timeline - * will be automatically destroyed. However, you can control the Timeline directly, pausing, - * resuming and stopping it at any time. - * - * Create an instance of a Timeline via the Game Object Factory: - * - * ```js - * const timeline = this.add.timeline(); - * ``` - * - * The Timeline always starts paused. You must call `play` on it to start it running. - * - * You can also pass in a configuration object on creation, or an array of them: - * - * ```js - * const timeline = this.add.timeline({ - * at: 1000, - * run: () => { - * this.add.sprite(400, 300, 'logo'); - * } - * }); - * - * timeline.play(); - * ``` - * - * In this example we sequence a few different events: - * - * ```js - * const timeline = this.add.timeline([ - * { - * at: 1000, - * run: () => { this.logo = this.add.sprite(400, 300, 'logo'); }, - * sound: 'TitleMusic' - * }, - * { - * at: 2500, - * tween: { - * targets: this.logo, - * y: 600, - * yoyo: true - * }, - * sound: 'Explode' - * }, - * { - * at: 8000, - * event: 'HURRY_PLAYER', - * target: this.background, - * set: { - * tint: 0xff0000 - * } - * } - * ]); - * - * timeline.play(); - * ``` - * - * The Timeline can also be looped with the repeat method: - * ```js - * timeline.repeat().play(); - * ``` - * - * There are lots of options available to you via the configuration object. See the - * {@link Phaser.Types.Time.TimelineEventConfig} typedef for more details. - * @param config The configuration object for this Timeline Event, or an array of them. + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. */ - timeline(config: Phaser.Types.Time.TimelineEventConfig | Phaser.Types.Time.TimelineEventConfig[]): Phaser.Time.Timeline; + angle: number; /** - * Creates a new Tween object. - * - * Note: This method will only be available if Tweens have been built into Phaser. - * @param config A Tween Configuration object, or a Tween or TweenChain instance. + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. */ - tween(config: Phaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfig | Phaser.Tweens.Tween | Phaser.Tweens.TweenChain): Phaser.Tweens.Tween; + rotation: number; /** * Sets the position of this Game Object. @@ -17254,44 +16946,14 @@ declare namespace Phaser { * @param w The w position of this Game Object. Default 0. * @returns This Game Object instance. */ - tweenchain(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.TweenChain; - - } - - /** - * Calculates the Transform Matrix of the given Game Object and Camera, factoring in - * the parent matrix if provided. - * - * Note that the object this results contains _references_ to the Transform Matrices, - * not new instances of them. Therefore, you should use their values immediately, or - * copy them to your own matrix, as they will be replaced as soon as another Game - * Object is rendered. - * @param src The Game Object to calculate the transform matrix for. - * @param camera The camera being used to render the Game Object. - * @param parentMatrix The transform matrix of the parent container, if any. - */ - function GetCalcMatrix(src: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Types.GameObjects.GetCalcMatrixResults; - - /** - * The Update List plugin. - * - * Update Lists belong to a Scene and maintain the list Game Objects to be updated every frame. - * - * Some or all of these Game Objects may also be part of the Scene's [Display List]{@link Phaser.GameObjects.DisplayList}, for Rendering. - */ - class UpdateList extends Phaser.Structs.ProcessQueue { - /** - * - * @param scene The Scene that the Update List belongs to. - */ - constructor(scene: Phaser.Scene); + setPosition(x?: number, y?: number, z?: number, w?: number): this; /** * Copies an object's coordinates to this Game Object's position. * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. * @returns This Game Object instance. */ - scene: Phaser.Scene; + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; /** * Sets the position of this Game Object to be a random position within the confines of @@ -17307,21 +16969,21 @@ declare namespace Phaser { * @param height The height of the random area. * @returns This Game Object instance. */ - systems: Phaser.Scenes.Systems; + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; /** * Sets the rotation of this Game Object. * @param radians The rotation of this Game Object, in radians. Default 0. * @returns This Game Object instance. */ - sceneUpdate(time: number, delta: number): void; + setRotation(radians?: number): this; /** * Sets the angle of this Game Object. * @param degrees The rotation of this Game Object, in degrees. Default 0. * @returns This Game Object instance. */ - shutdown(): void; + setAngle(degrees?: number): this; /** * Sets the scale of this Game Object. @@ -17431,29 +17093,29 @@ declare namespace Phaser { /** * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. - * + * * During rendering for each letter of the text is rendered to the display, proportionally spaced out and aligned to * match the font structure. - * + * * BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability * to use Web Fonts, however you trade this flexibility for rendering speed. You can also create visually compelling BitmapTexts by * processing the font texture in an image editor, applying fills and any other effects required. - * + * * To create multi-line text insert \r, \n or \r\n escape codes into the text string. - * + * * To create a BitmapText data files you need a 3rd party app such as: - * + * * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} * Snow BMF (Web-based, free): {@link https://snowb.org//|https://snowb.org/} * Littera (Flash-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} - * + * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} */ class BitmapText extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. * @param x The x coordinate of this Game Object in world space. * @param y The y coordinate of this Game Object in world space. @@ -17483,28 +17145,28 @@ declare namespace Phaser { /** * The horizontal offset of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowX: number; /** * The vertical offset of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowY: number; /** * The color of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowColor: number; /** * The alpha value of the drop shadow. - * + * * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. */ dropShadowAlpha: number; @@ -17554,9 +17216,9 @@ declare namespace Phaser { /** * Sets the line spacing value. This value is added to the font height to * calculate the overall line height. - * + * * Spacing can be a negative or positive number. - * + * * Only has an effect if this BitmapText object contains multiple lines of text. * @param spacing The amount of space to add between each line in multi-line text. Default 0. * @returns This BitmapText Object. @@ -17565,7 +17227,7 @@ declare namespace Phaser { /** * Set the textual content of this BitmapText. - * + * * An array of strings will be converted into multi-line text. Use the align methods to change multi-line alignment. * @param value The string, or array of strings, to be set as the content of this BitmapText. * @returns This BitmapText Object. @@ -17574,14 +17236,14 @@ declare namespace Phaser { /** * Sets a drop shadow effect on this Bitmap Text. - * + * * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. - * + * * You can set the vertical and horizontal offset of the shadow, as well as the color and alpha. - * + * * Once a shadow has been enabled you can modify the `dropShadowX` and `dropShadowY` properties of this * Bitmap Text directly to adjust the position of the shadow in real-time. - * + * * If you wish to clear the shadow, call this method with no parameters specified. * @param x The horizontal offset of the drop shadow. Default 0. * @param y The vertical offset of the drop shadow. Default 0. @@ -17594,14 +17256,14 @@ declare namespace Phaser { /** * Sets a tint on a range of characters in this Bitmap Text, starting from the `start` parameter index * and running for `length` quantity of characters. - * + * * The `start` parameter can be negative. In this case, it starts at the end of the text and counts * backwards `start` places. - * + * * You can also pass in -1 as the `length` and it will tint all characters from `start` * up until the end of the string. * Remember that spaces and punctuation count as characters. - * + * * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. * * The tint applies a color to the pixel color values @@ -17619,9 +17281,9 @@ declare namespace Phaser { * per corner. The colors are blended together across the extent of the character range. * * To modify the tint color once set, call this method again with new color values. - * + * * Using `setWordTint` can override tints set by this function, and vice versa. - * + * * To remove a tint call this method with just the `start`, and optionally, the `length` parameters defined. * @param start The starting character to begin the tint at. If negative, it counts back from the end of the text. Default 0. * @param length The number of characters to tint. Remember that spaces count as a character too. Pass -1 to tint all characters from `start` onwards. Default 1. @@ -17636,18 +17298,18 @@ declare namespace Phaser { /** * Sets a tint on a matching word within this Bitmap Text. - * + * * The `word` parameter can be either a string or a number. - * + * * If a string, it will run a string comparison against the text contents, and if matching, * it will tint the whole word. * * If a number, it will tint that word, based on its index within the words array. * * The `count` parameter controls how many words are replaced. Pass in -1 to replace them all. - * + * * This parameter is ignored if you pass a number as the `word` to be searched for. - * + * * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. * * The tint applies a color to the pixel color values @@ -17665,7 +17327,7 @@ declare namespace Phaser { * per corner. The colors are blended together across the extent of the character range. * * To modify the tint color once set, call this method again with new color values. - * + * * Using `setCharacterTint` can override tints set by this function, and vice versa. * @param word The word to search for. Either a string, or an index of the word in the words array. * @param count The number of matching words to tint. Pass -1 to tint all matching words. Default 1. @@ -17680,14 +17342,14 @@ declare namespace Phaser { /** * Calculate the bounds of this Bitmap Text. - * + * * An object is returned that contains the position, width and height of the Bitmap Text in local and global * contexts. - * + * * Local size is based on just the font size and a [0, 0] position. - * + * * Global size takes into account the Game Object's scale, world position and display origin. - * + * * Also in the object is data regarding the length of each line, should this be a multi-line BitmapText. * @param round Whether to round the results up to the nearest integer. Default false. * @returns An object that describes the size of this Bitmap Text. @@ -17696,16 +17358,16 @@ declare namespace Phaser { /** * Gets the character located at the given x/y coordinate within this Bitmap Text. - * + * * The coordinates you pass in are translated into the local space of the * Bitmap Text, however, it is up to you to first translate the input coordinates to world space. - * + * * If you wish to use this in combination with an input event, be sure * to pass in `Pointer.worldX` and `worldY` so they are in world space. - * + * * In some cases, based on kerning, characters can overlap. When this happens, * the first character in the word is returned. - * + * * Note that this does not work for DynamicBitmapText if you have changed the * character positions during render. It will only scan characters in their un-translated state. * @param x The x position to check. @@ -17724,7 +17386,7 @@ declare namespace Phaser { /** * Changes the font this BitmapText is using to render. - * + * * The new texture is loaded and applied to the BitmapText. The existing text, size and alignment are preserved, * unless overridden via the arguments. * @param font The key of the font to use from the Bitmap Font cache. @@ -17736,14 +17398,14 @@ declare namespace Phaser { /** * Sets the maximum display width of this BitmapText in pixels. - * + * * If `BitmapText.text` is longer than `maxWidth` then the lines will be automatically wrapped * based on the previous whitespace character found in the line. - * + * * If no whitespace was found then no wrapping will take place and consequently the `maxWidth` value will not be honored. - * + * * Disable maxWidth by setting the value to 0. - * + * * You can set the whitespace character to be searched for by setting the `wordWrapCharCode` parameter or property. * @param value The maximum display width of this BitmapText in pixels. Set to zero to disable. * @param wordWrapCharCode The character code to check for when word wrapping. Defaults to 32 (the space character). @@ -17753,7 +17415,7 @@ declare namespace Phaser { /** * Sets the display size of this BitmapText Game Object. - * + * * Calling this will adjust the scale. * @param width The width of this BitmapText Game Object. * @param height The height of this BitmapText Game Object. @@ -17763,67 +17425,67 @@ declare namespace Phaser { /** * Controls the alignment of each line of text in this BitmapText object. - * + * * Only has any effect when this BitmapText contains multiple lines of text, split with carriage-returns. * Has no effect with single-lines of text. - * + * * See the methods `setLeftAlign`, `setCenterAlign` and `setRightAlign`. - * + * * 0 = Left aligned (default) * 1 = Middle aligned * 2 = Right aligned - * + * * The alignment position is based on the longest line of text. */ align: number; /** * The text that this Bitmap Text object displays. - * + * * You can also use the method `setText` if you want a chainable way to change the text content. */ text: string; /** * The font size of this Bitmap Text. - * + * * You can also use the method `setFontSize` if you want a chainable way to change the font size. */ fontSize: number; /** * Adds / Removes spacing between characters. - * + * * Can be a negative or positive number. - * + * * You can also use the method `setLetterSpacing` if you want a chainable way to change the letter spacing. */ letterSpacing: number; /** * Adds / Removes spacing between lines. - * + * * Can be a negative or positive number. - * + * * You can also use the method `setLineSpacing` if you want a chainable way to change the line spacing. */ lineSpacing: number; /** * The maximum display width of this BitmapText in pixels. - * + * * If BitmapText.text is longer than maxWidth then the lines will be automatically wrapped * based on the last whitespace character found in the line. - * + * * If no whitespace was found then no wrapping will take place and consequently the maxWidth value will not be honored. - * + * * Disable maxWidth by setting the value to 0. */ maxWidth: number; /** * The width of this Bitmap Text. - * + * * This property is read-only. */ readonly width: number; @@ -17837,18 +17499,18 @@ declare namespace Phaser { /** * The displayed width of this Bitmap Text. - * + * * This value takes into account the scale factor. - * + * * This property is read-only. */ readonly displayWidth: number; /** * The displayed height of this Bitmap Text. - * + * * This value takes into account the scale factor. - * + * * This property is read-only. */ readonly displayHeight: number; @@ -17881,7 +17543,7 @@ declare namespace Phaser { /** * Parse an XML Bitmap Font from an Atlas. - * + * * Adds the parsed Bitmap Font data to the cache with the `fontName` key. * @param scene The Scene to parse the Bitmap Font for. * @param fontName The key of the font to add to the Bitmap Font cache. @@ -18136,7 +17798,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -18182,21 +17844,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -18206,21 +17868,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -18232,13 +17894,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -18269,7 +17931,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -18279,11 +17941,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -18292,11 +17954,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -18305,7 +17967,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18316,7 +17978,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18327,7 +17989,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18338,7 +18000,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18349,7 +18011,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18360,7 +18022,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18371,7 +18033,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18382,7 +18044,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18393,7 +18055,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -18475,10 +18137,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -18499,12 +18161,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -18550,7 +18212,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -18645,12 +18307,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -18664,12 +18326,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -18687,10 +18349,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -18717,11 +18379,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -18733,14 +18395,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -18809,11 +18471,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -18881,7 +18543,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -18895,7 +18557,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -18913,20 +18575,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -18951,9 +18613,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -19002,7 +18664,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -19035,9 +18697,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -19068,14 +18730,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -19086,22 +18748,22 @@ declare namespace Phaser { /** * A Blitter Game Object. - * + * * The Blitter Game Object is a special kind of container that creates, updates and manages Bob objects. * Bobs are designed for rendering speed rather than flexibility. They consist of a texture, or frame from a texture, * a position and an alpha value. You cannot scale or rotate them. They use a batched drawing method for speed * during rendering. - * + * * A Blitter Game Object has one texture bound to it. Bobs created by the Blitter can use any Frame from this * Texture to render with, but they cannot use any other Texture. It is this single texture-bind that allows * them their speed. - * + * * If you have a need to blast a large volume of frames around the screen then Blitter objects are well worth * investigating. They are especially useful for using as a base for your own special effects systems. */ class Blitter extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. It can only belong to one Scene at any given time. * @param x The x coordinate of this Game Object in world space. Default 0. * @param y The y coordinate of this Game Object in world space. Default 0. @@ -19124,7 +18786,7 @@ declare namespace Phaser { /** * Creates a new Bob in this Blitter. - * + * * The Bob is created at the given coordinates, relative to the Blitter and uses the given frame. * A Bob can use any frame belonging to the texture bound to the Blitter. * @param x The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. @@ -19148,9 +18810,9 @@ declare namespace Phaser { /** * Creates multiple Bobs in one call. - * + * * The amount created is controlled by a combination of the `quantity` argument and the number of frames provided. - * + * * If the quantity is set to 10 and you provide 2 frames, then 20 Bobs will be created. 10 with the first * frame and 10 with the second. * @param quantity The quantity of Bob objects to create. @@ -19416,7 +19078,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -19462,21 +19124,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -19486,21 +19148,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -19512,13 +19174,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -19549,7 +19211,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -19559,11 +19221,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -19572,11 +19234,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -19642,10 +19304,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -19666,12 +19328,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -19750,12 +19412,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -19769,12 +19431,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -19792,10 +19454,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -19812,7 +19474,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -19821,7 +19483,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -19830,30 +19492,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -19863,12 +19525,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -19902,11 +19564,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -19918,14 +19580,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -19951,7 +19613,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -19965,7 +19627,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -19983,20 +19645,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -20021,9 +19683,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -20072,7 +19734,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -20105,9 +19767,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -20138,14 +19800,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -20156,22 +19818,22 @@ declare namespace Phaser { /** * A Bob Game Object. - * + * * A Bob belongs to a Blitter Game Object. The Blitter is responsible for managing and rendering this object. - * + * * A Bob has a position, alpha value and a frame from a texture that it uses to render with. You can also toggle * the flipped and visible state of the Bob. The Frame the Bob uses to render can be changed dynamically, but it * must be a Frame within the Texture used by the parent Blitter. - * + * * Bob positions are relative to the Blitter parent. So if you move the Blitter parent, all Bob children will * have their positions impacted by this change as well. - * + * * You can manipulate Bob objects directly from your game code, but the creation and destruction of them should be * handled via the Blitter parent. */ class Bob { /** - * + * * @param blitter The parent Blitter object is responsible for updating this Bob. * @param x The horizontal position of this Game Object in the world, relative to the parent Blitter position. * @param y The vertical position of this Game Object in the world, relative to the parent Blitter position. @@ -20242,9 +19904,9 @@ declare namespace Phaser { /** * Resets this Bob. - * + * * Changes the position to the values given, and optionally changes the frame. - * + * * Also resets the flipX and flipY values, sets alpha back to 1 and visible to true. * @param x The x position of the Bob. Bob coordinates are relative to the position of the Blitter object. * @param y The y position of the Bob. Bob coordinates are relative to the position of the Blitter object. @@ -20285,7 +19947,7 @@ declare namespace Phaser { /** * Sets the visibility of this Bob. - * + * * An invisible Bob will skip rendering. * @param value The visible state of the Game Object. * @returns This Bob Game Object. @@ -20295,7 +19957,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * A Bob with alpha 0 will skip rendering. * @param value The alpha value used for this Bob. Between 0 and 1. * @returns This Bob Game Object. @@ -20320,14 +19982,14 @@ declare namespace Phaser { /** * The visible state of the Bob. - * + * * An invisible Bob will skip rendering. */ visible: boolean; /** * The alpha value of the Bob, between 0 and 1. - * + * * A Bob with alpha 0 will skip rendering. */ alpha: number; @@ -20846,7 +20508,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -20909,7 +20571,7 @@ declare namespace Phaser { setAlpha(value?: number): this; /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -20930,21 +20592,21 @@ declare namespace Phaser { interface BlendMode { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -20953,21 +20615,21 @@ declare namespace Phaser { blendMode: Phaser.BlendModes | string | number; /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -20991,7 +20653,7 @@ declare namespace Phaser { interface ComputedSize { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -20999,7 +20661,7 @@ declare namespace Phaser { width: number; /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -21007,28 +20669,28 @@ declare namespace Phaser { height: number; /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -21075,26 +20737,26 @@ declare namespace Phaser { isCropped: boolean; /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates cannot exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -21113,13 +20775,13 @@ declare namespace Phaser { interface Depth { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -21147,7 +20809,7 @@ declare namespace Phaser { setToTop(): this; /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -21156,11 +20818,11 @@ declare namespace Phaser { setToBack(): this; /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -21168,11 +20830,11 @@ declare namespace Phaser { setAbove(gameObject: Phaser.GameObjects.GameObject): this; /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -21452,7 +21114,7 @@ declare namespace Phaser { /** * Adds a Blur effect. - * + * * A Gaussian blur is the result of blurring an image by a Gaussian function. It is a widely used effect, * typically to reduce image noise and reduce detail. The visual effect of this blurring technique is a * smooth blur resembling that of viewing the image through a translucent screen, distinctly different @@ -21469,12 +21131,12 @@ declare namespace Phaser { /** * Adds a Bokeh effect. - * + * * Bokeh refers to a visual effect that mimics the photographic technique of creating a shallow depth of field. * This effect is used to emphasize the game's main subject or action, by blurring the background or foreground * elements, resulting in a more immersive and visually appealing experience. It is achieved through rendering * techniques that simulate the out-of-focus areas, giving a sense of depth and realism to the game's graphics. - * + * * See also Tilt Shift. * @param radius The radius of the bokeh effect. Default 0.5. * @param amount The amount of the bokeh effect. Default 1. @@ -21786,11 +21448,11 @@ declare namespace Phaser { /** * Adds a Tilt Shift effect. - * + * * This Bokeh effect can also be used to generate a Tilt Shift effect, which is a technique used to create a miniature * effect by blurring everything except a small area of the image. This effect is achieved by blurring the * top and bottom elements, while keeping the center area in focus. - * + * * See also Bokeh. * @param radius The radius of the bokeh effect. * @param amount The amount of the bokeh effect. @@ -22157,7 +21819,7 @@ declare namespace Phaser { interface GetBounds { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22167,7 +21829,7 @@ declare namespace Phaser { getCenter(output?: O, includeParent?: boolean): O; /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22177,7 +21839,7 @@ declare namespace Phaser { getTopLeft(output?: O, includeParent?: boolean): O; /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22187,7 +21849,7 @@ declare namespace Phaser { getTopCenter(output?: O, includeParent?: boolean): O; /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22197,7 +21859,7 @@ declare namespace Phaser { getTopRight(output?: O, includeParent?: boolean): O; /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22207,7 +21869,7 @@ declare namespace Phaser { getLeftCenter(output?: O, includeParent?: boolean): O; /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22217,7 +21879,7 @@ declare namespace Phaser { getRightCenter(output?: O, includeParent?: boolean): O; /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22227,7 +21889,7 @@ declare namespace Phaser { getBottomLeft(output?: O, includeParent?: boolean): O; /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22237,7 +21899,7 @@ declare namespace Phaser { getBottomCenter(output?: O, includeParent?: boolean): O; /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -22339,10 +22001,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -22361,12 +22023,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -22416,7 +22078,7 @@ declare namespace Phaser { displayOriginY: number; /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -22470,7 +22132,7 @@ declare namespace Phaser { pathRotationOffset: number; /** * Set the Path that this PathFollower should follow. - * + * * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. * @param path The Path this PathFollower is following. It can only follow one Path at a time. * @param config Settings for the PathFollower. @@ -22520,7 +22182,7 @@ declare namespace Phaser { stopFollow(): this; /** * Internal update handler that advances this PathFollower along the path. - * + * * Called automatically by the Scene step, should not typically be called directly. */ pathUpdate(): void; @@ -22636,12 +22298,12 @@ declare namespace Phaser { interface ScrollFactor { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -22654,12 +22316,12 @@ declare namespace Phaser { scrollFactorX: number; /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -22676,10 +22338,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -22710,7 +22372,7 @@ declare namespace Phaser { interface Size { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -22718,7 +22380,7 @@ declare namespace Phaser { width: number; /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -22726,28 +22388,28 @@ declare namespace Phaser { height: number; /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -22756,12 +22418,12 @@ declare namespace Phaser { setSizeToFrame(frame?: Phaser.Textures.Frame | boolean): this; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -22803,11 +22465,11 @@ declare namespace Phaser { frame: Phaser.Textures.Frame; /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -22818,14 +22480,14 @@ declare namespace Phaser { setTexture(key: string | Phaser.Textures.Texture, frame?: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -22855,26 +22517,26 @@ declare namespace Phaser { isCropped: boolean; /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -22886,7 +22548,7 @@ declare namespace Phaser { setCrop(x?: number | Phaser.Geom.Rectangle, y?: number, width?: number, height?: number): this; /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -22895,14 +22557,14 @@ declare namespace Phaser { setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -22971,11 +22633,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -23025,7 +22687,7 @@ declare namespace Phaser { /** * Build a JSON representation of the given Game Object. - * + * * This is typically extended further by Game Object specific implementations. */ interface ToJSON { @@ -23049,7 +22711,7 @@ declare namespace Phaser { y: number; /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -23061,7 +22723,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -23076,19 +22738,19 @@ declare namespace Phaser { scaleY: number; /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -23110,9 +22772,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -23155,7 +22817,7 @@ declare namespace Phaser { setY(value?: number): this; /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -23184,9 +22846,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -23224,7 +22886,7 @@ declare namespace Phaser { * the camera or display list transform pipeline. * * It is represented like so: - * + * * ``` * | a | c | tx | * | b | d | ty | @@ -23233,7 +22895,7 @@ declare namespace Phaser { */ class TransformMatrix { /** - * + * * @param a The Scale X value. Default 1. * @param b The Skew Y value. Default 0. * @param c The Skew X value. Default 0. @@ -23350,7 +23012,7 @@ declare namespace Phaser { /** * Multiply this Matrix by the given Matrix. - * + * * If an `out` Matrix is given then the results will be stored in it. * If it is not given, this matrix will be updated in place instead. * Use an `out` Matrix if you do not wish to mutate this matrix. @@ -23362,7 +23024,7 @@ declare namespace Phaser { /** * Multiply this Matrix by the matrix given, including the offset. - * + * * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. * The offsetY is added to the ty value: `offsetX * b + offsetY * d + ty`. * @param src The source Matrix to copy from. @@ -23446,7 +23108,7 @@ declare namespace Phaser { /** * Copy the values in this Matrix to the array given. - * + * * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. * @param out The array to copy the matrix values in to. * @returns An array where elements 0 to 5 contain the values from this matrix. @@ -23467,7 +23129,7 @@ declare namespace Phaser { /** * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. - * + * * The result must be applied in the following order to reproduce the current matrix: * * translate -> rotate -> scaleundefined @@ -23489,7 +23151,7 @@ declare namespace Phaser { /** * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of * the current matrix with its transformation applied. - * + * * Can be used to translate points from world to local space. * @param x The x position to translate. * @param y The y position to translate. @@ -23533,7 +23195,7 @@ declare namespace Phaser { /** * Returns the X component of this matrix multiplied by the given values. - * + * * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. * @param x The x value. * @param y The y value. @@ -23544,7 +23206,7 @@ declare namespace Phaser { /** * Returns the Y component of this matrix multiplied by the given values. - * + * * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. * @param x The x value. * @param y The y value. @@ -23577,13 +23239,13 @@ declare namespace Phaser { interface Visible { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -23595,23 +23257,23 @@ declare namespace Phaser { /** * A Container Game Object. - * + * * A Container, as the name implies, can 'contain' other types of Game Object. * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it. * By default it will be removed from the Display List and instead added to the Containers own internal list. - * + * * The position of the Game Object automatically becomes relative to the position of the Container. - * + * * The transform point of a Container is 0x0 (in local space) and that cannot be changed. The children you add to the * Container should be positioned with this value in mind. I.e. you should treat 0x0 as being the center of * the Container, and position children positively and negative around it as required. - * + * * When the Container is rendered, all of its children are rendered as well, in the order in which they exist * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`. - * + * * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will * automatically influence all children as well. - * + * * Containers can include other Containers for deeply nested transforms. * * Containers can have masks set on them and can be used as a mask too. @@ -23621,16 +23283,16 @@ declare namespace Phaser { * * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. - * + * * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, * or the input area will become misaligned. - * + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure * your game to work around this. - * + * * It's important to understand the impact of using Containers. They add additional processing overhead into * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true * for input events. You also lose the ability to set the display depth of Container children in the same @@ -23639,7 +23301,7 @@ declare namespace Phaser { */ class Container extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -23654,10 +23316,10 @@ declare namespace Phaser { /** * Does this Container exclusively manage its children? - * + * * The default is `true` which means a child added to this Container cannot * belong in another Container, which includes the Scene display list. - * + * * If you disable this then this Container will no longer exclusively manage its children. * This allows you to create all kinds of interesting graphical effects, such as replicating * Game Objects without reparenting them all over the Scene. @@ -23687,19 +23349,19 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Container. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Container. - * + * * When a camera scrolls it will change the location at which this Container is rendered on-screen. * It does not change the Containers actual position values. - * + * * For a Container, setting this value will only update the Container itself, not its children. * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Container. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -23709,19 +23371,19 @@ declare namespace Phaser { /** * The vertical scroll factor of this Container. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Container. - * + * * When a camera scrolls it will change the location at which this Container is rendered on-screen. * It does not change the Containers actual position values. - * + * * For a Container, setting this value will only update the Container itself, not its children. * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Container. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -23755,10 +23417,10 @@ declare namespace Phaser { /** * Does this Container exclusively manage its children? - * + * * The default is `true` which means a child added to this Container cannot * belong in another Container, which includes the Scene display list. - * + * * If you disable this then this Container will no longer exclusively manage its children. * This allows you to create all kinds of interesting graphical effects, such as replicating * Game Objects without reparenting them all over the Scene. @@ -23774,13 +23436,13 @@ declare namespace Phaser { * Gets the bounds of this Container. It works by iterating all children of the Container, * getting their respective bounds, and then working out a min-max rectangle from that. * It does not factor in if the children render or not, all are included. - * + * * Some children are unable to return their bounds, such as Graphics objects, in which case * they are skipped. - * + * * Depending on the quantity of children in this Container it could be a really expensive call, * so cache it and only poll it as needed. - * + * * The values are stored and returned in a Rectangle object. * @param output A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created. * @returns The values stored in the output object. @@ -23806,7 +23468,7 @@ declare namespace Phaser { /** * Adds the given Game Object, or array of Game Objects, to this Container. - * + * * Each Game Object must be unique within the Container. * * If you try to add a Layer, it will throw an error. @@ -23817,9 +23479,9 @@ declare namespace Phaser { /** * Adds the given Game Object, or array of Game Objects, to this Container at the specified position. - * + * * Existing Game Objects in the Container are shifted up. - * + * * Each Game Object must be unique within the Container. * @param child The Game Object, or array of Game Objects, to add to the Container. * @param index The position to insert the Game Object/s at. Default 0. @@ -23868,12 +23530,12 @@ declare namespace Phaser { /** * Gets the first Game Object in this Container. - * + * * You can also specify a property and value to search for, in which case it will return the first * Game Object in this Container with a matching property and / or value. - * + * * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set. - * + * * You can limit the search to the `startIndex` - `endIndex` range. * @param property The property to test on each Game Object in the Container. * @param value The value to test the property against. Must pass a strict (`===`) comparison check. @@ -23885,15 +23547,15 @@ declare namespace Phaser { /** * Returns all Game Objects in this Container. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. - * + * * For example: `getAll('body')` would return only Game Objects that have a body property. - * + * * You can also specify a value to compare the property to: - * + * * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`. - * + * * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50 Game Objects. @@ -23908,9 +23570,9 @@ declare namespace Phaser { /** * Returns the total number of Game Objects in this Container that have a property * matching the given value. - * + * * For example: `count('visible', true)` would count all the elements that have their visible property set. - * + * * You can optionally limit the operation to the `startIndex` - `endIndex` range. * @param property The property to check. * @param value The value to check. @@ -23931,9 +23593,9 @@ declare namespace Phaser { /** * Moves a Game Object to a new position within this Container. - * + * * The Game Object must already be a child of this Container. - * + * * The Game Object is removed from its old position and inserted into the new one. * Therefore the Container size does not change. Other children will change position accordingly. * @param child The Game Object to move. @@ -23945,7 +23607,7 @@ declare namespace Phaser { /** * Moves a Game Object above another one within this Container. * If the Game Object is already above the other, it isn't moved. - * + * * These 2 Game Objects must already be children of this Container. * @param child1 The Game Object to move above base Game Object. * @param child2 The base Game Object. @@ -23956,7 +23618,7 @@ declare namespace Phaser { /** * Moves a Game Object below another one within this Container. * If the Game Object is already below the other, it isn't moved. - * + * * These 2 Game Objects must already be children of this Container. * @param child1 The Game Object to move below base Game Object. * @param child2 The base Game Object. @@ -23966,9 +23628,9 @@ declare namespace Phaser { /** * Removes the given Game Object, or array of Game Objects, from this Container. - * + * * The Game Objects must already be children of this Container. - * + * * You can also optionally call `destroy` on each Game Object that is removed from the Container. * @param child The Game Object, or array of Game Objects, to be removed from the Container. * @param destroyChild Optionally call `destroy` on each child successfully removed from this Container. Default false. @@ -23978,7 +23640,7 @@ declare namespace Phaser { /** * Removes the Game Object at the given position in this Container. - * + * * You can also optionally call `destroy` on the Game Object, if one is found. * @param index The index of the Game Object to be removed. * @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false. @@ -23988,7 +23650,7 @@ declare namespace Phaser { /** * Removes the Game Objects between the given positions in this Container. - * + * * You can also optionally call `destroy` on each Game Object that is removed from the Container. * @param startIndex An optional start index to search from. Default 0. * @param endIndex An optional end index to search up to (but not included) Default Container.length. @@ -23999,7 +23661,7 @@ declare namespace Phaser { /** * Removes all Game Objects from this Container. - * + * * You can also optionally call `destroy` on each Game Object that is removed from the Container. * @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false. * @returns This Container instance. @@ -24060,7 +23722,7 @@ declare namespace Phaser { /** * Returns `true` if the given Game Object is a direct child of this Container. - * + * * This check does not scan nested Containers. * @param child The Game Object to check for within this Container. * @returns True if the Game Object is an immediate child of this Container, otherwise false. @@ -24069,7 +23731,7 @@ declare namespace Phaser { /** * Sets the property to the given value on all Game Objects in this Container. - * + * * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50 Game Objects. @@ -24083,10 +23745,10 @@ declare namespace Phaser { /** * Passes all Game Objects in this Container to the given callback. - * + * * A copy of the Container is made before passing each entry to your callback. * This protects against the callback itself modifying the Container. - * + * * If you know for sure that the callback will not change the size of this Container * then you can use the more performant `Container.iterate` method instead. * @param callback The function to call. @@ -24098,7 +23760,7 @@ declare namespace Phaser { /** * Passes all Game Objects in this Container to the given callback. - * + * * Only use this method when you absolutely know that the Container will not be modified during * the iteration, i.e. by removing or adding to its contents. * @param callback The function to call. @@ -24110,16 +23772,16 @@ declare namespace Phaser { /** * Sets the scroll factor of this Container and optionally all of its children. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. - * + * * Please be aware that scroll factor values other than 1 are not taken in to consideration when * calculating physics collisions. Bodies always collide based on their world position, but changing * the scroll factor is a visual adjustment to where the textures are rendered, which can offset @@ -24138,28 +23800,28 @@ declare namespace Phaser { /** * Returns the first Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly first: Phaser.GameObjects.GameObject | null; /** * Returns the last Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly last: Phaser.GameObjects.GameObject | null; /** * Returns the next Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly next: Phaser.GameObjects.GameObject | null; /** * Returns the previous Game Object within the Container, or `null` if it is empty. - * + * * You can move the cursor by calling `Container.next` and `Container.previous`. */ readonly previous: Phaser.GameObjects.GameObject | null; @@ -24413,7 +24075,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -24422,21 +24084,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -24446,21 +24108,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -24472,7 +24134,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -24481,7 +24143,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -24490,30 +24152,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -24536,13 +24198,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -24573,7 +24235,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -24583,11 +24245,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -24596,11 +24258,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -24620,10 +24282,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -24644,12 +24306,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -24676,7 +24338,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -24690,7 +24352,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -24708,20 +24370,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -24746,9 +24408,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -24797,7 +24459,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -24830,9 +24492,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -24863,14 +24525,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -24881,63 +24543,63 @@ declare namespace Phaser { /** * DOM Element Game Objects are a way to control and manipulate HTML Elements over the top of your game. - * + * * In order for DOM Elements to display you have to enable them by adding the following to your game * configuration object: - * + * * ```javascript * dom { * createContainer: true * } * ``` - * + * * You must also have a parent container for Phaser. This is specified by the `parent` property in the * game config. - * + * * When these two things are added, Phaser will automatically create a DOM Container div that is positioned * over the top of the game canvas. This div is sized to match the canvas, and if the canvas size changes, * as a result of settings within the Scale Manager, the dom container is resized accordingly. - * + * * If you have not already done so, you have to provide a `parent` in the Game Configuration, or the DOM * Container will fail to be created. - * + * * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing * Element that you wish to be placed under the control of Phaser. For example: - * + * * ```javascript * this.add.dom(x, y, 'div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); * ``` - * + * * The above code will insert a div element into the DOM Container at the given x/y coordinate. The DOMString in * the 4th argument sets the initial CSS style of the div and the final argument is the inner text. In this case, * it will create a lime colored div that is 220px by 100px in size with the text Phaser in it, in an Arial font. - * + * * You should nearly always, without exception, use explicitly sized HTML Elements, in order to fully control * alignment and positioning of the elements next to regular game content. - * + * * Rather than specify the CSS and HTML directly you can use the `load.html` File Loader to load it into the * cache and then use the `createFromCache` method instead. You can also use `createFromHTML` and various other * methods available in this class to help construct your elements. - * + * * Once the element has been created you can then control it like you would any other Game Object. You can set its * position, scale, rotation, alpha and other properties. It will move as the main Scene Camera moves and be clipped * at the edge of the canvas. It's important to remember some limitations of DOM Elements: The obvious one is that * they appear above or below your game canvas. You cannot blend them into the display list, meaning you cannot have * a DOM Element, then a Sprite, then another DOM Element behind it. - * + * * They also cannot be enabled for input. To do that, you have to use the `addListener` method to add native event * listeners directly. The final limitation is to do with cameras. The DOM Container is sized to match the game canvas * entirely and clipped accordingly. DOM Elements respect camera scrolling and scrollFactor settings, but if you * change the size of the camera so it no longer matches the size of the canvas, they won't be clipped accordingly. - * + * * DOM Game Objects can be added to a Phaser Container, however you should only nest them **one level deep**. * Any further down the chain and they will ignore all root container properties. - * + * * Also, all DOM Elements are inserted into the same DOM Container, regardless of which Scene they are created in. - * + * * Note that you should only have DOM Elements in a Scene with a _single_ Camera. If you require multiple cameras, * use parallel scenes to achieve this. - * + * * DOM Elements are a powerful way to align native HTML with your Phaser Game Objects. For example, you can insert * a login form for a multiplayer game directly into your title screen. Or a text input box for a highscore table. * Or a banner ad from a 3rd party service. Or perhaps you'd like to use them for high resolution text display and @@ -24946,7 +24608,7 @@ declare namespace Phaser { */ class DOMElement extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this DOM Element in the world. Default 0. * @param y The vertical position of this DOM Element in the world. Default 0. @@ -24977,7 +24639,7 @@ declare namespace Phaser { * updated when its rendered. If, for some reason, you don't want any of these changed other than the * CSS transform, then set this flag to `true`. When `true` only the CSS Transform is applied and it's * up to you to keep track of and set the other properties as required. - * + * * This can be handy if, for example, you've a nested DOM Element and you don't want the opacity to be * picked-up by any of its children. */ @@ -24985,14 +24647,14 @@ declare namespace Phaser { /** * The angle, in radians, by which to skew the DOM Element on the horizontal axis. - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform */ skewX: number; /** * The angle, in radians, by which to skew the DOM Element on the vertical axis. - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform */ skewY: number; @@ -25004,7 +24666,7 @@ declare namespace Phaser { * angle of rotation, in the unit defined by the `rotate3dAngle` property (degrees by default). * * For more details see the following MDN page: - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d */ rotate3d: Phaser.Math.Vector4; @@ -25012,14 +24674,14 @@ declare namespace Phaser { /** * The unit that represents the 3D rotation values. By default this is `deg` for degrees, but can * be changed to any supported unit. See this page for further details: - * + * * https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate3d */ rotate3dAngle: string; /** * Sets the CSS `pointerEvents` attribute on the DOM Element during rendering. - * + * * This is 'auto' by default. Changing it may have unintended side-effects with * internal Phaser input handling, such as dragging, so only change this if you * understand the implications. @@ -25028,39 +24690,39 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * For a DOM Element this property is read-only. - * + * * The property `displayWidth` holds the computed bounds of this DOM Element, factoring in scaling. */ readonly width: number; /** * The native (un-scaled) height of this Game Object. - * + * * For a DOM Element this property is read-only. - * + * * The property `displayHeight` holds the computed bounds of this DOM Element, factoring in scaling. */ readonly height: number; /** * The computed display width of this Game Object, based on the `getBoundingClientRect` DOM call. - * + * * The property `width` holds the un-scaled width of this DOM Element. */ readonly displayWidth: number; /** * The computed display height of this Game Object, based on the `getBoundingClientRect` DOM call. - * + * * The property `height` holds the un-scaled height of this DOM Element. */ readonly displayHeight: number; /** * Sets the horizontal and vertical skew values of this DOM Element. - * + * * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/transform * @param x The angle, in radians, by which to skew the DOM Element on the horizontal axis. Default 0. * @param y The angle, in radians, by which to skew the DOM Element on the vertical axis. Default x. @@ -25073,9 +24735,9 @@ declare namespace Phaser { * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined * by the value of this property. - * + * * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective - * + * * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** * @param value The perspective value, in pixels, that determines the distance between the z plane and the user. * @returns This DOM Element instance. @@ -25087,9 +24749,9 @@ declare namespace Phaser { * plane and the user in order to give a 3D-positioned element some perspective. Each 3D element with * z > 0 becomes larger; each 3D-element with z < 0 becomes smaller. The strength of the effect is determined * by the value of this property. - * + * * For more information see: https://developer.mozilla.org/en-US/docs/Web/CSS/perspective - * + * * **Changing this value changes it globally for all DOM Elements, as they all share the same parent container.** */ perspective: number; @@ -25097,14 +24759,14 @@ declare namespace Phaser { /** * Adds one or more native DOM event listeners onto the underlying Element of this Game Object. * The event is then dispatched via this Game Objects standard event emitter. - * + * * For example: - * + * * ```javascript * var div = this.add.dom(x, y, element); - * + * * div.addListener('click'); - * + * * div.on('click', handler); * ``` * @param events The DOM event/s to listen for. You can specify multiple events by separating them with spaces. @@ -25122,22 +24784,22 @@ declare namespace Phaser { /** * Creates a native DOM Element, adds it to the parent DOM Container and then binds it to this Game Object, * so you can control it. The `tagName` should be a string and is passed to `document.createElement`: - * + * * ```javascript * this.add.dom().createElement('div'); * ``` - * + * * For more details on acceptable tag names see: https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement - * + * * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` * value as well. Here is an example of a DOMString: - * + * * ```javascript * this.add.dom().createElement('div', 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); * ``` - * + * * And using a style object: - * + * * ```javascript * var style = { * 'background-color': 'lime'; @@ -25145,10 +24807,10 @@ declare namespace Phaser { * 'height': '100px'; * 'font': '48px Arial'; * }; - * + * * this.add.dom().createElement('div', style, 'Phaser'); * ``` - * + * * If this Game Object already has an Element, it is removed from the DOM entirely first. * Any event listeners you may have previously created will need to be re-created after this call. * @param tagName A string that specifies the type of element to be created. The nodeName of the created element is initialized with the value of tagName. Don't use qualified names (like "html:a") with this method. @@ -25161,34 +24823,34 @@ declare namespace Phaser { /** * Binds a new DOM Element to this Game Object. If this Game Object already has an Element it is removed from the DOM * entirely first. Any event listeners you may have previously created will need to be re-created on the new element. - * + * * The `element` argument you pass to this method can be either a string tagName: - * + * * ```javascript *

Phaser

- * + * * this.add.dom().setElement('heading'); * ``` - * + * * Or a reference to an Element instance: - * + * * ```javascript *

Phaser

- * + * * var h1 = document.getElementById('heading'); - * + * * this.add.dom().setElement(h1); * ``` - * + * * You can also pass in a DOMString or style object to set the CSS on the created element, and an optional `innerText` * value as well. Here is an example of a DOMString: - * + * * ```javascript * this.add.dom().setElement(h1, 'background-color: lime; width: 220px; height: 100px; font: 48px Arial', 'Phaser'); * ``` - * + * * And using a style object: - * + * * ```javascript * var style = { * 'background-color': 'lime'; @@ -25196,7 +24858,7 @@ declare namespace Phaser { * 'height': '100px'; * 'font': '48px Arial'; * }; - * + * * this.add.dom().setElement(h1, style, 'Phaser'); * ``` * @param element If a string it is passed to `getElementById()`, or it should be a reference to an existing Element. @@ -25210,29 +24872,29 @@ declare namespace Phaser { * Takes a block of html from the HTML Cache, that has previously been preloaded into the game, and then * creates a DOM Element from it. The loaded HTML is set as the `innerHTML` property of the created * element. - * + * * Assume the following html is stored in a file called `loginform.html`: - * + * * ```html * * * ``` - * + * * Which is loaded into your game using the cache key 'login': - * + * * ```javascript * this.load.html('login', 'assets/loginform.html'); * ``` - * + * * You can create a DOM Element from it using the cache key: - * + * * ```javascript * this.add.dom().createFromCache('login'); * ``` - * + * * The optional `elementType` argument controls the container that is created, into which the loaded html is inserted. * The default is a plain `div` object, but any valid tagName can be given. - * + * * If this Game Object already has an Element, it is removed from the DOM entirely first. * Any event listeners you may have previously created will need to be re-created after this call. * @param key The key of the html cache entry to use for this DOM Element. @@ -25244,23 +24906,23 @@ declare namespace Phaser { /** * Takes a string of html and then creates a DOM Element from it. The HTML is set as the `innerHTML` * property of the created element. - * + * * ```javascript * let form = ` * * * `; * ``` - * + * * You can create a DOM Element from it using the string: - * + * * ```javascript * this.add.dom().createFromHTML(form); * ``` - * + * * The optional `elementType` argument controls the type of container that is created, into which the html is inserted. * The default is a plain `div` object, but any valid tagName can be given. - * + * * If this Game Object already has an Element, it is removed from the DOM entirely first. * Any event listeners you may have previously created will need to be re-created after this call. * @param html A string of html to be set as the `innerHTML` property of the created element. @@ -25277,7 +24939,7 @@ declare namespace Phaser { removeElement(): this; /** - * Internal method that sets the `displayWidth` and `displayHeight` properties, and the `clientWidth` + * Internal method that sets the `displayWidth` and `displayHeight` properties, and the `clientWidth` * and `clientHeight` values into the `width` and `height` properties respectively. * * This is called automatically whenever a new element is created or set.undefined @@ -25298,7 +24960,7 @@ declare namespace Phaser { /** * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through * them, looking for the first one that has a matching id. It then returns this child if found, or `null` if not. - * + * * Be aware that class and id names are case-sensitive. * @param id The id to search the children for. * @returns The first matching child DOM Element, or `null` if not found. @@ -25308,7 +24970,7 @@ declare namespace Phaser { /** * Gets all children from this DOM Elements node, using `querySelectorAll('*')` and then iterates through * them, looking for the first one that has a matching name. It then returns this child if found, or `null` if not. - * + * * Be aware that class and id names are case-sensitive. * @param name The name to search the children for. * @returns The first matching child DOM Element, or `null` if not found. @@ -25324,7 +24986,7 @@ declare namespace Phaser { /** * Sets the `innerText` property of the DOM Element node and updates the internal sizes. - * + * * Note that only certain types of Elements can have `innerText` set on them. * @param text A DOMString representing the rendered text content of the element. * @returns This DOM Element instance. @@ -25585,7 +25247,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -25594,21 +25256,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -25618,21 +25280,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -25644,13 +25306,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -25681,7 +25343,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -25691,11 +25353,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -25704,11 +25366,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -25751,7 +25413,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -25786,12 +25448,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -25805,12 +25467,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -25828,10 +25490,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -25863,7 +25525,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -25877,7 +25539,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -25895,20 +25557,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -25933,9 +25595,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -25984,7 +25646,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -26017,9 +25679,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -26050,14 +25712,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -26069,225 +25731,225 @@ declare namespace Phaser { namespace Events { /** * The Game Object Added to Scene Event. - * + * * This event is dispatched when a Game Object is added to a Scene. - * + * * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. */ - const ADDED_TO_SCENE: string; + const ADDED_TO_SCENE: 'addedtoscene'; /** * The Game Object Destroy Event. - * + * * This event is dispatched when a Game Object instance is being destroyed. - * + * * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`. */ - const DESTROY: string; + const DESTROY: 'destroy'; /** * The Game Object Removed from Scene Event. - * + * * This event is dispatched when a Game Object is removed from a Scene. - * + * * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. */ - const REMOVED_FROM_SCENE: string; + const REMOVED_FROM_SCENE: 'removedfromscene'; /** * The Video Game Object Complete Event. - * + * * This event is dispatched when a Video finishes playback by reaching the end of its duration. It * is also dispatched if a video marker sequence is being played and reaches the end. - * + * * Note that not all videos can fire this event. Live streams, for example, have no fixed duration, * so never technically 'complete'. - * + * * If a video is stopped from playback, via the `Video.stop` method, it will emit the * `VIDEO_STOP` event instead of this one. - * + * * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`. */ - const VIDEO_COMPLETE: string; + const VIDEO_COMPLETE: 'complete'; /** * The Video Game Object Created Event. - * + * * This event is dispatched when the texture for a Video has been created. This happens * when enough of the video source has been loaded that the browser is able to render a * frame from it. - * + * * Listen for it from a Video Game Object instance using `Video.on('created', listener)`. */ - const VIDEO_CREATED: string; + const VIDEO_CREATED: 'created'; /** * The Video Game Object Error Event. - * + * * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type. - * + * * Listen for it from a Video Game Object instance using `Video.on('error', listener)`. */ - const VIDEO_ERROR: string; + const VIDEO_ERROR: 'error'; /** * The Video Game Object Locked Event. - * + * * This event is dispatched when a Video was attempted to be played, but the browser prevented it * from doing so due to the Media Engagement Interaction policy. - * + * * If you get this event you will need to wait for the user to interact with the browser before * the video will play. This is a browser security measure to prevent autoplaying videos with * audio. An interaction includes a mouse click, a touch, or a key press. - * + * * Listen for it from a Video Game Object instance using `Video.on('locked', listener)`. */ - const VIDEO_LOCKED: string; + const VIDEO_LOCKED: 'locked'; /** * The Video Game Object Loop Event. - * + * * This event is dispatched when a Video that is currently playing has looped. This only * happens if the `loop` parameter was specified, or the `setLoop` method was called, * and if the video has a fixed duration. Video streams, for example, cannot loop, as * they have no duration. - * + * * Looping is based on the result of the Video `timeupdate` event. This event is not * frame-accurate, due to the way browsers work, so please do not rely on this loop * event to be time or frame precise. - * + * * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`. */ - const VIDEO_LOOP: string; + const VIDEO_LOOP: 'loop'; /** * The Video Game Object Metadata Event. - * + * * This event is dispatched when a Video has access to the metadata. - * + * * Listen for it from a Video Game Object instance using `Video.on('metadata', listener)`. */ - const VIDEO_METADATA: string; + const VIDEO_METADATA: 'metadata'; /** * The Video Game Object Playing Event. - * + * * The playing event is fired after playback is first started, * and whenever it is restarted. For example it is fired when playback * resumes after having been paused or delayed due to lack of data. - * + * * Listen for it from a Video Game Object instance using `Video.on('playing', listener)`. */ - const VIDEO_PLAYING: string; + const VIDEO_PLAYING: 'playing'; /** * The Video Game Object Play Event. - * + * * This event is dispatched when a Video begins playback. For videos that do not require * interaction unlocking, this is usually as soon as the `Video.play` method is called. * However, for videos that require unlocking, it is fired once playback begins after * they've been unlocked. - * + * * Listen for it from a Video Game Object instance using `Video.on('play', listener)`. */ - const VIDEO_PLAY: string; + const VIDEO_PLAY: 'play'; /** * The Video Game Object Seeked Event. - * + * * This event is dispatched when a Video completes seeking to a new point in its timeline. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`. */ - const VIDEO_SEEKED: string; + const VIDEO_SEEKED: 'seeked'; /** * The Video Game Object Seeking Event. - * + * * This event is dispatched when a Video _begins_ seeking to a new point in its timeline. * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude. - * + * * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`. */ - const VIDEO_SEEKING: string; + const VIDEO_SEEKING: 'seeking'; /** * The Video Game Object Stalled Event. - * + * * This event is dispatched by a Video Game Object when the video playback stalls. - * + * * This can happen if the video is buffering. - * + * * If will fire for any of the following native DOM events: - * + * * `stalled` * `suspend` * `waiting` - * + * * Listen for it from a Video Game Object instance using `Video.on('stalled', listener)`. - * + * * Note that being stalled isn't always a negative thing. A video can be stalled if it * has downloaded enough data in to its buffer to not need to download any more until * the current batch of frames have rendered. */ - const VIDEO_STALLED: string; + const VIDEO_STALLED: 'stalled'; /** * The Video Game Object Stopped Event. - * + * * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method, * either directly via game code, or indirectly as the result of changing a video source or destroying it. - * + * * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`. */ - const VIDEO_STOP: string; + const VIDEO_STOP: 'stop'; /** * The Video Game Object Texture Ready Event. - * + * * This event is dispatched by a Video Game Object when it has finished creating its texture. - * + * * This happens when the video has finished loading enough data for its first frame. - * + * * If you wish to use the Video texture elsewhere in your game, such as as a Sprite texture, * then you should listen for this event first, before creating the Sprites that use it. - * + * * Listen for it from a Video Game Object instance using `Video.on('textureready', listener)`. */ - const VIDEO_TEXTURE: string; + const VIDEO_TEXTURE: 'textureready'; /** * The Video Game Object Unlocked Event. - * + * * This event is dispatched when a Video that was prevented from playback due to the browsers * Media Engagement Interaction policy, is unlocked by a user gesture. - * + * * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`. */ - const VIDEO_UNLOCKED: string; + const VIDEO_UNLOCKED: 'unlocked'; /** * The Video Game Object Unsupported Event. - * + * * This event is dispatched by a Video Game Object if the media source * (which may be specified as a MediaStream, MediaSource, Blob, or File, * for example) doesn't represent a supported media format. - * + * * Listen for it from a Video Game Object instance using `Video.on('unsupported', listener)`. */ - const VIDEO_UNSUPPORTED: string; + const VIDEO_UNSUPPORTED: 'unsupported'; } /** * An Extern Game Object is a special type of Game Object that allows you to pass * rendering off to a 3rd party. - * + * * When you create an Extern and place it in the display list of a Scene, the renderer will * process the list as usual. When it finds an Extern it will flush the current batch * and prepare a transform matrix which your render function can * take advantage of, if required. - * + * * The WebGL context is then left in a 'clean' state, ready for you to bind your own shaders, * or draw to it, whatever you wish to do. This should all take place in the `render` method. * The correct way to deploy an Extern object is to create a class that extends it, then @@ -26309,7 +25971,7 @@ declare namespace Phaser { */ class Extern extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. */ constructor(scene: Phaser.Scene); @@ -26584,7 +26246,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -26630,21 +26292,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -26654,21 +26316,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -26680,13 +26342,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -26717,7 +26379,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -26727,11 +26389,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -26740,11 +26402,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -26865,7 +26527,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -26900,12 +26562,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -26919,12 +26581,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -26942,10 +26604,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -26962,7 +26624,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -26971,7 +26633,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -26980,30 +26642,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -27013,12 +26675,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -27052,11 +26714,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -27068,14 +26730,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -27144,11 +26806,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -27216,7 +26878,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -27230,7 +26892,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -27248,20 +26910,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -27286,9 +26948,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -27337,7 +26999,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -27370,9 +27032,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -27403,14 +27065,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -28427,10 +28089,10 @@ declare namespace Phaser { * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics * object it will be empty. - * + * * To draw to it you must first specify a line style or fill style (or both), draw shapes using paths, and finally * fill or stroke them. For example: - * + * * ```javascript * graphics.lineStyle(5, 0xFF00FF, 1.0); * graphics.beginPath(); @@ -28439,21 +28101,21 @@ declare namespace Phaser { * graphics.closePath(); * graphics.strokePath(); * ``` - * + * * There are also many helpful methods that draw and fill/stroke common shapes for you. - * + * * ```javascript * graphics.lineStyle(5, 0xFF00FF, 1.0); * graphics.fillStyle(0xFFFFFF, 1.0); * graphics.fillRect(50, 50, 400, 200); * graphics.strokeRect(50, 50, 400, 200); * ``` - * + * * When a Graphics object is rendered it will render differently based on if the game is running under Canvas or WebGL. * Under Canvas it will use the HTML Canvas context drawing operations to draw the path. * Under WebGL the graphics data is decomposed into polygons. Both of these are expensive processes, especially with * complex shapes. - * + * * If your Graphics object doesn't change much (or at all) once you've drawn your shape to it, then you will help * performance by calling {@link Phaser.GameObjects.Graphics#generateTexture}. This will 'bake' the Graphics object into * a Texture, and return it. You can then use this Texture for Sprites or other display objects. If your Graphics object @@ -28470,7 +28132,7 @@ declare namespace Phaser { */ class Graphics extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { /** - * + * * @param scene The Scene to which this Graphics object belongs. * @param options Options that set the position and default style of this Graphics object. */ @@ -28563,15 +28225,15 @@ declare namespace Phaser { /** * Sets a gradient fill style. This is a WebGL only feature. - * + * * The gradient color values represent the 4 corners of an untransformed rectangle. * The gradient is used to color all filled shapes and paths drawn after calling this method. * If you wish to turn a gradient off, call `fillStyle` and provide a new single fill color. - * + * * When filling a triangle only the first 3 color values provided are used for the 3 points of a triangle. - * + * * This feature is best used only on rectangles and triangles. All other shapes will give strange results. - * + * * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used * will be filled with a gradient on its own. There is no ability to gradient fill a shape or path as a single * entity at this time. @@ -28589,13 +28251,13 @@ declare namespace Phaser { /** * Sets a gradient line style. This is a WebGL only feature. - * + * * The gradient color values represent the 4 corners of an untransformed rectangle. * The gradient is used to color all stroked shapes and paths drawn after calling this method. * If you wish to turn a gradient off, call `lineStyle` and provide a new single line color. - * + * * This feature is best used only on single lines. All other shapes will give strange results. - * + * * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used * will be filled with a gradient on its own. There is no ability to gradient stroke a shape or path as a single * entity at this time. @@ -28629,7 +28291,7 @@ declare namespace Phaser { /** * Fill the current path. - * + * * This is an alias for `Graphics.fillPath` and does the same thing. * It was added to match the CanvasRenderingContext 2D API.undefined * @returns This Game Object. @@ -28644,7 +28306,7 @@ declare namespace Phaser { /** * Stroke the current path. - * + * * This is an alias for `Graphics.strokePath` and does the same thing. * It was added to match the CanvasRenderingContext 2D API.undefined * @returns This Game Object. @@ -28741,7 +28403,7 @@ declare namespace Phaser { /** * Fill the given point. - * + * * Draws a square at the given position, 1 pixel in size by default. * @param point The point to fill. * @param size The size of the square to draw. Default 1. @@ -28751,7 +28413,7 @@ declare namespace Phaser { /** * Fill a point at the given position. - * + * * Draws a square at the given position, 1 pixel in size by default. * @param x The x coordinate of the point. * @param y The y coordinate of the point. @@ -28817,7 +28479,7 @@ declare namespace Phaser { /** * Draw a line from the current drawing position to the given position. - * + * * Moves the current drawing position to the given position. * @param x The x coordinate to draw the line to. * @param y The y coordinate to draw the line to. @@ -28835,9 +28497,9 @@ declare namespace Phaser { /** * Stroke the shape represented by the given array of points. - * + * * Pass `closeShape` to automatically close the shape by joining the last to the first point. - * + * * Pass `closePath` to automatically close the path before it is stroked. * @param points The points to stroke. * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. @@ -28849,9 +28511,9 @@ declare namespace Phaser { /** * Fill the shape represented by the given array of points. - * + * * Pass `closeShape` to automatically close the shape by joining the last to the first point. - * + * * Pass `closePath` to automatically close the path before it is filled. * @param points The points to fill. * @param closeShape When `true`, the shape is closed by joining the last point to the first point. Default false. @@ -28901,16 +28563,16 @@ declare namespace Phaser { /** * Draw an arc. - * + * * This method can be used to create circles, or parts of circles. - * + * * Make sure you call `beginPath` before starting the arc unless you wish for the arc to automatically * close when filled or stroked. - * + * * Use the optional `overshoot` argument increase the number of iterations that take place when * the arc is rendered in WebGL. This is useful if you're drawing an arc with an especially thick line, * as it will allow the arc to fully join-up. Try small values at first, i.e. 0.01. - * + * * Call {@link Phaser.GameObjects.Graphics#fillPath} or {@link Phaser.GameObjects.Graphics#strokePath} after calling * this method to draw the arc. * @param x The x coordinate of the center of the circle. @@ -28927,10 +28589,10 @@ declare namespace Phaser { /** * Creates a pie-chart slice shape centered at `x`, `y` with the given radius. * You must define the start and end angle of the slice. - * + * * Setting the `anticlockwise` argument to `true` creates a shape similar to Pacman. * Setting it to `false` creates a shape like a slice of pie. - * + * * This method will begin a new path and close the path at the end of it. * To display the actual slice you need to call either `strokePath` or `fillPath` after it. * @param x The horizontal center of the slice. @@ -28954,7 +28616,7 @@ declare namespace Phaser { /** * Restores the most recently saved state of the Graphics by popping from the state stack. - * + * * Use {@link Phaser.GameObjects.Graphics#save} to save the current state, and call this afterwards to restore that state. * * If there is no saved state, this command does nothing.undefined @@ -28964,10 +28626,10 @@ declare namespace Phaser { /** * Inserts a translation command into this Graphics objects command buffer. - * + * * All objects drawn _after_ calling this method will be translated * by the given amount. - * + * * This does not change the position of the Graphics object itself, * only of the objects drawn by it after calling this method. * @param x The horizontal translation to apply. @@ -28978,10 +28640,10 @@ declare namespace Phaser { /** * Inserts a scale command into this Graphics objects command buffer. - * + * * All objects drawn _after_ calling this method will be scaled * by the given amount. - * + * * This does not change the scale of the Graphics object itself, * only of the objects drawn by it after calling this method. * @param x The horizontal scale to apply. @@ -28992,10 +28654,10 @@ declare namespace Phaser { /** * Inserts a rotation command into this Graphics objects command buffer. - * + * * All objects drawn _after_ calling this method will be rotated * by the given amount. - * + * * This does not change the rotation of the Graphics object itself, * only of the objects drawn by it after calling this method. * @param radians The rotation angle, in radians. @@ -29011,13 +28673,13 @@ declare namespace Phaser { /** * Generate a texture from this Graphics object. - * + * * If `key` is a string it'll generate a new texture using it and add it into the * Texture Manager (assuming no key conflict happens). * * If `key` is a Canvas it will draw the Graphics to that canvas context. Note that it will NOT * automatically upload it to the GPU in WebGL mode. - * + * * Please understand that the texture is created via the Canvas API of the browser, therefore some * Graphics features, such as `fillGradientStyle`, will not appear on the resulting texture, * as they're unsupported by the Canvas API. @@ -29277,7 +28939,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -29286,21 +28948,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -29310,21 +28972,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -29336,13 +28998,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -29373,7 +29035,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -29383,11 +29045,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -29396,11 +29058,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -29466,10 +29128,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -29490,12 +29152,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -29589,7 +29251,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -29603,7 +29265,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -29621,20 +29283,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -29659,9 +29321,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -29710,7 +29372,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -29743,9 +29405,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -29776,14 +29438,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -29792,12 +29454,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -29811,12 +29473,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -29834,10 +29496,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -29863,12 +29525,12 @@ declare namespace Phaser { * especially useful for frequently spawned objects such as bullets, particles, or enemies. * * Group membership is non-exclusive. A Game Object can belong to several groups, one group, or none. - * + * * Groups themselves aren't displayable, and can't be positioned, rotated, scaled, or hidden. */ class Group extends Phaser.Events.EventEmitter { /** - * + * * @param scene The scene this group belongs to. * @param children Game Objects to add to this group; or the `config` argument. * @param config Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings. @@ -29921,7 +29583,7 @@ declare namespace Phaser { /** * A default texture key to use when creating new group members. - * + * * This is used in {@link Phaser.GameObjects.Group#create} * but not in {@link Phaser.GameObjects.Group#createMultiple}. */ @@ -29966,7 +29628,7 @@ declare namespace Phaser { /** * Creates a new Game Object and adds it to this group, unless the group {@link Phaser.GameObjects.Group#isFull is full}. - * + * * Calls {@link Phaser.GameObjects.Group#createCallback}. * @param x The horizontal position of the new Game Object in the world. Default 0. * @param y The vertical position of the new Game Object in the world. Default 0. @@ -29980,9 +29642,9 @@ declare namespace Phaser { /** * Creates several Game Objects and adds them to this group. - * + * * If the group becomes {@link Phaser.GameObjects.Group#isFull}, no further Game Objects are created. - * + * * Calls {@link Phaser.GameObjects.Group#createMultipleCallback} and {@link Phaser.GameObjects.Group#createCallback}. * @param config Creation settings. This can be a single configuration object or an array of such objects, which will be applied in turn. * @returns The newly created Game Objects. @@ -30005,7 +29667,7 @@ declare namespace Phaser { /** * Adds a Game Object to this group. - * + * * Calls {@link Phaser.GameObjects.Group#createCallback}. * @param child The Game Object to add. * @param addToScene Also add the Game Object to the scene. Default false. @@ -30015,7 +29677,7 @@ declare namespace Phaser { /** * Adds several Game Objects to this group. - * + * * Calls {@link Phaser.GameObjects.Group#createCallback}. * @param children The Game Objects to add. * @param addToScene Also add the Game Objects to the scene. Default false. @@ -30025,7 +29687,7 @@ declare namespace Phaser { /** * Removes a member of this Group and optionally removes it from the Scene and / or destroys it. - * + * * Calls {@link Phaser.GameObjects.Group#removeCallback}. * @param child The Game Object to remove. * @param removeFromScene Optionally remove the Group member from the Scene it belongs to. Default false. @@ -30036,7 +29698,7 @@ declare namespace Phaser { /** * Removes all members of this Group and optionally removes them from the Scene and / or destroys them. - * + * * Does not call {@link Phaser.GameObjects.Group#removeCallback}. * @param removeFromScene Optionally remove each Group member from the Scene. Default false. * @param destroyChild Optionally call destroy on the removed Group members. Default false. @@ -30065,9 +29727,9 @@ declare namespace Phaser { /** * Returns all children in this Group that match the given criteria based on the `property` and `value` arguments. - * + * * For example: `getMatching('visible', true)` would return only children that have their `visible` property set. - * + * * Optionally, you can specify a start and end index. For example if the Group has 100 elements, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50. @@ -30082,7 +29744,7 @@ declare namespace Phaser { /** * Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. @@ -30099,7 +29761,7 @@ declare namespace Phaser { /** * Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param nth The nth matching Group member to search for. @@ -30117,7 +29779,7 @@ declare namespace Phaser { /** * Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param state The {@link Phaser.GameObjects.GameObject#active} value to match. Default false. @@ -30134,7 +29796,7 @@ declare namespace Phaser { /** * Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, * assigns `x` and `y`, and returns the member. - * + * * If no matching member is found and `createIfNull` is true and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param nth The nth matching Group member to search for. @@ -30152,7 +29814,7 @@ declare namespace Phaser { /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, * assigns `x` and `y`, and returns the member. - * + * * If no inactive member is found and the group isn't full then it will create a new Game Object using `x`, `y`, `key`, `frame`, and `visible`. * The new Game Object will have its active state set to `true`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. @@ -30168,7 +29830,7 @@ declare namespace Phaser { /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `true`, * assigns `x` and `y`, and returns the member. - * + * * If no active member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. * @param createIfNull Create a new Game Object if no matching members are found, using the following arguments. Default false. @@ -30184,7 +29846,7 @@ declare namespace Phaser { /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, * assigns `x` and `y`, and returns the member. - * + * * If no inactive member is found and `createIfNull` is `true` and the group isn't full then it will create a new one using `x`, `y`, `key`, `frame`, and `visible`. * The new Game Object will have an active state set to `true`. * Unless a new member is created, `key`, `frame`, and `visible` are ignored. @@ -30326,7 +29988,7 @@ declare namespace Phaser { /** * Iterate through the group members changing the position of each element to be that of the element that came before * it in the array (or after it if direction = 1) - * + * * The first group member position is set to x/y. * @param x The x coordinate to place the first item in the array at. * @param y The y coordinate to place the first item in the array at. @@ -30480,12 +30142,12 @@ declare namespace Phaser { /** * Empties this Group of all children and removes it from the Scene. - * + * * Does not call {@link Phaser.GameObjects.Group#removeCallback}. - * + * * Children of this Group will _not_ be removed from the Scene by calling this method * unless you specify the `removeFromScene` parameter. - * + * * Children of this Group will also _not_ be destroyed by calling this method * unless you specify the `destroyChildren` parameter. * @param destroyChildren Also {@link Phaser.GameObjects.GameObject#destroy} each Group member. Default false. @@ -30497,7 +30159,7 @@ declare namespace Phaser { /** * An Image Game Object. - * + * * An Image is a light-weight Game Object useful for the display of static images in your game, * such as logos, backgrounds, scenery or other non-animated elements. Images can have input * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an @@ -30505,7 +30167,7 @@ declare namespace Phaser { */ class Image extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -30746,7 +30408,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -30792,21 +30454,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -30816,21 +30478,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -30842,13 +30504,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -30879,7 +30541,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -30889,11 +30551,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -30902,11 +30564,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -30993,7 +30655,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31004,7 +30666,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31015,7 +30677,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31026,7 +30688,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31037,7 +30699,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31048,7 +30710,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31059,7 +30721,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31070,7 +30732,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31081,7 +30743,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -31163,10 +30825,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -31187,12 +30849,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -31238,7 +30900,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -31340,12 +31002,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -31359,12 +31021,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -31382,10 +31044,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -31402,7 +31064,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -31411,7 +31073,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -31420,30 +31082,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -31453,12 +31115,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -31499,26 +31161,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -31531,7 +31193,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -31541,14 +31203,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -31617,11 +31279,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -31689,7 +31351,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -31703,7 +31365,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -31721,20 +31383,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -31759,9 +31421,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -31810,7 +31472,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -31843,9 +31505,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -31876,14 +31538,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -31894,28 +31556,28 @@ declare namespace Phaser { /** * A Layer Game Object. - * + * * A Layer is a special type of Game Object that acts as a Display List. You can add any type of Game Object * to a Layer, just as you would to a Scene. Layers can be used to visually group together 'layers' of Game * Objects: - * + * * ```javascript * const spaceman = this.add.sprite(150, 300, 'spaceman'); * const bunny = this.add.sprite(400, 300, 'bunny'); * const elephant = this.add.sprite(650, 300, 'elephant'); - * + * * const layer = this.add.layer(); - * + * * layer.add([ spaceman, bunny, elephant ]); * ``` - * + * * The 3 sprites in the example above will now be managed by the Layer they were added to. Therefore, * if you then set `layer.setVisible(false)` they would all vanish from the display. - * + * * You can also control the depth of the Game Objects within the Layer. For example, calling the * `setDepth` method of a child of a Layer will allow you to adjust the depth of that child _within the * Layer itself_, rather than the whole Scene. The Layer, too, can have its depth set as well. - * + * * The Layer class also offers many different methods for manipulating the list, such as the * methods `moveUp`, `moveDown`, `sendToBack`, `bringToTop` and so on. These allow you to change the * display list position of the Layers children, causing it to adjust the order in which they are @@ -31924,10 +31586,10 @@ declare namespace Phaser { * Layers have no position or size within the Scene. This means you cannot enable a Layer for * physics or input, or change the position, rotation or scale of a Layer. They also have no scroll * factor, texture, tint, origin, crop or bounds. - * + * * If you need those kind of features then you should use a Container instead. Containers can be added * to Layers, but Layers cannot be added to Containers. - * + * * However, you can set the Alpha, Blend Mode, Depth, Mask and Visible state of a Layer. These settings * will impact all children being rendered by the Layer. * @@ -31939,7 +31601,7 @@ declare namespace Phaser { */ class Layer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param children An optional array of Game Objects to add to this Layer. */ @@ -31947,9 +31609,9 @@ declare namespace Phaser { /** * A reference to the Scene to which this Game Object belongs. - * + * * Game Objects can only belong to one Scene. - * + * * You should consider this property as being read-only. You cannot move a * Game Object to another Scene by simply changing it. */ @@ -31972,7 +31634,7 @@ declare namespace Phaser { /** * A Layer cannot be enabled for input. - * + * * This method does nothing and is kept to ensure * the Layer has the same shape as a Game Object.undefined * @returns This GameObject. @@ -31981,7 +31643,7 @@ declare namespace Phaser { /** * A Layer cannot be enabled for input. - * + * * This method does nothing and is kept to ensure * the Layer has the same shape as a Game Object.undefined * @returns This GameObject. @@ -31990,7 +31652,7 @@ declare namespace Phaser { /** * A Layer cannot be enabled for input. - * + * * This method does nothing and is kept to ensure * the Layer has the same shape as a Game Object.undefined * @returns This GameObject. @@ -32416,14 +32078,14 @@ declare namespace Phaser { /** * Destroys this Layer removing it from the Display List and Update List and * severing all ties to parent resources. - * + * * Also destroys all children of this Layer. If you do not wish for the * children to be destroyed, you should move them from this Layer first. - * + * * Use this to remove this Layer from your game if you don't ever plan to use it again. * As long as no reference to it exists within your own code it should become free for * garbage collection by the browser. - * + * * If you just want to temporarily disable an object then look at using the * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. * @param fromScene `True` if this Game Object is being destroyed by the Scene, `false` if not. Default false. @@ -32669,7 +32331,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -32678,21 +32340,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -32702,21 +32364,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -32728,13 +32390,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -32765,7 +32427,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -32775,11 +32437,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -32788,11 +32450,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -32812,10 +32474,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -32836,12 +32498,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -32853,14 +32515,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -32871,7 +32533,7 @@ declare namespace Phaser { /** * A 2D Light. - * + * * These are created by the {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`. * * Any Game Objects with the Lighting Component, and `setLighting(true)`, @@ -32880,12 +32542,12 @@ declare namespace Phaser { * If they don't, the Lights will use the default normal map, a flat surface. * * They can also simply be used to represent a point light for your own purposes. - * + * * Lights cannot be added to Containers. They are designed to exist in the root of a Scene. */ class Light extends Phaser.Geom.Circle implements Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { /** - * + * * @param x The horizontal position of the light. * @param y The vertical position of the light. * @param radius The radius of the light. @@ -33060,7 +32722,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -33095,12 +32757,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -33114,12 +32776,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -33137,10 +32799,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -33157,14 +32819,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -33219,31 +32881,31 @@ declare namespace Phaser { /** * Creates a new Point Light Game Object and adds it to the Scene. - * + * * Note: This method will only be available if the Point Light Game Object has been built into Phaser. - * + * * The Point Light Game Object provides a way to add a point light effect into your game, * without the expensive shader processing requirements of the traditional Light Game Object. - * + * * The difference is that the Point Light renders using a custom shader, designed to give the * impression of a point light source, of variable radius, intensity and color, in your game. * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their * normal maps for calculations. This makes them extremely fast to render compared to Lights * and perfect for special effects, such as flickering torches or muzzle flashes. - * + * * For maximum performance you should batch Point Light Game Objects together. This means * ensuring they follow each other consecutively on the display list. Ideally, use a Layer * Game Object and then add just Point Lights to it, so that it can batch together the rendering * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in * your game then it's perfectly safe to mix them into the display list as normal. However, if * you're using a large number of them, please consider how they are mixed into the display list. - * + * * The renderer will automatically cull Point Lights. Those with a radius that does not intersect * with the Camera will be skipped in the rendering list. This happens automatically and the * culled state is refreshed every frame, for every camera. - * + * * The origin of a Point Light is always 0.5 and it cannot be changed. - * + * * Point Lights are a WebGL only feature and do not have a Canvas counterpart. * @param x The horizontal position of this Point Light in the world. * @param y The vertical position of this Point Light in the world. @@ -33274,7 +32936,7 @@ declare namespace Phaser { /** * Get all lights that can be seen by the given Camera. - * + * * It will automatically cull lights that are outside the world view of the Camera. * * If more lights are returned than supported by the renderer, the lights are then culled @@ -33345,7 +33007,7 @@ declare namespace Phaser { /** * Destroy the Lights Manager. - * + * * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}. */ destroy(): void; @@ -33356,13 +33018,13 @@ declare namespace Phaser { * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for rendering objects with dynamic lighting. * * Available from within a Scene via `this.lights`. - * + * * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method: - * + * * ```javascript * // Enable the Lights Manager because it is disabled by default * this.lights.enable(); - * + * * // Create a Light at [400, 300] with a radius of 200 * this.lights.addLight(400, 300, 200); * ``` @@ -33375,7 +33037,7 @@ declare namespace Phaser { */ class LightsPlugin extends Phaser.GameObjects.LightsManager { /** - * + * * @param scene The Scene that this Lights Plugin belongs to. */ constructor(scene: Phaser.Scene); @@ -33399,7 +33061,7 @@ declare namespace Phaser { /** * Destroy the Lights Plugin. - * + * * Cleans up all references. */ destroy(): void; @@ -33411,13 +33073,13 @@ declare namespace Phaser { * can be stretched both horizontally and vertically, but that retains * fixed-sized corners. The dimensions of the corners are set via the * parameters to this class. - * + * * This is extremely useful for UI and button like elements, where you need * them to expand to accommodate the content without distorting the texture. - * + * * The texture you provide for this Game Object should be based on the * following layout structure: - * + * * ``` * A B * +---+----------------------+---+ @@ -33430,19 +33092,19 @@ declare namespace Phaser { * D | 7 | 8 | 9 | * +---+----------------------+---+ * ``` - * + * * When changing this objects width and / or height: - * + * * areas 1, 3, 7 and 9 (the corners) will remain unscaled * areas 2 and 8 will be stretched horizontally only * areas 4 and 6 will be stretched vertically only * area 5 will be stretched both horizontally and vertically - * + * * You can also create a 3 slice Game Object: - * + * * This works in a similar way, except you can only stretch it horizontally. * Therefore, it requires less configuration: - * + * * ``` * A B * +---+----------------------+---+ @@ -33451,23 +33113,23 @@ declare namespace Phaser { * | | | | * +---+----------------------+---+ * ``` - * + * * When changing this objects width (you cannot change its height) - * + * * areas 1 and 3 will remain unscaled * area 2 will be stretched horizontally - * + * * The above configuration concept is adapted from the Pixi NineSlicePlane. - * + * * To specify a 3 slice object instead of a 9 slice you should only * provide the `leftWidth` and `rightWidth` parameters. To create a 9 slice * you must supply all parameters. - * + * * The _minimum_ width this Game Object can be is the total of * `leftWidth` + `rightWidth`. The _minimum_ height this Game Object * can be is the total of `topHeight` + `bottomHeight`. * If you need to display this object at a smaller size, you can scale it. - * + * * In terms of performance, using a 3 slice Game Object is the equivalent of * having 3 Sprites in a row. Using a 9 slice Game Object is the equivalent * of having 9 Sprites in a row. The vertices of this object are all batched @@ -33485,7 +33147,7 @@ declare namespace Phaser { */ class NineSlice extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of the center of this Game Object in the world. * @param y The vertical position of the center of this Game Object in the world. @@ -33505,7 +33167,7 @@ declare namespace Phaser { /** * An array of Vertex objects that correspond to the quads that make-up * this Nine Slice Game Object. They are stored in the following order: - * + * * Top Left - Indexes 0 - 5 * Top Center - Indexes 6 - 11 * Top Right - Indexes 12 - 17 @@ -33515,12 +33177,12 @@ declare namespace Phaser { * Bottom Left - Indexes 36 - 41 * Bottom Center - Indexes 42 - 47 * Bottom Right - Indexes 48 - 53 - * + * * Each quad is represented by 6 Vertex instances. - * + * * This array will contain 18 elements for a 3 slice object * and 54 for a nine slice object. - * + * * You should never modify this array once it has been populated. */ vertices: Phaser.GameObjects.NineSliceVertex[]; @@ -33537,7 +33199,7 @@ declare namespace Phaser { /** * The size of the top horizontal bar (C). - * + * * If this is a 3 slice object this property will be set to the * height of the texture being used. */ @@ -33545,7 +33207,7 @@ declare namespace Phaser { /** * The size of the bottom horizontal bar (D). - * + * * If this is a 3 slice object this property will be set to zero. */ readonly bottomHeight: number; @@ -33592,10 +33254,10 @@ declare namespace Phaser { /** * Resets the width, height and slices for this NineSlice Game Object. - * + * * This allows you to modify the texture being used by this object and then reset the slice configuration, * to avoid having to destroy this Game Object in order to use it for a different game element. - * + * * Please note that you cannot change a 9-slice to a 3-slice or vice versa. * @param width The width of the Nine Slice Game Object. You can adjust the width post-creation. Default 256. * @param height The height of the Nine Slice Game Object. If this is a 3 slice object the height will be fixed to the height of the texture and cannot be changed. Default 256. @@ -33634,7 +33296,7 @@ declare namespace Phaser { /** * Internally updates the position coordinates across all vertices of the * given quad offset. - * + * * You should not typically need to call this method directly, but it * is left public should an extended class require it. * @param offset The offset in the vertices array of the quad to update. @@ -33648,7 +33310,7 @@ declare namespace Phaser { /** * Internally updates the UV coordinates across all vertices of the * given quad offset, based on the frame size. - * + * * You should not typically need to call this method directly, but it * is left public should an extended class require it. * @param offset The offset in the vertices array of the quad to update. @@ -33677,7 +33339,7 @@ declare namespace Phaser { * * To modify the tint color once set, either call this method again with new values or use the * `tint` property. - * + * * To remove a tint call `clearTint`, or call this method with no parameters. * @param color The tint being applied to the entire Game Object. Default 0xffffff. * @returns This Game Object instance. @@ -33712,10 +33374,10 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * Setting this value will adjust the way in which this Nine Slice * object scales horizontally, if configured to do so. - * + * * The _minimum_ width this Game Object can be is the total of * `leftWidth` + `rightWidth`. If you need to display this object * at a smaller size, you can also scale it. @@ -33724,14 +33386,14 @@ declare namespace Phaser { /** * The displayed height of this Game Object. - * + * * Setting this value will adjust the way in which this Nine Slice * object scales vertically, if configured to do so. - * + * * The _minimum_ height this Game Object can be is the total of * `topHeight` + `bottomHeight`. If you need to display this object * at a smaller size, you can also scale it. - * + * * If this is a 3-slice object, you can only stretch it horizontally * and changing the height will be ignored. */ @@ -33739,32 +33401,32 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object. - * + * * For a Nine Slice Game Object this means it will be stretched (or shrunk) horizontally * and vertically depending on the dimensions given to this method, in accordance with * how it has been configured for the various corner sizes. - * + * * If this is a 3-slice object, you can only stretch it horizontally * and changing the height will be ignored. - * + * * If you have enabled this Game Object for input, changing the size will also change the * size of the hit area. * @param width The width of this Game Object. @@ -33775,7 +33437,7 @@ declare namespace Phaser { /** * Sets the display size of this Game Object. - * + * * Calling this will adjust the scale. * @param width The width of this Game Object. * @param height The height of this Game Object. @@ -33801,7 +33463,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -34059,7 +33721,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -34068,21 +33730,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -34092,21 +33754,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -34118,13 +33780,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -34155,7 +33817,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -34165,11 +33827,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -34178,11 +33840,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -34191,7 +33853,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34202,7 +33864,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34213,7 +33875,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34224,7 +33886,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34235,7 +33897,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34246,7 +33908,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34257,7 +33919,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34268,7 +33930,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34279,7 +33941,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -34315,10 +33977,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -34339,12 +34001,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -34464,12 +34126,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -34483,12 +34145,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -34506,10 +34168,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -34536,11 +34198,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -34552,14 +34214,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -34585,7 +34247,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -34599,7 +34261,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -34617,20 +34279,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -34655,9 +34317,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -34706,7 +34368,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -34739,9 +34401,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -34772,14 +34434,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -41468,28 +41130,28 @@ declare namespace Phaser { */ class EmitterColorOp extends Phaser.GameObjects.Particles.EmitterOp { /** - * + * * @param key The name of the property. */ constructor(key: string); /** * An array containing the red color values. - * + * * Populated during the `setMethods` method. */ r: number[]; /** * An array containing the green color values. - * + * * Populated during the `setMethods` method. */ g: number[]; /** * An array containing the blue color values. - * + * * Populated during the `setMethods` method. */ b: number[]; @@ -41520,7 +41182,7 @@ declare namespace Phaser { /** * An `onEmit` callback for an eased property. - * + * * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterColorOp#easeValueUpdate}. * @param particle The particle. * @param key The name of the property. @@ -41544,16 +41206,16 @@ declare namespace Phaser { /** * This class is responsible for taking control over a single property * in the Particle class and managing its emission and updating functions. - * + * * Particles properties such as `x`, `y`, `scaleX`, `lifespan` and others all use * EmitterOp instances to manage them, as they can be given in a variety of * formats: from simple values, to functions, to dynamic callbacks. - * + * * See the `ParticleEmitter` class for more details on emitter op configuration. */ class EmitterOp { /** - * + * * @param key The name of the property. * @param defaultValue The default value of the property. * @param emitOnly Whether the property can only be modified when a Particle is emitted. Default false. @@ -41567,7 +41229,7 @@ declare namespace Phaser { /** * The current value of this property. - * + * * This can be a simple value, an array, a function or an onEmit * configuration object. */ @@ -41575,7 +41237,7 @@ declare namespace Phaser { /** * The default value of this property. - * + * * This can be a simple value, an array, a function or an onEmit * configuration object. */ @@ -41605,7 +41267,7 @@ declare namespace Phaser { /** * The start value for this property to ease between. - * + * * If an interpolation this holds a reference to the number data array. */ start: number | number[]; @@ -41633,10 +41295,10 @@ declare namespace Phaser { /** * Whether this property can only be modified when a Particle is emitted. - * + * * Set to `true` to allow only {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} callbacks to be set and * affect this property. - * + * * Set to `false` to allow both {@link Phaser.GameObjects.Particles.EmitterOp#onEmit} and * {@link Phaser.GameObjects.Particles.EmitterOp#onUpdate} callbacks to be set and affect this property. */ @@ -41659,7 +41321,7 @@ declare namespace Phaser { /** * The onEmit method type of this EmitterOp. - * + * * Set as part of `setMethod` and cached here to avoid * re-setting when only the value changes. */ @@ -41667,7 +41329,7 @@ declare namespace Phaser { /** * Load the property from a Particle Emitter configuration object. - * + * * Optionally accepts a new property key to use, replacing the current one. * @param config Settings for the Particle Emitter that owns this property. * @param newKey The new key to use for this property, if any. @@ -41814,7 +41476,7 @@ declare namespace Phaser { /** * An `onEmit` callback for an eased property. - * + * * It prepares the particle for easing by {@link Phaser.GameObjects.Particles.EmitterOp#easeValueUpdate}. * @param particle The particle. * @param key The name of the property. @@ -41835,7 +41497,7 @@ declare namespace Phaser { /** * Destroys this EmitterOp instance and all of its references. - * + * * Called automatically when the ParticleEmitter that owns this * EmitterOp is destroyed. */ @@ -41846,15 +41508,15 @@ declare namespace Phaser { /** * The Gravity Well Particle Processor applies a force on the particles to draw * them towards, or repel them from, a single point. - * + * * The force applied is inversely proportional to the square of the distance * from the particle to the point, in accordance with Newton's law of gravity. - * + * * This simulates the effect of gravity over large distances (as between planets, for example). */ class GravityWell extends Phaser.GameObjects.Particles.ParticleProcessor { /** - * + * * @param x The x coordinate of the Gravity Well, in world space. Default 0. * @param y The y coordinate of the Gravity Well, in world space. Default 0. * @param power The strength of the gravity force - larger numbers produce a stronger force. Default 0. @@ -41920,14 +41582,14 @@ declare namespace Phaser { */ class Particle { /** - * + * * @param emitter The Emitter to which this Particle belongs. */ constructor(emitter: Phaser.GameObjects.Particles.ParticleEmitter); /** * The Emitter to which this Particle belongs. - * + * * A Particle can only belong to a single Emitter and is created, updated and destroyed by it. */ emitter: Phaser.GameObjects.Particles.ParticleEmitter; @@ -41954,7 +41616,7 @@ declare namespace Phaser { /** * The coordinates of this Particle in world space. - * + * * Updated as part of `computeVelocity`. */ worldPosition: Phaser.Math.Vector2; @@ -42059,9 +41721,9 @@ declare namespace Phaser { /** * A reference to the Scene to which this Game Object belongs. - * + * * Game Objects can only belong to one Scene. - * + * * You should consider this property as being read-only. You cannot move a * Game Object to another Scene by simply changing it. */ @@ -42069,11 +41731,11 @@ declare namespace Phaser { /** * The Animation State component of this Particle. - * + * * This component provides features to apply animations to this Particle. * It is responsible for playing, loading, queuing animations for later playback, * mixing between animations and setting the current animation frame to this Particle. - * + * * It is created only if the Particle's Emitter has at least one Animation. */ anims: Phaser.Animations.AnimationState | null; @@ -42086,7 +41748,7 @@ declare namespace Phaser { /** * The Event Emitter proxy. - * + * * Passes on all parameters to the `ParticleEmitter` to emit directly. * @param event The event name. * @param a1 Optional argument 1. @@ -42129,7 +41791,7 @@ declare namespace Phaser { /** * The main update method for this Particle. - * + * * Updates its life values, computes the velocity and repositions the Particle. * @param delta The delta time in ms. * @param step The delta value divided by 1000. @@ -42158,7 +41820,7 @@ declare namespace Phaser { /** * Gets the bounds of this particle as a Geometry Rectangle, factoring in any * transforms of the parent emitter and anything else above it in the display list. - * + * * Once calculated the bounds can be accessed via the `Particle.bounds` property. * @param matrix Optional transform matrix to apply to this particle. * @returns A Rectangle containing the transformed bounds of this particle. @@ -42176,21 +41838,21 @@ declare namespace Phaser { /** * The Particle Bounds Processor. - * + * * Defines a rectangular region, in world space, within which particle movement * is restrained. - * + * * Use the properties `collideLeft`, `collideRight`, `collideTop` and * `collideBottom` to control if a particle will rebound off the sides * of this boundary, or not. - * + * * This happens when the particles worldPosition x/y coordinate hits the boundary. - * + * * The strength of the rebound is determined by the `Particle.bounce` property. */ class ParticleBounds extends Phaser.GameObjects.Particles.ParticleProcessor { /** - * + * * @param x The x position (top-left) of the bounds, in world space. * @param y The y position (top-left) of the bounds, in world space. * @param width The width of the bounds. @@ -42242,157 +41904,157 @@ declare namespace Phaser { /** * A Particle Emitter is a special kind of Game Object that controls a pool of {@link Phaser.GameObjects.Particles.Particle Particles}. - * + * * Particle Emitters are created via a configuration object. The properties of this object * can be specified in a variety of formats, giving you plenty of scope over the values they * return, leading to complex visual effects. Here are the different forms of configuration * value you can give: - * + * * ## An explicit static value: - * + * * ```js * x: 400 * ``` - * + * * The x value will always be 400 when the particle is spawned. - * + * * ## A random value: - * + * * ```js * x: [ 100, 200, 300, 400 ] * ``` - * + * * The x value will be one of the 4 elements in the given array, picked at random on emission. - * + * * ## A custom callback: - * + * * ```js * x: (particle, key, t, value) => { * return value + 50; * } * ``` - * + * * The x value is the result of calling this function. This is only used when the * particle is emitted, so it provides its initial starting value. It is not used * when the particle is updated (see the onUpdate callback for that) - * + * * ## A start / end object: - * + * * This allows you to control the change in value between the given start and * end parameters over the course of the particles lifetime: - * + * * ```js * scale: { start: 0, end: 1 } * ``` - * + * * The particle scale will start at 0 when emitted and ease to a scale of 1 * over the course of its lifetime. You can also specify the ease function * used for this change (the default is Linear): - * + * * ```js * scale: { start: 0, end: 1, ease: 'bounce.out' } * ``` - * + * * ## A start / end random object: - * + * * The start and end object can have an optional `random` parameter. * This forces it to pick a random value between the two values and use * this as the starting value, then easing to the 'end' parameter over * its lifetime. - * + * * ```js * scale: { start: 4, end: 0.5, random: true } * ``` - * + * * The particle will start with a random scale between 0.5 and 4 and then * scale to the end value over its lifetime. You can combine the above * with the `ease` parameter as well to control the value easing. - * + * * ## An interpolation object: - * + * * You can provide an array of values which will be used for interpolation * during the particles lifetime. You can also define the interpolation * function to be used. There are three provided: `linear` (the default), * `bezier` and `catmull`, or you can provide your own function. - * + * * ```js * x: { values: [ 50, 500, 200, 800 ], interpolation: 'catmull' } * ``` - * + * * The particle scale will interpolate from 50 when emitted to 800 via the other * points over the course of its lifetime. You can also specify an ease function * used to control the rate of change through the values (the default is Linear): - * + * * ```js * x: { values: [ 50, 500, 200, 800 ], interpolation: 'catmull', ease: 'bounce.out } * ``` - * + * * ## A stepped emitter object: - * + * * The `steps` parameter allows you to control the placement of sequential * particles across the start-end range: - * + * * ```js * x: { steps: 32, start: 0, end: 576 } * ``` - * + * * Here we have a range of 576 (start to end). This is divided into 32 steps. - * + * * The first particle will emit at the x position of 0. The next will emit * at the next 'step' along, which would be 18. The following particle will emit * at the next step, which is 36, and so on. Because the range of 576 has been * divided by 32, creating 18 pixels steps. When a particle reaches the 'end' * value the next one will start from the beginning again. - * + * * ## A stepped emitter object with yoyo: - * + * * You can add the optional `yoyo` property to a stepped object: - * + * * ```js * x: { steps: 32, start: 0, end: 576, yoyo: true } * ``` - * + * * As with the stepped emitter, particles are emitted in sequence, from 'start' * to 'end' in step sized jumps. Normally, when a stepped emitter reaches the * end it snaps around to the start value again. However, if you provide the 'yoyo' * parameter then when it reaches the end it will reverse direction and start * emitting back down to 'start' again. Depending on the effect you require this * can often look better. - * + * * ## A min / max object: - * + * * This allows you to pick a random float value between the min and max properties: - * + * * ```js * x: { min: 100, max: 700 } * ``` - * + * * The x value will be a random float between min and max. - * + * * You can force it select an integer by setting the 'int' flag: - * + * * ```js * x: { min: 100, max: 700, int: true } * ``` - * + * * Or, you could use the 'random' array approach (see below) - * + * * ## A random object: - * + * * This allows you to pick a random integer value between the first and second array elements: - * + * * ```js * x: { random: [ 100, 700 ] } * ``` - * + * * The x value will be a random integer between 100 and 700 as it takes the first * element in the 'random' array as the 'min' value and the 2nd element as the 'max' value. - * + * * ## Custom onEmit and onUpdate callbacks: - * + * * If the above won't give you the effect you're after, you can provide your own * callbacks that will be used when the particle is both emitted and updated: - * + * * ```js * x: { * onEmit: (particle, key, t, value) => { @@ -42403,15 +42065,15 @@ declare namespace Phaser { * } * } * ``` - * + * * You can provide either one or both functions. The `onEmit` is called at the * start of the particles life and defines the value of the property on birth. - * + * * The `onUpdate` function is called every time the Particle Emitter updates * until the particle dies. Both must return a value. - * + * * The properties are: - * + * * particle - A reference to the Particle instance. * key - The string based key of the property, i.e. 'x' or 'lifespan'. * t - The current normalized lifetime of the particle, between 0 (birth) and 1 (death). @@ -42424,7 +42086,7 @@ declare namespace Phaser { * * Prior to v3.60 Phaser used a `ParticleEmitterManager`. This was removed in v3.60 * and now calling `this.add.particles` returns a `ParticleEmitter` instance instead. - * + * * In order to streamline memory and the display list we have removed the * `ParticleEmitterManager` entirely. When you call `this.add.particles` you're now * creating a `ParticleEmitter` instance, which is being added directly to the @@ -42432,11 +42094,11 @@ declare namespace Phaser { * scaled, rotated, positioned, added to a Container, etc. It now extends the * `GameObject` base class, meaning it's also an event emitter, which allowed us * to create some handy new events for particles. - * + * * So, to create an emitter, you now give it an xy coordinate, a texture and an * emitter configuration object (you can also set this later, but most commonly * you'd do it on creation). I.e.: - * + * * ```js * const emitter = this.add.particles(100, 300, 'flares', { * frame: 'red', @@ -42444,14 +42106,14 @@ declare namespace Phaser { * speed: 150 * }); * ``` - * + * * This will create a 'red flare' emitter at 100 x 300. - * + * * Please update your code to ensure it adheres to the new function signatures. */ class ParticleEmitter extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -42467,9 +42129,9 @@ declare namespace Phaser { /** * An internal object holding the configuration for the Emitter. - * + * * These are populated as part of the Emitter configuration parsing. - * + * * You typically do not access them directly, but instead use the * `ParticleEmitter.setConfig` or `ParticleEmitter.updateConfig` methods. */ @@ -42477,9 +42139,9 @@ declare namespace Phaser { /** * An internal object holding all of the EmitterOp instances. - * + * * These are populated as part of the Emitter configuration parsing. - * + * * You typically do not access them directly, but instead use the * provided getters and setters on this class, such as `ParticleEmitter.speedX` etc. */ @@ -42509,7 +42171,7 @@ declare namespace Phaser { /** * Whether moveToX and moveToY are set. Set automatically during configuration. - * + * * When true the particles move toward the moveToX and moveToY coordinates and arrive at the end of their life. * Emitter angle, speedX, and speedY are ignored. */ @@ -42539,7 +42201,7 @@ declare namespace Phaser { * Set to hard limit the amount of particle objects this emitter is allowed to create * in total. This is the number of `Particle` instances it can create, not the number * of 'alive' particles. - * + * * 0 means unlimited. */ maxParticles: number; @@ -42547,7 +42209,7 @@ declare namespace Phaser { /** * The maximum number of alive and rendering particles this emitter will update. * When this limit is reached, a particle needs to die before another can be emitted. - * + * * 0 means no limits. */ maxAliveParticles: number; @@ -42558,14 +42220,14 @@ declare namespace Phaser { * reached. It will then enter a 'stopped' state, firing the `STOP` * event. Note that entering a stopped state doesn't mean all the particles * have finished, just that it's not emitting any further ones. - * + * * To know when the final particle expires, listen for the COMPLETE event. - * + * * Use this if you wish to launch an exact number of particles and then stop * your emitter afterwards. - * + * * The counter is reset each time the `ParticleEmitter.start` method is called. - * + * * 0 means the emitter will not stop based on total emitted particles. */ stopAfter: number; @@ -42573,15 +42235,15 @@ declare namespace Phaser { /** * The number of milliseconds this emitter will emit particles for when in flow mode, * before it stops emission. A value of 0 (the default) means there is no duration. - * + * * When the duration expires the `STOP` event is emitted. Note that entering a * stopped state doesn't mean all the particles have finished, just that it's * not emitting any further ones. - * + * * To know when the final particle expires, listen for the COMPLETE event. - * + * * The counter is reset each time the `ParticleEmitter.start` method is called. - * + * * 0 means the emitter will not stop based on duration. */ duration: number; @@ -42597,18 +42259,18 @@ declare namespace Phaser { /** * Controls if the emitter is currently emitting a particle flow (when frequency >= 0). - * + * * Already alive particles will continue to update until they expire. - * + * * Controlled by {@link Phaser.GameObjects.Particles.ParticleEmitter#start} and {@link Phaser.GameObjects.Particles.ParticleEmitter#stop}. */ emitting: boolean; /** * Newly emitted particles are added to the top of the particle list, i.e. rendered above those already alive. - * + * * Set to false to send them to the back. - * + * * Also see the `sortOrder` property for more complex particle sorting. */ particleBringToTop: boolean; @@ -42620,9 +42282,9 @@ declare namespace Phaser { /** * An array containing Particle Emission Zones. These can be either EdgeZones or RandomZones. - * + * * Particles are emitted from a randomly selected zone from this array. - * + * * Prior to Phaser v3.60 an Emitter could only have one single Emission Zone. * In 3.60 they can now have an array of Emission Zones. */ @@ -42631,7 +42293,7 @@ declare namespace Phaser { /** * An array containing Particle Death Zone objects. A particle is immediately killed as soon as its x/y coordinates * intersect with any of the configured Death Zones. - * + * * Prior to Phaser v3.60 an Emitter could only have one single Death Zone. * In 3.60 they can now have an array of Death Zones. */ @@ -42641,14 +42303,14 @@ declare namespace Phaser { * An optional Rectangle object that is used during rendering to cull Particles from * display. For example, if your particles are limited to only move within a 300x300 * sized area from their origin, then you can set this Rectangle to those dimensions. - * + * * The renderer will check to see if the `viewBounds` Rectangle intersects with the * Camera bounds during the render step and if not it will skip rendering the Emitter * entirely. - * + * * This allows you to create many emitters in a Scene without the cost of * rendering if the contents aren't visible. - * + * * Note that the Emitter will not perform any checks to see if the Particles themselves * are outside of these bounds, or not. It will simply check the bounds against the * camera. Use the `getBounds` method with the `advance` parameter to help define @@ -42716,7 +42378,7 @@ declare namespace Phaser { * Optionally sort the particles before they render based on this * property. The property must exist on the `Particle` class, such * as `y`, `lifeT`, `scaleX`, etc. - * + * * When set this overrides the `particleBringToTop` setting. * * To reset this and disable sorting, set this property to an empty string. @@ -42791,7 +42453,7 @@ declare namespace Phaser { /** * Resets the internal counter trackers. - * + * * You shouldn't ever need to call this directly. * @param frequency The frequency counter. * @param on Set the complete flag. @@ -42822,7 +42484,7 @@ declare namespace Phaser { /** * Sets a pattern for assigning texture frames to emitted particles. The `frames` configuration can be any of: - * + * * frame: 0 * frame: 'red' * frame: [ 0, 1, 2, 3 ] @@ -42843,11 +42505,11 @@ declare namespace Phaser { /** * Sets a pattern for assigning animations to emitted particles. The `anims` configuration can be any of: - * + * * anim: 'red' * anim: [ 'red', 'green', 'blue', 'pink', 'white' ] * anim: { anims: [ 'red', 'green', 'blue', 'pink', 'white' ], [cycle: bool], [quantity: int] } - * + * * Call this method at least once before any particles are created, or set `anim` in the Particle Emitter's configuration when creating the Emitter. * @param anims One or more animations, or a configuration object. * @param pickRandom Whether animations should be assigned at random from `anims`. If a config object is given, this parameter is ignored. Default true. @@ -42865,23 +42527,23 @@ declare namespace Phaser { /** * Creates a Particle Bounds processor and adds it to this Emitter. - * + * * This processor will check to see if any of the active Particles hit * the defined boundary, as specified by a Rectangle shape in world-space. - * + * * If so, they are 'rebounded' back again by having their velocity adjusted. - * + * * The strength of the rebound is controlled by the `Particle.bounce` * property. - * + * * You should be careful to ensure that you emit particles within a bounds, * if set, otherwise it will lead to unpredictable visual results as the * particles are hastily repositioned. - * + * * The Particle Bounds processor is returned from this method. If you wish * to modify the area you can directly change its `bounds` property, along * with the `collideLeft` etc values. - * + * * To disable the bounds you can either set its `active` property to `false`, * or if you no longer require it, call `ParticleEmitter.removeParticleProcessor`. * @param x The x-coordinate of the left edge of the boundary, or an object representing a rectangle. @@ -42898,7 +42560,7 @@ declare namespace Phaser { /** * Sets the initial radial speed of emitted particles. - * + * * Changes the emitter to radial mode. * @param x The horizontal speed of the emitted Particles. * @param y The vertical speed of emitted Particles. If not set it will use the `x` value. Default x. @@ -42908,7 +42570,7 @@ declare namespace Phaser { /** * Sets the vertical and horizontal scale of the emitted particles. - * + * * You can also set the scale of the entire emitter via `setScale`. * @param x The horizontal scale of the emitted Particles. Default 1. * @param y The vertical scale of emitted Particles. If not set it will use the `x` value. Default x. @@ -42926,7 +42588,7 @@ declare namespace Phaser { /** * Sets the opacity (alpha) of emitted particles. - * + * * You can also set the alpha of the entire emitter via `setAlpha`. * @param value A value between 0 (transparent) and 1 (opaque). * @returns This Particle Emitter. @@ -42935,7 +42597,7 @@ declare namespace Phaser { /** * Sets the color tint of emitted particles. - * + * * This is a WebGL only feature. * @param value A value between 0 and 0xffffff. * @returns This Particle Emitter. @@ -42944,7 +42606,7 @@ declare namespace Phaser { /** * Sets the angle of a {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle stream. - * + * * The value is given in degrees using Phaser's right-handed coordinate system. * @param value The angle of the initial velocity of emitted particles, in degrees. * @returns This Particle Emitter. @@ -42976,15 +42638,15 @@ declare namespace Phaser { /** * Adds a new Particle Death Zone to this Emitter. - * + * * A particle is immediately killed as soon as its x/y coordinates intersect * with any of the configured Death Zones. - * + * * The `source` can be a Geometry Shape, such as a Circle, Rectangle or Triangle. * Any valid object from the `Phaser.Geometry` namespace is allowed, as long as * it supports a `contains` function. You can set the `type` to be either `onEnter` * or `onLeave`. - * + * * A single Death Zone instance can only exist once within this Emitter, but can belong * to multiple Emitters. * @param config A Death Zone configuration object, a Death Zone instance, a valid Geometry object or an array of them. @@ -43007,14 +42669,14 @@ declare namespace Phaser { /** * Adds a new Particle Emission Zone to this Emitter. - * + * * An {@link Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig EdgeZone} places particles on its edges. * Its {@link Phaser.Types.GameObjects.Particles.EdgeZoneSource source} can be a Curve, Path, Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; * or any object with a suitable {@link Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback getPoints} method. - * + * * A {@link Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig RandomZone} places the particles randomly within its interior. * Its {@link Phaser.GameObjects.Particles.Zones.RandomZone#source source} can be a Circle, Ellipse, Line, Polygon, Rectangle, or Triangle; or any object with a suitable {@link Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback getRandomPoint} method. - * + * * An Emission Zone can only exist once within this Emitter. * @param zone An Emission Zone configuration object, a RandomZone or EdgeZone instance, or an array of them. * @returns An array of the Emission Zones that were added to this Emitter. @@ -43038,7 +42700,7 @@ declare namespace Phaser { * Takes the given particle and sets its x/y coordinates to match the next available * emission zone, if any have been configured. This method is called automatically * as part of the `Particle.fire` process. - * + * * The Emit Zones are iterated in sequence. Once a zone has had a particle emitted * from it, then the next zone is used and so on, in a loop. * @param particle The particle to set the emission zone for. @@ -43058,10 +42720,10 @@ declare namespace Phaser { * Changes the currently active Emission Zone. The zones should have already * been added to this Emitter either via the emitter config, or the * `addEmitZone` method. - * + * * Call this method by passing either a numeric zone index value, or * the zone instance itself. - * + * * Prior to v3.60 an Emitter could only have a single Emit Zone and this * method was how you set it. From 3.60 and up it now performs a different * function and swaps between all available active zones. @@ -43072,7 +42734,7 @@ declare namespace Phaser { /** * Adds a Particle Processor, such as a Gravity Well, to this Emitter. - * + * * It will start processing particles from the next update as long as its `active` * property is set. * @param processor The Particle Processor to add to this Emitter Manager. @@ -43082,9 +42744,9 @@ declare namespace Phaser { /** * Removes a Particle Processor from this Emitter. - * + * * The Processor must belong to this Emitter to be removed. - * + * * It is not destroyed when removed, allowing you to move it to another Emitter Manager, * so if you no longer require it you should call its `destroy` method directly. * @param processor The Particle Processor to remove from this Emitter Manager. @@ -43107,7 +42769,7 @@ declare namespace Phaser { /** * Creates inactive particles and adds them to this emitter's pool. - * + * * If `ParticleEmitter.maxParticles` is set it will limit the * value passed to this method to make sure it's not exceeded. * @param count The number of particles to create. @@ -43185,10 +42847,10 @@ declare namespace Phaser { * Enables emitting, sets {@link Phaser.GameObjects.Particles.ParticleEmitter#emitting} to `true`, and resets the flow counter. * * If this emitter is in flow mode (frequency >= 0; the default), the particle flow will start (or restart). - * + * * If this emitter is in explode mode (frequency = -1), nothing will happen. * Use {@link Phaser.GameObjects.Particles.ParticleEmitter#explode} or {@link Phaser.GameObjects.Particles.ParticleEmitter#flow} instead. - * + * * Calling this method will emit the `START` event. * @param advance Advance this number of ms in time through the emitter. Default 0. * @param duration Limit this emitter to only emit particles for the given number of ms. Setting this parameter will override any duration already set in the Emitter configuration object. Default 0. @@ -43200,7 +42862,7 @@ declare namespace Phaser { * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#emitting off} the emitter and * stops it from emitting further particles. Currently alive particles will remain * active until they naturally expire unless you set the `kill` parameter to `true`. - * + * * Calling this method will emit the `STOP` event. When the final particle has * expired the `COMPLETE` event will be emitted. * @param kill Kill all particles immediately (true), or leave them to die after their lifespan expires? (false, the default) Default false. @@ -43222,15 +42884,15 @@ declare namespace Phaser { /** * Set the property by which active particles are sorted prior to be rendered. - * + * * It allows you to control the rendering order of the particles. - * + * * This can be any valid property of the `Particle` class, such as `y`, `alpha` * or `lifeT`. - * + * * The 'alive' particles array is sorted in place each game frame. Setting a * sort property will override the `particleBringToTop` setting. - * + * * If you wish to use your own sorting function, see `setSortCallback` instead. * @param property The property on the `Particle` class to sort by. * @param ascending Should the particles be sorted in ascending or descending order? Default true. @@ -43240,16 +42902,16 @@ declare namespace Phaser { /** * Sets a callback to be used to sort the particles before rendering each frame. - * + * * This allows you to define your own logic and behavior in the callback. - * + * * The callback will be sent two parameters: the two Particles being compared, * and must adhere to the criteria of the `compareFn` in `Array.sort`: - * + * * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description - * + * * Call this method with no parameters to reset the sort callback. - * + * * Setting your own callback will override both the `particleBringToTop` and * `sortProperty` settings of this Emitter. * @param callback The callback to invoke when the particles are sorted. Leave undefined to reset to the default. @@ -43273,7 +42935,7 @@ declare namespace Phaser { /** * Puts the emitter in flow mode (frequency >= 0) and starts (or restarts) a particle flow. - * + * * To resume a flow at the current frequency and quantity, use {@link Phaser.GameObjects.Particles.ParticleEmitter#start} instead. * @param frequency The time interval (>= 0) of each flow cycle, in ms. * @param count The number of particles to emit at each flow cycle. Default 1. @@ -43312,13 +42974,13 @@ declare namespace Phaser { /** * Fast forwards this Particle Emitter and all of its particles. - * + * * Works by running the Emitter `preUpdate` handler in a loop until the `time` * has been reached at `delta` steps per loop. - * + * * All callbacks and emitter related events that would normally be fired * will still be invoked. - * + * * You can make an emitter 'fast forward' via the emitter config using the * `advance` property. Set this value to the number of ms you wish the * emitter to be fast-forwarded by. Or, call this method post-creation. @@ -43338,7 +43000,7 @@ declare namespace Phaser { /** * Takes either a Rectangle Geometry object or an Arcade Physics Body and tests * to see if it intersects with any currently alive Particle in this Emitter. - * + * * Overlapping particles are returned in an array, where you can perform further * processing on them. If nothing overlaps then the array will be empty. * @param target A Rectangle or Arcade Physics Body to check for intersection against all alive particles. @@ -43352,13 +43014,13 @@ declare namespace Phaser { * created and not yet rendered, then calling this method will return a Rectangle * with a max safe integer for dimensions. Use the `advance` parameter to * avoid this. - * + * * Typically it takes a few seconds for a flow Emitter to 'warm up'. You can * use the `advance` and `delta` parameters to force the Emitter to * 'fast forward' in time to try and allow the bounds to be more accurate, * as it will calculate the bounds based on the particle bounds across all * timesteps, giving a better result. - * + * * You can also use the `padding` parameter to increase the size of the * bounds. Emitters with a lot of randomness in terms of direction or lifespan * can often return a bounds smaller than their possible maximum. By using @@ -43379,9 +43041,9 @@ declare namespace Phaser { /** * The x coordinate the particles are emitted from. - * + * * This is relative to the Emitters x coordinate and that of any parent. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43399,7 +43061,7 @@ declare namespace Phaser { /** * The horizontal acceleration applied to emitted particles, in pixels per second squared. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43407,7 +43069,7 @@ declare namespace Phaser { /** * The vertical acceleration applied to emitted particles, in pixels per second squared. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43431,12 +43093,12 @@ declare namespace Phaser { /** * The initial speed of emitted particles, in pixels per second. - * + * * If using this as a getter it will return the `speedX` value. - * + * * If using it as a setter it will update both `speedX` and `speedY` to the * given value. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43444,7 +43106,7 @@ declare namespace Phaser { /** * The initial horizontal speed of emitted particles, in pixels per second. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43452,7 +43114,7 @@ declare namespace Phaser { /** * The initial vertical speed of emitted particles, in pixels per second. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43460,7 +43122,7 @@ declare namespace Phaser { /** * The x coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43468,7 +43130,7 @@ declare namespace Phaser { /** * The y coordinate emitted particles move toward, when {@link Phaser.GameObjects.Particles.ParticleEmitter#moveTo} is true. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43478,7 +43140,7 @@ declare namespace Phaser { * The amount of velocity particles will use when rebounding off the * emitter bounds, if set. A value of 0 means no bounce. A value of 1 * means a full rebound. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43486,9 +43148,9 @@ declare namespace Phaser { /** * The horizontal scale of emitted particles. - * + * * This is relative to the Emitters scale and that of any parent. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43496,9 +43158,9 @@ declare namespace Phaser { /** * The vertical scale of emitted particles. - * + * * This is relative to the Emitters scale and that of any parent. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43518,9 +43180,9 @@ declare namespace Phaser { * it as an array of color values. The Particle will then interpolate * through these colors over the course of its lifespan. Setting this * will override any `tint` value that may also be given. - * + * * This is a WebGL only feature. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43530,7 +43192,7 @@ declare namespace Phaser { * Controls the easing function used when you have created an * Emitter that uses the `color` property to interpolate the * tint of Particles over their lifetime. - * + * * Setting this has no effect if you haven't also applied a * `particleColor` to this Emitter. */ @@ -43549,7 +43211,7 @@ declare namespace Phaser { * The `tint` value will be overridden if a `color` array is provided. * * This is a WebGL only feature. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43560,7 +43222,7 @@ declare namespace Phaser { * between 0 and 1. Particles with alpha zero are invisible * and are therefore not rendered, but are still processed * by the Emitter. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43570,7 +43232,7 @@ declare namespace Phaser { * The lifespan of the emitted particles. This value is given * in milliseconds and defaults to 1000ms (1 second). When a * particle reaches this amount it is killed. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43581,7 +43243,7 @@ declare namespace Phaser { * given in degrees. This allows you to control the direction * of the emitter. If you wish instead to change the rotation * of the particles themselves, see the `particleRotate` property. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43592,7 +43254,7 @@ declare namespace Phaser { * The value is given in degrees and uses a right-handed * coordinate system, where 0 degrees points to the right, 90 degrees * points down and -90 degrees points up. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43601,9 +43263,9 @@ declare namespace Phaser { /** * The number of particles that are emitted each time an emission * occurs, i.e. from one 'explosion' or each frame in a 'flow' cycle. - * + * * The default is 1. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43614,7 +43276,7 @@ declare namespace Phaser { * the particles start updating. This allows you to emit particles * that appear 'static' or still on-screen and then, after this value, * begin to move. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43625,10 +43287,10 @@ declare namespace Phaser { * its life before it will be removed. This allows you to 'hold' a * particle on the screen once it has reached its final state * before it then vanishes. - * + * * Note that all particle updates will cease, including changing * alpha, scale, movement or animation. - * + * * Accessing this property should typically return a number. * However, it can be set to any valid EmitterOp onEmit type. */ @@ -43636,21 +43298,21 @@ declare namespace Phaser { /** * The internal flow counter. - * + * * Treat this property as read-only. */ flowCounter: number; /** * The internal frame counter. - * + * * Treat this property as read-only. */ frameCounter: number; /** * The internal animation counter. - * + * * Treat this property as read-only. */ animCounter: number; @@ -43664,42 +43326,42 @@ declare namespace Phaser { /** * The internal stop counter. - * + * * Treat this property as read-only. */ stopCounter: number; /** * The internal complete flag. - * + * * Treat this property as read-only. */ completeFlag: boolean; /** * The internal zone index. - * + * * Treat this property as read-only. */ zoneIndex: number; /** * The internal zone total. - * + * * Treat this property as read-only. */ zoneTotal: number; /** * The current frame index. - * + * * Treat this property as read-only. */ currentFrame: number; /** * The current animation index. - * + * * Treat this property as read-only. */ currentAnim: number; @@ -43948,7 +43610,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -43957,21 +43619,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -43981,21 +43643,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -44007,13 +43669,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -44044,7 +43706,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -44054,11 +43716,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -44067,11 +43729,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -44137,10 +43799,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -44161,12 +43823,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -44245,12 +43907,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -44264,12 +43926,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -44287,10 +43949,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -44317,11 +43979,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -44333,14 +43995,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -44366,7 +44028,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -44380,7 +44042,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -44398,20 +44060,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -44436,9 +44098,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -44487,7 +44149,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -44520,9 +44182,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -44553,14 +44215,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -44574,12 +44236,12 @@ declare namespace Phaser { * * You should extend it and add the functionality required for your processor, * including tidying up any resources this may create in the `destroy` method. - * + * * See the GravityWell for an example of a processor. */ class ParticleProcessor { /** - * + * * @param x The x coordinate of the Particle Processor, in world space. Default 0. * @param y The y coordinate of the Particle Processor, in world space. Default 0. * @param active The active state of this Particle Processor. Default true. @@ -44605,7 +44267,7 @@ declare namespace Phaser { /** * The active state of the Particle Processor. - * + * * An inactive Particle Processor will be skipped for processing by * its parent Emitter. */ @@ -44624,7 +44286,7 @@ declare namespace Phaser { /** * Destroys this Particle Processor by removing all external references. - * + * * This is called automatically when the owning Particle Emitter is destroyed. */ destroy(): void; @@ -44641,7 +44303,7 @@ declare namespace Phaser { * * Listen for it on a Particle Emitter instance using `ParticleEmitter.on('complete', listener)`. */ - const COMPLETE: string; + const COMPLETE: 'complete'; /** * The Particle Emitter Death Zone Event. @@ -44652,7 +44314,7 @@ declare namespace Phaser { * * If you wish to know when the final particle is killed, see the `COMPLETE` event. */ - const DEATH_ZONE: string; + const DEATH_ZONE: 'deathzone'; /** * The Particle Emitter Explode Event. @@ -44661,7 +44323,7 @@ declare namespace Phaser { * * Listen for it on a Particle Emitter instance using `ParticleEmitter.on('explode', listener)`. */ - const EXPLODE: string; + const EXPLODE: 'explode'; /** * The Particle Emitter Start Event. @@ -44670,7 +44332,7 @@ declare namespace Phaser { * * Listen for it on a Particle Emitter instance using `ParticleEmitter.on('start', listener)`. */ - const START: string; + const START: 'start'; /** * The Particle Emitter Stop Event. @@ -44687,22 +44349,22 @@ declare namespace Phaser { * * If you wish to know when the final particle is killed, see the `COMPLETE` event. */ - const STOP: string; + const STOP: 'stop'; } namespace Zones { /** * A Death Zone. - * + * * A Death Zone is a special type of zone that will kill a Particle as soon as it either enters, or leaves, the zone. - * + * * The zone consists of a `source` which could be a Geometric shape, such as a Rectangle or Ellipse, or your own * object as long as it includes a `contains` method for which the Particles can be tested against. */ class DeathZone { /** - * + * * @param source An object instance that has a `contains` method that returns a boolean when given `x` and `y` arguments. * @param killOnEnter Should the Particle be killed when it enters the zone? `true` or leaves it? `false` */ @@ -44747,7 +44409,7 @@ declare namespace Phaser { */ class EdgeZone { /** - * + * * @param source An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. * @param quantity The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * @param stepRate The distance between each particle. When set, `quantity` is implied and should be set to 0. @@ -44795,12 +44457,12 @@ declare namespace Phaser { /** * The total number of particles this zone will emit before the Emitter * transfers control over to the next zone in its emission zone list. - * + * * By default this is -1, meaning it will never pass over from this * zone to another one. You can call the `ParticleEmitter.setEmitZone` * method to change it, or set this value to something else via the * config, or directly at runtime. - * + * * A value of 1 would mean the zones rotate in order, but it can * be set to any integer value. */ @@ -44852,7 +44514,7 @@ declare namespace Phaser { */ class RandomZone { /** - * + * * @param source An object instance with a `getRandomPoint(point)` method. */ constructor(source: Phaser.Types.GameObjects.Particles.RandomZoneSource); @@ -44865,12 +44527,12 @@ declare namespace Phaser { /** * The total number of particles this zone will emit before the Emitter * transfers control over to the next zone in its emission zone list. - * + * * By default this is -1, meaning it will never pass over from this * zone to another one. You can call the `ParticleEmitter.setEmitZone` * method to change it, or set this value to something else via the * config, or directly at runtime. - * + * * A value of 1 would mean the zones rotate in order, but it can * be set to any integer value. */ @@ -44904,7 +44566,7 @@ declare namespace Phaser { */ class PathFollower extends Phaser.GameObjects.Sprite implements Phaser.GameObjects.Components.PathFollower { /** - * + * * @param scene The Scene to which this PathFollower belongs. * @param path The Path this PathFollower is following. It can only follow one Path at a time. * @param x The horizontal position of this Game Object in the world. @@ -44942,7 +44604,7 @@ declare namespace Phaser { /** * Internal update handler that advances this PathFollower along the path. - * + * * Called automatically by the Scene step, should not typically be called directly. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. @@ -45181,7 +44843,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -45227,21 +44889,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -45251,21 +44913,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -45277,13 +44939,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -45314,7 +44976,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -45324,11 +44986,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -45337,11 +44999,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -45428,7 +45090,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45439,7 +45101,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45450,7 +45112,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45461,7 +45123,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45472,7 +45134,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45483,7 +45145,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45494,7 +45156,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45505,7 +45167,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45516,7 +45178,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -45598,10 +45260,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -45622,12 +45284,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -45673,7 +45335,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -45775,12 +45437,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -45794,12 +45456,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -45817,10 +45479,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -45837,7 +45499,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -45846,7 +45508,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -45855,30 +45517,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -45888,12 +45550,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -45934,26 +45596,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -45966,7 +45628,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -45976,14 +45638,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -46052,11 +45714,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -46124,7 +45786,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -46138,7 +45800,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -46156,20 +45818,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -46194,9 +45856,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -46245,7 +45907,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -46278,9 +45940,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -46311,14 +45973,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -46344,7 +46006,7 @@ declare namespace Phaser { /** * Set the Path that this PathFollower should follow. - * + * * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings. * @param path The Path this PathFollower is following. It can only follow one Path at a time. * @param config Settings for the PathFollower. @@ -46401,7 +46063,7 @@ declare namespace Phaser { /** * Internal update handler that advances this PathFollower along the path. - * + * * Called automatically by the Scene step, should not typically be called directly. */ pathUpdate(): void; @@ -46411,31 +46073,31 @@ declare namespace Phaser { /** * The Point Light Game Object provides a way to add a point light effect into your game, * without the expensive shader processing requirements of the traditional Light Game Object. - * + * * The difference is that the Point Light renders using a custom shader, designed to give the * impression of a point light source, of variable radius, intensity and color, in your game. * However, unlike the Light Game Object, it does not impact any other Game Objects, or use their * normal maps for calculations. This makes them extremely fast to render compared to Lights * and perfect for special effects, such as flickering torches or muzzle flashes. - * + * * For maximum performance you should batch Point Light Game Objects together. This means * ensuring they follow each other consecutively on the display list. Ideally, use a Layer * Game Object and then add just Point Lights to it, so that it can batch together the rendering * of the lights. You don't _have_ to do this, and if you've only a handful of Point Lights in * your game then it's perfectly safe to mix them into the display list as normal. However, if * you're using a large number of them, please consider how they are mixed into the display list. - * + * * The renderer will automatically cull Point Lights. Those with a radius that does not intersect * with the Camera will be skipped in the rendering list. This happens automatically and the * culled state is refreshed every frame, for every camera. - * + * * The origin of a Point Light is always 0.5 and it cannot be changed. - * + * * Point Lights are a WebGL only feature and do not have a Canvas counterpart. */ class PointLight extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Point Light belongs. A Point Light can only belong to one Scene at a time. * @param x The horizontal position of this Point Light in the world. * @param y The vertical position of this Point Light in the world. @@ -46455,16 +46117,16 @@ declare namespace Phaser { /** * The intensity of the Point Light. - * + * * The colors of the light are multiplied by this value during rendering. */ intensity: number; /** * The attenuation of the Point Light. - * + * * This value controls the force with which the light falls-off from the center of the light. - * + * * Use small float-based values, i.e. 0.1. */ attenuation: number; @@ -46734,7 +46396,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -46743,21 +46405,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -46767,21 +46429,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -46793,13 +46455,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -46830,7 +46492,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -46840,11 +46502,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -46853,11 +46515,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -46866,7 +46528,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46877,7 +46539,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46888,7 +46550,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46899,7 +46561,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46910,7 +46572,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46921,7 +46583,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46932,7 +46594,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46943,7 +46605,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46954,7 +46616,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -46990,10 +46652,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -47014,12 +46676,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -47098,12 +46760,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -47117,12 +46779,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -47140,10 +46802,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -47175,7 +46837,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -47189,7 +46851,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -47207,20 +46869,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -47245,9 +46907,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -47296,7 +46958,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -47329,9 +46991,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -47362,14 +47024,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -47381,34 +47043,34 @@ declare namespace Phaser { /** * A Render Texture is a combination of Dynamic Texture and an Image Game Object, that uses the * Dynamic Texture to display itself with. - * + * * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of * Game Objects directly to it. - * + * * You can take many complex objects and draw them to this one texture, which can then be used as the * base texture for other Game Objects, such as Sprites. Should you then update this texture, all * Game Objects using it will instantly be updated as well, reflecting the changes immediately. - * + * * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke * expensive GPU uploads on each change. - * + * * In versions of Phaser before 3.60 a Render Texture was the only way you could create a texture * like this, that had the ability to be drawn on. But in 3.60 we split the core functions out to * the Dynamic Texture class as it made a lot more sense for them to reside in there. As a result, * the Render Texture is now a light-weight shim that sits on-top of an Image Game Object and offers * proxy methods to the features available from a Dynamic Texture. - * + * * **When should you use a Render Texture vs. a Dynamic Texture?** - * + * * You should use a Dynamic Texture if the texture is going to be used by multiple Game Objects, * or you want to use it across multiple Scenes, because textures are globally stored. - * + * * You should use a Dynamic Texture if the texture isn't going to be displayed in-game, but is * instead going to be used for something like a mask or shader. - * + * * You should use a Render Texture if you need to display the texture in-game on a single Game Object, * as it provides the convenience of wrapping an Image and Dynamic Texture together for you. - * + * * Under WebGL1, a FrameBuffer, which is what this Dynamic Texture uses internally, cannot be anti-aliased. * This means that when drawing objects such as Shapes or Graphics instances to this texture, they may appear * to be drawn with no aliasing around the edges. This is a technical limitation of WebGL1. To get around it, @@ -47428,7 +47090,7 @@ declare namespace Phaser { */ class RenderTexture extends Phaser.GameObjects.Image { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -47440,12 +47102,12 @@ declare namespace Phaser { /** * An internal Camera that can be used to move around this Render Texture. - * + * * Control it just like you would any Scene Camera. The difference is that it only impacts * the placement of Game Objects that you then draw to this texture. - * + * * You can scroll, zoom and rotate this Camera. - * + * * This property is a reference to `RenderTexture.texture.camera`. */ camera: Phaser.Cameras.Scene2D.BaseCamera; @@ -47471,13 +47133,13 @@ declare namespace Phaser { /** * Sets the internal size of this Render Texture, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. You could also call the `resize` method, as that * will resize the underlying texture. - * + * * If you have enabled this Game Object for input, changing the size will also change the * size of the hit area, unless you have defined a custom hit area. * @param width The width of this Game Object. @@ -47488,12 +47150,12 @@ declare namespace Phaser { /** * Resizes the Render Texture to the new dimensions given. - * + * * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. * In Canvas it will resize the underlying canvas element. - * + * * Both approaches will erase everything currently drawn to the Render Texture. - * + * * Calling this will then invoke the `setSize` method, setting the internal size of this Game Object * to the values given to this method. * @@ -47510,28 +47172,28 @@ declare namespace Phaser { /** * Stores a copy of this Render Texture in the Texture Manager using the given key. - * + * * After doing this, any texture based Game Object, such as a Sprite, can use the contents of this * Render Texture by using the texture key: - * + * * ```javascript * var rt = this.add.renderTexture(0, 0, 128, 128); - * + * * // Draw something to the Render Texture - * + * * rt.saveTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Updating the contents of this Render Texture will automatically update _any_ Game Object * that is using it as a texture. Calling `saveTexture` again will not save another copy * of the same texture, it will just rename the key of the existing copy. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame from a Render Texture. - * + * * If you destroy this Render Texture, any Game Object using it via the Texture Manager will * stop rendering. Ensure you remove the texture from the Texture Manager and any Game Objects * using it first, before destroying this Render Texture. @@ -47568,10 +47230,10 @@ declare namespace Phaser { /** * Fills this Render Texture with the given color. - * + * * By default it will fill the entire texture, however you can set it to fill a specific * rectangular area by using the x, y, width and height arguments. - * + * * The color should be given in hex format, i.e. 0xff0000 for red, 0x00ff00 for green, etc. * @param rgb The color to fill this Render Texture with, such as 0xff0000 for red. * @param alpha The alpha value used by the fill. Default 1. @@ -47599,9 +47261,9 @@ declare namespace Phaser { * x and y coordinates. You can use the optional 'config' argument to provide * lots more options about how the stamp is applied, including the alpha, * tint, angle, scale and origin. - * + * * By default, the frame will stamp on the x/y coordinates based on its center. - * + * * If you wish to stamp from the top-left, set the config `originX` and * `originY` properties both to zero. * @@ -47632,7 +47294,7 @@ declare namespace Phaser { * Draws the given object, or an array of objects, to this RenderTexture. * * It can accept any of the following: - * + * * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. * * Tilemap Layers. * * A Group. The contents of which will be iterated and drawn in turn. @@ -47641,7 +47303,7 @@ declare namespace Phaser { * * Another Dynamic Texture, or a Render Texture. * * A Texture Frame instance. * * A string. This is used to look-up the texture from the Texture Manager. - * + * * Note 1: You cannot draw a Render Texture to itself. * * Note 2: GameObjects will use the camera, while textures and frames will not. @@ -47650,14 +47312,14 @@ declare namespace Phaser { * If passing in a Group or Container it will only draw children that return `true` * when their `willRender()` method is called. I.e. a Container with 10 children, * 5 of which have `visible=false` will only draw the 5 visible ones. - * + * * If passing in an array of Game Objects it will draw them all, regardless if * they pass a `willRender` check or not. - * + * * You can pass in a string in which case it will look for a texture in the Texture * Manager matching that string, and draw the base frame. If you need to specify * exactly which frame to draw then use the method `drawFrame` instead. - * + * * You can pass in the `x` and `y` coordinates to draw the objects at. The use of * the coordinates differ based on what objects are being drawn. If the object is * a Group, Container or Display List, the coordinates are _added_ to the positions @@ -47691,11 +47353,11 @@ declare namespace Phaser { * It uses a `TileSprite` internally to draw the frame repeatedly. * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * You can optionally provide a position, width, height, alpha and tint value to apply to * the frames before they are drawn. The position controls the top-left where the repeating * fill will start from. The width and height control the size of the filled area. - * + * * The position can be negative if required, but the dimensions cannot. * * This method respects the camera settings of the Dynamic Texture. @@ -47736,16 +47398,16 @@ declare namespace Phaser { /** * Takes a snapshot of the given area of this Render Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Render Texture see the `snapshot` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Render Texture has, so please be careful how you employ this in your game. * @param x The x coordinate to grab from. @@ -47761,16 +47423,16 @@ declare namespace Phaser { /** * Takes a snapshot of the whole of this Render Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture a portion of this Render Texture see the `snapshotArea` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Render Texture has, so please be careful how you employ this in your game. * @param callback The Function to invoke after the snapshot image is created. @@ -47782,12 +47444,12 @@ declare namespace Phaser { /** * Takes a snapshot of the given pixel from this Render Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Render Texture see the `snapshot` method. * To capture a portion of this Render Texture see the `snapshotArea` method. - * + * * Unlike the two other snapshot methods, this one will send your callback a `Color` object * containing the color data for the requested pixel. It doesn't need to create an internal * Canvas or Image object, so is a lot faster to execute, using less memory than the other snapshot methods. @@ -48035,7 +47697,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -48081,21 +47743,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -48105,21 +47767,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -48131,13 +47793,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -48168,7 +47830,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -48178,11 +47840,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -48191,11 +47853,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -48282,7 +47944,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48293,7 +47955,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48304,7 +47966,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48315,7 +47977,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48326,7 +47988,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48337,7 +47999,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48348,7 +48010,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48359,7 +48021,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48370,7 +48032,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -48452,10 +48114,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -48476,12 +48138,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -48527,7 +48189,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -48629,12 +48291,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -48648,12 +48310,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -48671,10 +48333,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -48691,7 +48353,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -48700,7 +48362,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -48709,30 +48371,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -48772,26 +48434,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -48804,7 +48466,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -48814,14 +48476,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -48890,11 +48552,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -48962,7 +48624,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -48976,7 +48638,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -48994,20 +48656,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -49032,9 +48694,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -49083,7 +48745,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -49116,9 +48778,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -49149,14 +48811,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -49167,7 +48829,7 @@ declare namespace Phaser { /** * A Rope Game Object. - * + * * The Rope object is WebGL only and does not have a Canvas counterpart. * * A Rope is a special kind of Game Object that has a texture that is stretched along its entire length, @@ -49190,7 +48852,7 @@ declare namespace Phaser { */ class Rope extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -49214,35 +48876,35 @@ declare namespace Phaser { * Each point should be given as a Vector2Like object (i.e. a Vector2 or object with public x/y properties). * * The point coordinates are given in local space, where 0 x 0 is the start of the Rope strip. - * + * * You can modify the contents of this array directly in real-time to create interesting effects. * If you do so, be sure to call `setDirty` _after_ modifying this array, so that the vertices data is * updated before the next render. Alternatively, you can use the `setPoints` method instead. - * + * * Should you need to change the _size_ of this array, then you should always use the `setPoints` method. */ points: Phaser.Types.Math.Vector2Like[]; /** * An array containing the vertices data for this Rope. - * + * * This data is calculated automatically in the `updateVertices` method, based on the points provided. */ vertices: Float32Array; /** * An array containing the uv data for this Rope. - * + * * This data is calculated automatically in the `setPoints` method, based on the points provided. */ uv: Float32Array; /** * An array containing the color data for this Rope. - * + * * Colors should be given as numeric RGB values, such as 0xff0000. * You should provide _two_ color values for every point in the Rope, one for the top and one for the bottom of each quad. - * + * * You can modify the contents of this array directly in real-time, however, should you need to change the _size_ * of the array, then you should use the `setColors` method instead. */ @@ -49250,10 +48912,10 @@ declare namespace Phaser { /** * An array containing the alpha data for this Rope. - * + * * Alphas should be given as float values, such as 0.5. * You should provide _two_ alpha values for every point in the Rope, one for the top and one for the bottom of each quad. - * + * * You can modify the contents of this array directly in real-time, however, should you need to change the _size_ * of the array, then you should use the `setAlphas` method instead. */ @@ -49280,7 +48942,7 @@ declare namespace Phaser { /** * Are the Rope vertices aligned horizontally, in a strip, or vertically, in a column? - * + * * This property is set during instantiation and cannot be changed directly. * See the `setVertical` and `setHorizontal` methods. */ @@ -49288,19 +48950,19 @@ declare namespace Phaser { /** * You can optionally choose to render the vertices of this Rope to a Graphics instance. - * + * * Achieve this by setting the `debugCallback` and the `debugGraphic` properties. - * + * * You can do this in a single call via the `Rope.setDebug` method, which will use the * built-in debug function. You can also set it to your own callback. The callback * will be invoked _once per render_ and sent the following parameters: - * + * * `debugCallback(src, meshLength, verts)` - * + * * `src` is the Rope instance being debugged. * `meshLength` is the number of mesh vertices in total. * `verts` is an array of the translated vertex coordinates. - * + * * To disable rendering, set this property back to `null`. */ debugCallback: Function; @@ -49349,7 +49011,7 @@ declare namespace Phaser { /** * Sets the alignment of the points in this Rope to be horizontal, in a strip format. - * + * * Calling this method will reset this Rope. The current points, vertices, colors and alpha * values will be reset to those values given as parameters. * @param points An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. @@ -49361,7 +49023,7 @@ declare namespace Phaser { /** * Sets the alignment of the points in this Rope to be vertical, in a column format. - * + * * Calling this method will reset this Rope. The current points, vertices, colors and alpha * values will be reset to those values given as parameters. * @param points An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. @@ -49390,20 +49052,20 @@ declare namespace Phaser { /** * Set the alpha values used by the Rope during rendering. - * + * * You can provide the values in a number of ways: - * + * * 1) One single numeric value: `setAlphas(0.5)` - This will set a single alpha for the whole Rope. * 2) Two numeric values: `setAlphas(1, 0.5)` - This will set a 'top' and 'bottom' alpha value across the whole Rope. * 3) An array of values: `setAlphas([ 1, 0.5, 0.2 ])` - * + * * If you provide an array of values and the array has exactly the same number of values as `points` in the Rope, it * will use each alpha value per rope segment. - * + * * If the provided array has a different number of values than `points` then it will use the values in order, from * the first Rope segment and on, until it runs out of values. This allows you to control the alpha values at all * vertices in the Rope. - * + * * Note this method is called `setAlphas` (plural) and not `setAlpha`. * @param alphas Either a single alpha value, or an array of values. If nothing is provided alpha is reset to 1. * @param bottomAlpha An optional bottom alpha value. See the method description for details. @@ -49413,17 +49075,17 @@ declare namespace Phaser { /** * Set the color values used by the Rope during rendering. - * + * * Colors are used to control the level of tint applied across the Rope texture. - * + * * You can provide the values in a number of ways: - * + * * * One single numeric value: `setColors(0xff0000)` - This will set a single color tint for the whole Rope. * * An array of values: `setColors([ 0xff0000, 0x00ff00, 0x0000ff ])` - * + * * If you provide an array of values and the array has exactly the same number of values as `points` in the Rope, it * will use each color per rope segment. - * + * * If the provided array has a different number of values than `points` then it will use the values in order, from * the first Rope segment and on, until it runs out of values. This allows you to control the color values at all * vertices in the Rope. @@ -49434,16 +49096,16 @@ declare namespace Phaser { /** * Sets the points used by this Rope. - * + * * The points should be provided as an array of Vector2, or vector2-like objects (i.e. those with public x/y properties). - * + * * Each point corresponds to one segment of the Rope. The more points in the array, the more segments the rope has. - * + * * Point coordinates are given in local-space, not world-space, and are directly related to the size of the texture * this Rope object is using. - * + * * For example, a Rope using a 512 px wide texture, split into 4 segments (128px each) would use the following points: - * + * * ```javascript * rope.setPoints([ * { x: 0, y: 0 }, @@ -49452,15 +49114,15 @@ declare namespace Phaser { * { x: 384, y: 0 } * ]); * ``` - * + * * Or, you can provide an integer to do the same thing: - * + * * ```javascript * rope.setPoints(4); * ``` - * + * * Which will divide the Rope into 4 equally sized segments based on the frame width. - * + * * Note that calling this method with a different number of points than the Rope has currently will * _reset_ the color and alpha values, unless you provide them as arguments to this method. * @param points An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. Default 2. @@ -49486,7 +49148,7 @@ declare namespace Phaser { /** * Updates the vertices based on the Rope points. - * + * * This method is called automatically during rendering if `Rope.dirty` is `true`, which is set * by the `setPoints` and `setDirty` methods. You should flag the Rope as being dirty if you modify * the Rope points directly.undefined @@ -49496,25 +49158,25 @@ declare namespace Phaser { /** * This method enables rendering of the Rope vertices to the given Graphics instance. - * + * * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, * otherwise the Graphics instance you provide to debug will fill-up with draw calls, * eventually crashing the browser. This is not done automatically to allow you to debug * draw multiple Rope objects to a single Graphics instance. - * + * * The Rope class has a built-in debug rendering callback `Rope.renderDebugVerts`, however * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. - * + * * The callback is invoked _once per render_ and sent the following parameters: - * + * * `callback(src, meshLength, verts)` - * + * * `src` is the Rope instance being debugged. * `meshLength` is the number of mesh vertices in total. * `verts` is an array of the translated vertex coordinates. - * + * * If using your own callback you do not have to provide a Graphics instance to this method. - * + * * To disable debug rendering, to either your own callback or the built-in one, call this method * with no arguments. * @param graphic The Graphic instance to render to if using the built-in callback. @@ -49525,7 +49187,7 @@ declare namespace Phaser { /** * The built-in Rope vertices debug rendering method. - * + * * See `Rope.setDebug` for more details. * @param src The Rope object being rendered. * @param meshLength The number of vertices in the mesh. @@ -49535,7 +49197,7 @@ declare namespace Phaser { /** * The horizontally flipped state of the Game Object. - * + * * A Game Object that is flipped horizontally will render inversed on the horizontal axis. * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. @@ -49544,7 +49206,7 @@ declare namespace Phaser { /** * The vertically flipped state of the Game Object. - * + * * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. @@ -49790,7 +49452,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -49799,21 +49461,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -49823,21 +49485,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -49849,13 +49511,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -49886,7 +49548,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -49896,11 +49558,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -49909,11 +49571,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -49993,10 +49655,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -50017,12 +49679,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -50101,7 +49763,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -50110,7 +49772,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -50119,30 +49781,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -50152,12 +49814,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -50191,11 +49853,11 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * Calling this method will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. @@ -50207,14 +49869,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -50240,7 +49902,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -50254,7 +49916,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -50272,20 +49934,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -50310,9 +49972,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -50361,7 +50023,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -50394,9 +50056,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -50427,14 +50089,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -50443,12 +50105,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -50462,12 +50124,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -50485,10 +50147,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -50580,16 +50242,16 @@ declare namespace Phaser { /** * A flag that indicates if this Shader has been set to render to a texture instead of the display list. - * + * * This property is `true` if you have called `Shader.setRenderToTexture`, otherwise it's `false`. - * + * * A Shader that is rendering to a texture _does not_ appear on the display list. */ readonly renderToTexture: boolean; /** * A reference to the Phaser.Textures.Texture that has been stored in the Texture Manager for this Shader. - * + * * This property is only set if you have called `Shader.setRenderToTexture` with a key, otherwise it is `null`. */ texture: Phaser.Textures.Texture; @@ -50672,15 +50334,15 @@ declare namespace Phaser { * store it in `Shader.texture`, * and save it into the Texture Manager, allowing you to then use it for * any texture-based Game Object, such as a Sprite or Image: - * + * * ```javascript * var shader = this.add.shader('myShader', x, y, width, height); - * + * * shader.setRenderToTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Note that it stores an active reference to this Shader. That means as this shader updates, * so does the texture and any object using it to render with. Also, if you destroy this * shader, be sure to clear any objects that may have been using it as a texture too. @@ -51058,7 +50720,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -51067,7 +50729,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -51076,30 +50738,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -51122,13 +50784,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -51159,7 +50821,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -51169,11 +50831,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -51182,11 +50844,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -51195,7 +50857,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51206,7 +50868,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51217,7 +50879,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51228,7 +50890,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51239,7 +50901,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51250,7 +50912,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51261,7 +50923,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51272,7 +50934,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51283,7 +50945,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -51342,7 +51004,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -51377,12 +51039,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -51396,12 +51058,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -51419,10 +51081,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -51454,7 +51116,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -51468,7 +51130,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -51486,20 +51148,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -51524,9 +51186,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -51575,7 +51237,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -51608,9 +51270,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -51641,1008 +51303,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - */ - setVisible(value: boolean): this; - - } - - /** - * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. - * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. - */ - class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.PostPipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { - /** - * - * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param type The internal type of the Shape. - * @param data The data of the source shape geometry, if any. - */ - constructor(scene: Phaser.Scene, type?: string, data?: any); - - /** - * The source Shape data. Typically a geometry object. - * You should not manipulate this directly. - */ - readonly geom: any; - - /** - * Holds the polygon path data for filled rendering. - */ - readonly pathData: number[]; - - /** - * Holds the earcut polygon path index data for filled rendering. - */ - readonly pathIndexes: number[]; - - /** - * The fill color used by this Shape. - */ - fillColor: number; - - /** - * The fill alpha value used by this Shape. - */ - fillAlpha: number; - - /** - * The stroke color used by this Shape. - */ - strokeColor: number; - - /** - * The stroke alpha value used by this Shape. - */ - strokeAlpha: number; - - /** - * The stroke line width used by this Shape. - */ - lineWidth: number; - - /** - * Controls if this Shape is filled or not. - * Note that some Shapes do not support being filled (such as Line shapes) - */ - isFilled: boolean; - - /** - * Controls if this Shape is stroked or not. - * Note that some Shapes do not support being stroked (such as Iso Box shapes) - */ - isStroked: boolean; - - /** - * Controls if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - */ - closePath: boolean; - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * Sets the fill color and alpha for this Shape. - * - * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. - * - * Note that some Shapes do not support fill colors, such as the Line shape. - * - * This call can be chained. - * @param color The color used to fill this shape. If not provided the Shape will not be filled. - * @param alpha The alpha value used when filling this shape, if a fill color is given. Default 1. - */ - setFillStyle(color?: number, alpha?: number): this; - - /** - * Sets the stroke color and alpha for this Shape. - * - * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. - * - * Note that some Shapes do not support being stroked, such as the Iso Box shape. - * - * This call can be chained. - * @param lineWidth The width of line to stroke with. If not provided or undefined the Shape will not be stroked. - * @param color The color used to stroke this shape. If not provided the Shape will not be stroked. - * @param alpha The alpha value used when stroking this shape, if a stroke color is given. Default 1. - */ - setStrokeStyle(lineWidth?: number, color?: number, alpha?: number): this; - - /** - * Sets if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * This call can be chained. - * @param value Set to `true` if the Shape should be closed when stroked, otherwise `false`. - */ - setClosePath(value: boolean): this; - - /** - * Sets the display size of this Shape. - * - * Calling this will adjust the scale. - * @param width The display width of this Shape. - * @param height The display height of this Shape. - */ - setDisplaySize(width: number, height: number): this; - - /** - * Internal destroy handler, called as part of the destroy process. - */ - protected preDestroy(): void; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * The radius of the rectangle if this is set to use rounded corners. - * - * Do not modify this property. Instead, call the method `setRounded` to set the - * radius of the rounded corners. - */ - readonly radius: number; - - /** - * Does this Rectangle have rounded corners? - * - * Do not modify this property. Instead, call the method `setRounded` to set the - * radius state of this rectangle. - */ - readonly isRounded: boolean; - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - */ - clearAlpha(): this; - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * @param value The alpha value applied across the whole Game Object. Default 1. - */ - setAlpha(value?: number): this; - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - */ - alpha: number; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency of which blend modes - * are used. - */ - blendMode: Phaser.BlendModes | string | number; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * NORMAL - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency in which blend modes - * are used. - * @param value The BlendMode value. Either a string, a CONST or a number. - */ - setBlendMode(value: string | Phaser.BlendModes | number): this; - - /** - * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. Ensure this value is only ever a number data-type. - */ - setDepth(value: number): this; - - /** - * Sets this Game Object to be at the top of the display list, or the top of its parent container. - * - * Being at the top means it will render on-top of everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - */ - setToTop(): this; - - /** - * Sets this Game Object to the back of the display list, or the back of its parent container. - * - * Being at the back means it will render below everything else. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - */ - setToBack(): this; - - /** - * Move this Game Object so that it appears above the given Game Object. - * - * This means it will render immediately after the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be above. - */ - setAbove(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Move this Game Object so that it appears below the given Game Object. - * - * This means it will render immediately under the other object in the display list. - * - * Both objects must belong to the same display list, or parent container. - * - * This method does not change this Game Objects `depth` value, it simply alters its list position. - * @param gameObject The Game Object that this Game Object will be moved to be below. - */ - setBelow(gameObject: Phaser.GameObjects.GameObject): this; - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getLeftCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getRightCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * - * The returned point is calculated in local space and does not factor in any parent Containers, - * unless the `includeParent` argument is set to `true`. - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the bounds of this Game Object, regardless of origin. - * - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * @param output An object to store the values in. If not provided a new Rectangle will be created. - */ - getBounds(output?: O): O; - - /** - * The Mask this Game Object is using during render. - */ - mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; - - /** - * Sets the mask that this Game Object will use to render with. - * - * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * If a mask is already set on this Game Object it will be immediately replaced. - * - * Masks are positioned in global space and are not relative to the Game Object to which they - * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * - * Masks have no impact on physics or input detection. They are purely a rendering component - * that allows you to limit what is visible during the render pass. - * @param mask The mask this Game Object will use when rendering. - */ - setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; - - /** - * Clears the mask that this Game Object was using. - * @param destroyMask Destroy the mask before clearing it? Default false. - */ - clearMask(destroyMask?: boolean): this; - - /** - * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, - * including this one, or a Dynamic Texture. - * - * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. - * - * To create the mask you need to pass in a reference to a renderable Game Object. - * A renderable Game Object is one that uses a texture to render with, such as an - * Image, Sprite, Render Texture or BitmapText. - * - * If you do not provide a renderable object, and this Game Object has a texture, - * it will use itself as the object. This means you can call this method to create - * a Bitmap Mask from any renderable texture-based Game Object. - * @param maskObject The Game Object or Dynamic Texture that will be used as the mask. If `null` it will generate an Image Game Object using the rest of the arguments. - * @param x If creating a Game Object, the horizontal position in the world. - * @param y If creating a Game Object, the vertical position in the world. - * @param texture If creating a Game Object, the key, or instance of the Texture it will use to render with, as stored in the Texture Manager. - * @param frame If creating a Game Object, an optional frame from the Texture this Game Object is rendering with. - */ - createBitmapMask(maskObject?: Phaser.GameObjects.GameObject | Phaser.Textures.DynamicTexture, x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number | Phaser.Textures.Frame): Phaser.Display.Masks.BitmapMask; - - /** - * Creates and returns a Geometry Mask. This mask can be used by any Game Object, - * including this one. - * - * To create the mask you need to pass in a reference to a Graphics Game Object. - * - * If you do not provide a graphics object, and this Game Object is an instance - * of a Graphics object, then it will use itself to create the mask. - * - * This means you can call this method to create a Geometry Mask from any Graphics Game Object. - * @param graphics A Graphics Game Object, or any kind of Shape Game Object. The geometry within it will be used as the mask. - */ - createGeometryMask(graphics?: Phaser.GameObjects.Graphics | Phaser.GameObjects.Shape): Phaser.Display.Masks.GeometryMask; - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - * Set this value with `setOrigin()`. - */ - readonly originX: number; - - /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. - * Set this value with `setOrigin()`. - */ - readonly originY: number; - - /** - * The horizontal display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginX: number; - - /** - * The vertical display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginY: number; - - /** - * Sets the origin of this Game Object. - * - * The values are given in the range 0 to 1. - * @param x The horizontal origin value. Default 0.5. - * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. - */ - setOrigin(x?: number, y?: number): this; - - /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. - */ - setOriginFromFrame(): this; - - /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. - * @param x The horizontal display origin value. Default 0. - * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. - */ - setDisplayOrigin(x?: number, y?: number): this; - - /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may. - */ - updateDisplayOrigin(): this; - - /** - * The initial WebGL pipeline of this Game Object. - * - * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. - */ - defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * The current WebGL pipeline of this Game Object. - */ - pipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. - */ - pipelineData: object; - - /** - * Sets the initial WebGL Pipeline of this Game Object. - * - * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. - * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. - */ - initPipeline(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; - - /** - * Sets the main WebGL Pipeline of this Game Object. - * - * Also sets the `pipelineData` property, if the parameter is given. - * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. - * @param pipelineData Optional pipeline data object that is set in to the `pipelineData` property of this Game Object. - * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. - */ - setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; - - /** - * Adds an entry to the `pipelineData` object belonging to this Game Object. - * - * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. - * - * If `value` is undefined, and `key` exists, `key` is removed from the data object. - * @param key The key of the pipeline data to set, update, or delete. - * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. - */ - setPipelineData(key: string, value?: any): this; - - /** - * Resets the WebGL Pipeline of this Game Object back to the default it was created with. - * @param resetData Reset the `pipelineData` object to being an empty object? Default false. - */ - resetPipeline(resetData?: boolean): boolean; - - /** - * Gets the name of the WebGL Pipeline this Game Object is currently using. - */ - getPipelineName(): string | null; - - /** - * Does this Game Object have any Post Pipelines set? - */ - hasPostPipeline: boolean; - - /** - * The WebGL Post FX Pipelines this Game Object uses for post-render effects. - * - * The pipelines are processed in the order in which they appear in this array. - * - * If you modify this array directly, be sure to set the - * `hasPostPipeline` property accordingly. - */ - postPipelines: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; - - /** - * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. - */ - postPipelineData: object; - - /** - * The Pre FX component of this Game Object. - * - * This component allows you to apply a variety of built-in effects to this Game Object, such - * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, - * for example: - * - * ```js - * const player = this.add.sprite(); - * player.preFX.addBloom(); - * ``` - * - * Only the following Game Objects support Pre FX: - * - * * Image - * * Sprite - * * TileSprite - * * Text - * * RenderTexture - * * Video - * - * All FX are WebGL only and do not have Canvas counterparts. - * - * Please see the FX Class for more details and available methods. - */ - preFX: Phaser.GameObjects.Components.FX | null; - - /** - * The Post FX component of this Game Object. - * - * This component allows you to apply a variety of built-in effects to this Game Object, such - * as glow, blur, bloom, displacements, vignettes and more. You access them via this property, - * for example: - * - * ```js - * const player = this.add.sprite(); - * player.postFX.addBloom(); - * ``` - * - * All FX are WebGL only and do not have Canvas counterparts. - * - * Please see the FX Class for more details and available methods. - * - * This property is always `null` until the `initPostPipeline` method is called. - */ - postFX: Phaser.GameObjects.Components.FX; - - /** - * This should only be called during the instantiation of the Game Object. - * - * It is called by default by all core Game Objects and doesn't need - * calling again. - * - * After that, use `setPostPipeline`. - * @param preFX Does this Game Object support Pre FX? Default false. - */ - initPostPipeline(preFX?: boolean): void; - - /** - * Sets one, or more, Post Pipelines on this Game Object. - * - * Post Pipelines are invoked after this Game Object has rendered to its target and - * are commonly used for post-fx. - * - * The post pipelines are appended to the `postPipelines` array belonging to this - * Game Object. When the renderer processes this Game Object, it iterates through the post - * pipelines in the order in which they appear in the array. If you are stacking together - * multiple effects, be aware that the order is important. - * - * If you call this method multiple times, the new pipelines will be appended to any existing - * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. - * - * You can optionally also set the `postPipelineData` property, if the parameter is given. - * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. - * @param pipelineData Optional pipeline data object that is set in to the `postPipelineData` property of this Game Object. - * @param copyData Should the pipeline data object be _deep copied_ into the `postPipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. - */ - setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; - - /** - * Adds an entry to the `postPipelineData` object belonging to this Game Object. - * - * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. - * - * If `value` is undefined, and `key` exists, `key` is removed from the data object. - * @param key The key of the pipeline data to set, update, or delete. - * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. - */ - setPostPipelineData(key: string, value?: any): this; - - /** - * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. - * @param pipeline The string-based name of the pipeline, or a pipeline class. - */ - getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; - - /** - * Resets the WebGL Post Pipelines of this Game Object. It does this by calling - * the `destroy` method on each post pipeline and then clearing the local array. - * @param resetData Reset the `postPipelineData` object to being an empty object? Default false. - */ - resetPostPipeline(resetData?: boolean): void; - - /** - * Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them. - * - * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. - * @param pipeline The string-based name of the pipeline, or a pipeline class. - */ - removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; - - /** - * Removes all Pre and Post FX Controllers from this Game Object. - * - * If you wish to remove a single controller, use the `preFX.remove(fx)` or `postFX.remove(fx)` methods instead. - * - * If you wish to clear a single controller, use the `preFX.clear()` or `postFX.clear()` methods instead. - */ - clearFX(): this; - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorX: number; - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorY: number; - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * @param x The horizontal scroll factor of this Game Object. - * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. - */ - setScrollFactor(x: number, y?: number): this; - - /** - * A property indicating that a Game Object has this component. - */ - readonly hasTransformComponent: boolean; - - /** - * The x position of this Game Object. - */ - x: number; - - /** - * The y position of this Game Object. - */ - y: number; - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - */ - z: number; - - /** - * The w position of this Game Object. - */ - w: number; - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - */ - scale: number; - - /** - * The horizontal scale of this Game Object. - */ - scaleX: number; - - /** - * The vertical scale of this Game Object. - */ - scaleY: number; - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - */ - angle: number; - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - */ - rotation: number; - - /** - * Sets the position of this Game Object. - * @param x The x position of this Game Object. Default 0. - * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. - * @param z The z position of this Game Object. Default 0. - * @param w The w position of this Game Object. Default 0. - */ - setPosition(x?: number, y?: number, z?: number, w?: number): this; - - /** - * Copies an object's coordinates to this Game Object's position. - * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. - */ - copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; - - /** - * 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. - * @param x The x position of the top-left of the random area. Default 0. - * @param y The y position of the top-left of the random area. Default 0. - * @param width The width of the random area. - * @param height The height of the random area. - */ - setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; - - /** - * Sets the rotation of this Game Object. - * @param radians The rotation of this Game Object, in radians. Default 0. - */ - setRotation(radians?: number): this; - - /** - * Sets the angle of this Game Object. - * @param degrees The rotation of this Game Object, in degrees. Default 0. - */ - setAngle(degrees?: number): this; - - /** - * Sets the scale of this Game Object. - * @param x The horizontal scale of this Game Object. Default 1. - * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. - */ - setScale(x?: number, y?: number): this; - - /** - * Sets the x position of this Game Object. - * @param value The x position of this Game Object. Default 0. - */ - setX(value?: number): this; - - /** - * Sets the y position of this Game Object. - * @param value The y position of this Game Object. Default 0. - */ - setY(value?: number): this; - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * @param value The z position of this Game Object. Default 0. - */ - setZ(value?: number): this; - - /** - * Sets the w position of this Game Object. - * @param value The w position of this Game Object. Default 0. - */ - setW(value?: number): this; - - /** - * Gets the local transform matrix for this Game Object. - * @param tempMatrix The matrix to populate with the values from this Game Object. - */ - getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * @param tempMatrix The matrix to populate with the values from this Game Object. - * @param parentMatrix A temporary matrix to hold parent values during the calculations. - */ - getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * @param x The x position to translate. - * @param y The y position to translate. - * @param point A Vector2, or point-like object, to store the results in. - * @param camera The Camera which is being tested against. If not given will use the Scene default camera. - */ - getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; - - /** - * Gets the world position of this Game Object, factoring in any parent Containers. - * @param point A Vector2, or point-like object, to store the result in. - * @param tempMatrix A temporary matrix to hold the Game Object's values. - * @param parentMatrix A temporary matrix to hold parent values. - */ - getWorldPoint(point?: Phaser.Math.Vector2, tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Math.Vector2; - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - */ - getParentRotation(): number; - - /** - * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -63055,20 +61723,20 @@ declare namespace Phaser { * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * As the name implies, the Star shape will display a star in your game. You can control several * aspects of it including the number of points that constitute the star. The default is 5. If * you change it to 4 it will render as a diamond. If you increase them, you'll get a more spiky * star shape. - * + * * You can also control the inner and outer radius, which is how 'long' each point of the star is. * Modify these values to create more interesting shapes. */ class Star extends Phaser.GameObjects.Shape { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -63358,7 +62026,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -63367,21 +62035,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -63391,21 +62059,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -63417,13 +62085,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -63454,7 +62122,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -63464,11 +62132,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -63477,11 +62145,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -63490,7 +62158,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63501,7 +62169,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63512,7 +62180,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63523,7 +62191,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63534,7 +62202,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63545,7 +62213,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63556,7 +62224,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63567,7 +62235,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63578,7 +62246,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -63614,10 +62282,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -63638,12 +62306,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -63689,7 +62357,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -63791,12 +62459,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -63810,12 +62478,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -63833,10 +62501,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -63868,7 +62536,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -63882,7 +62550,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -63900,20 +62568,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -63938,9 +62606,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -63989,7 +62657,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -64022,9 +62690,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -64055,14 +62723,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -64076,16 +62744,16 @@ declare namespace Phaser { * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports both fill and stroke colors. - * + * * The Triangle consists of 3 lines, joining up to form a triangular shape. You can control the * position of each point of these lines. The triangle is always closed and cannot have an open * face. If you require that, consider using a Polygon instead. */ class Triangle extends Phaser.GameObjects.Shape { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. Default 0. * @param y The vertical position of this Game Object in the world. Default 0. @@ -64351,7 +63019,7 @@ declare namespace Phaser { /** * The alpha value of the Game Object. - * + * * This is a global value, impacting the entire Game Object, not just a region of it. * The value is clamped to the range [0, 1]. Setting alpha to 0 also clears the render * flag, preventing the Game Object from being drawn until the alpha is raised above 0 again. @@ -64360,21 +63028,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -64384,21 +63052,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -64410,13 +63078,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -64447,7 +63115,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -64457,11 +63125,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -64470,11 +63138,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -64483,7 +63151,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64494,7 +63162,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64505,7 +63173,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64516,7 +63184,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64527,7 +63195,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64538,7 +63206,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64549,7 +63217,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64560,7 +63228,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64571,7 +63239,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -64607,10 +63275,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -64631,12 +63299,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -64682,7 +63350,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -64784,12 +63452,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -64803,12 +63471,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -64826,10 +63494,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -64861,7 +63529,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -64875,7 +63543,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -64893,20 +63561,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -64931,9 +63599,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -64982,7 +63650,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -65015,9 +63683,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -65048,14 +63716,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -65066,18 +63734,18 @@ declare namespace Phaser { /** * A Sprite Game Object. - * + * * A Sprite Game Object is used for the display of both static and animated images in your game. * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled * and animated. - * + * * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. */ class Sprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -65088,7 +63756,7 @@ declare namespace Phaser { /** * The Animation State component of this Sprite. - * + * * This component provides features to apply animations to this Sprite. * It is responsible for playing, loading, queuing animations for later playback, * mixing between animations and setting the current animation frame to this Sprite. @@ -65120,15 +63788,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -65136,37 +63804,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).play('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. @@ -65176,15 +63844,15 @@ declare namespace Phaser { /** * Start playing the given animation on this Sprite, in reverse. - * + * * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * + * * The benefit of a global animation is that multiple Sprites can all play the same animation, without * having to duplicate the data. You can just create it once and then play it on any Sprite. - * + * * The following code shows how to create a global repeating animation. The animation will be created * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * + * * ```javascript * var config = { * key: 'run', @@ -65192,37 +63860,37 @@ declare namespace Phaser { * frameRate: 15, * repeat: -1 * }; - * + * * // This code should be run from within a Scene: * this.anims.create(config); * ``` - * + * * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, * you can call the `Animation.create` method instead. It accepts the exact same parameters as when * creating a global animation, however the resulting data is kept locally in this Sprite. - * + * * With the animation created, either globally or locally, you can now play it on this Sprite: - * + * * ```javascript * this.add.sprite(x, y).playReverse('run'); * ``` - * + * * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config * object instead: - * + * * ```javascript * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); * ``` - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * If you need a Sprite to be able to play both local and global animations, make sure they don't * have conflicting keys. - * + * * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * + * * Also, see the documentation in the Animation Manager for further details on creating animations. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. @@ -65232,18 +63900,18 @@ declare namespace Phaser { /** * Waits for the specified delay, in milliseconds, then starts playback of the given animation. - * + * * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. - * + * * If an animation is already running and a new animation is given to this method, it will wait for * the given delay before starting the new animation. - * + * * If no animation is currently running, the given one begins after the delay. - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. - * + * * Prior to Phaser 3.50 this method was called 'delayedPlay'. * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param delay The delay, in milliseconds, to wait before starting the animation playing. @@ -65254,12 +63922,12 @@ declare namespace Phaser { /** * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback * of the given animation. - * + * * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an * idle animation to a walking animation, by making them blend smoothly into each other. - * + * * If no animation is currently running, the given one will start immediately. - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. @@ -65271,20 +63939,20 @@ declare namespace Phaser { /** * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. - * + * * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, * or have the `stop` method called directly on it. - * + * * An animation set to repeat forever will never enter a completed state. - * + * * You can chain a new animation at any point, including before the current one starts playing, during it, * or when it ends (via its `animationcomplete` event). - * + * * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained * animations without impacting the animation they're playing. - * + * * Call this method with no arguments to reset all currently chained animations. - * + * * When playing an animation on a Sprite it will first check to see if it can find a matching key * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. @@ -65295,7 +63963,7 @@ declare namespace Phaser { /** * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. - * + * * If no animation is playing, no event will be dispatched. * * If there is another animation queued (via the `chain` method) then it will start playing immediately.undefined @@ -65305,11 +63973,11 @@ declare namespace Phaser { /** * Stops the current animation from playing after the specified time delay, given in milliseconds. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param delay The number of milliseconds to wait before stopping this animation. @@ -65319,11 +63987,11 @@ declare namespace Phaser { /** * Stops the current animation from playing after the given number of repeats. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param repeatCount How many times should the animation repeat before stopping? Default 1. @@ -65334,11 +64002,11 @@ declare namespace Phaser { /** * Stops the current animation from playing when it next sets the given frame. * If this frame doesn't exist within the animation it will not stop it from playing. - * + * * It then dispatches the `ANIMATION_STOP` event. - * + * * If no animation is running, no events will be dispatched. - * + * * If there is another animation in the queue (set via the `chain` method) then it will start playing, * when the current one stops. * @param frame The frame to check before stopping this animation. @@ -65584,7 +64252,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -65630,21 +64298,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -65654,21 +64322,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -65680,13 +64348,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -65717,7 +64385,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -65727,11 +64395,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -65740,11 +64408,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -65831,7 +64499,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65842,7 +64510,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65853,7 +64521,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65864,7 +64532,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65875,7 +64543,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65886,7 +64554,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65897,7 +64565,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65908,7 +64576,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -65919,7 +64587,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -66001,10 +64669,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -66025,12 +64693,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -66076,7 +64744,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -66178,12 +64846,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -66197,12 +64865,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -66220,10 +64888,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -66240,7 +64908,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -66249,7 +64917,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -66258,30 +64926,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -66291,12 +64959,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -66337,26 +65005,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -66369,7 +65037,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -66379,14 +65047,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -66455,11 +65123,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -66527,7 +65195,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -66541,7 +65209,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -66559,20 +65227,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -66597,9 +65265,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -66648,7 +65316,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -66681,9 +65349,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -66714,14 +65382,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -69405,34 +68073,34 @@ declare namespace Phaser { /** * A Text Game Object. - * + * * Text objects work by creating their own internal hidden Canvas and then renders text to it using * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered * to your game during the render pass. - * + * * Because it uses the Canvas API you can take advantage of all the features this offers, such as * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts * loaded externally, such as Google or TypeKit Web fonts. - * + * * **Important:** The font name must be quoted if it contains certain combinations of digits or * special characters, either when creating the Text object, or when setting the font via `setFont` * or `setFontFamily`, e.g.: - * + * * ```javascript * this.add.text(0, 0, 'Hello World', { fontFamily: 'Georgia, "Goudy Bookletter 1911", Times, serif' }); * ``` - * + * * ```javascript * this.add.text(0, 0, 'Hello World', { font: '"Press Start 2P"' }); * ``` - * + * * You can only display fonts that are currently loaded and available to the browser: therefore fonts must * be pre-loaded. Phaser does not do this for you, so you will require the use of a 3rd party font loader, * or have the fonts readily available in the CSS on the page in which your Phaser game resides. * * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts * across mobile browsers. - * + * * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of @@ -69441,7 +68109,7 @@ declare namespace Phaser { */ class Text extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Crop, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -69467,7 +68135,7 @@ declare namespace Phaser { /** * The Text Style object. - * + * * Manages the style of this Text object. */ style: Phaser.GameObjects.TextStyle; @@ -69504,7 +68172,7 @@ declare namespace Phaser { * The line spacing value. * This value is added to the font height to calculate the overall line height. * Only has an effect if this Text object contains multiple lines of text. - * + * * If you update this property directly, instead of using the `setLineSpacing` method, then * be sure to call `updateText` after, or you won't see the change reflected in the Text object. */ @@ -69513,7 +68181,7 @@ declare namespace Phaser { /** * Adds / Removes spacing between characters. * Can be a negative or positive number. - * + * * If you update this property directly, instead of using the `setLetterSpacing` method, then * be sure to call `updateText` after, or you won't see the change reflected in the Text object. */ @@ -69566,7 +68234,7 @@ declare namespace Phaser { /** * Set the text to display. - * + * * An array of strings will be joined with `\n` line breaks. * @param value The string, or array of strings, to be set as the content of this Text object. * @returns This Text object. @@ -69575,7 +68243,7 @@ declare namespace Phaser { /** * Appends the given text to the content already being displayed by this Text object. - * + * * An array of strings will be joined with `\n` line breaks. * @param value The string, or array of strings, to be appended to the existing content of this Text object. * @param addCR Insert a carriage-return before the string value. Default true. @@ -69592,22 +68260,22 @@ declare namespace Phaser { /** * Set the font. - * + * * If a string is given, the font family is set. - * + * * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` * properties of that object are set. - * + * * **Important:** The font name must be quoted if it contains certain combinations of digits or * special characters: - * + * * ```javascript * Text.setFont('"Press Start 2P"'); * ``` - * + * * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all * quoted properly, too: - * + * * ```javascript * Text.setFont('Georgia, "Goudy Bookletter 1911", Times, serif'); * ``` @@ -69618,17 +68286,17 @@ declare namespace Phaser { /** * Set the font family. - * + * * **Important:** The font name must be quoted if it contains certain combinations of digits or * special characters: - * + * * ```javascript * Text.setFontFamily('"Press Start 2P"'); * ``` - * + * * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all * quoted properly, too: - * + * * ```javascript * Text.setFontFamily('Georgia, "Goudy Bookletter 1911", Times, serif'); * ``` @@ -69653,7 +68321,7 @@ declare namespace Phaser { /** * Set a fixed width and height for the text. - * + * * Pass in `0` for either of these parameters to disable fixed width or height respectively. * @param width The fixed width to set. `0` disables fixed width. * @param height The fixed height to set. `0` disables fixed height. @@ -69670,10 +68338,10 @@ declare namespace Phaser { /** * Set the fill style to be used by the Text object. - * + * * This can be any valid CanvasRenderingContext2D fillStyle value, such as * a color (in hex, rgb, rgba, hsl or named values), a gradient or a pattern. - * + * * See the [MDN fillStyle docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle) for more details. * @param color The text fill style. Can be any valid CanvasRenderingContext `fillStyle` value. * @returns This Text object. @@ -69766,9 +68434,9 @@ declare namespace Phaser { /** * Set the alignment of the text in this Text object. - * + * * The argument can be one of: `left`, `right`, `center` or `justify`. - * + * * Alignment only works if the Text object has more than one line of text. * @param align The text alignment for multi-line text. Default 'left'. * @returns This Text object. @@ -69789,7 +68457,7 @@ declare namespace Phaser { /** * Sets the line spacing value. - * + * * This value is _added_ to the height of the font when calculating the overall line height. * This only has an effect if this Text object consists of multiple lines of text. * @param value The amount to add to the font height to achieve the overall line height. @@ -69799,11 +68467,11 @@ declare namespace Phaser { /** * Sets the letter spacing value. - * + * * This will add, or remove spacing between each character of this Text Game Object. The value can be * either positive or negative. Positive values increase the space between each character, whilst negative * values decrease it. Note that some fonts are spaced naturally closer together than others. - * + * * Please understand that enabling this feature will cause Phaser to render each character in this Text object * one by one, rather than use a draw for the whole string. This makes it extremely expensive when used with * either long strings, or lots of strings in total. You will be better off creating bitmap font text if you @@ -70107,7 +68775,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -70153,21 +68821,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -70177,21 +68845,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -70203,30 +68871,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -70266,26 +68934,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates cannot exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -70298,13 +68966,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -70335,7 +69003,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -70345,11 +69013,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -70358,11 +69026,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -70449,7 +69117,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70460,7 +69128,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70471,7 +69139,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70482,7 +69150,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70493,7 +69161,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70504,7 +69172,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70515,7 +69183,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70526,7 +69194,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70537,7 +69205,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -70573,10 +69241,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -70597,12 +69265,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -70648,7 +69316,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -70750,12 +69418,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -70769,12 +69437,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -70792,10 +69460,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -70870,11 +69538,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -70942,7 +69610,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -70956,7 +69624,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -70974,20 +69642,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -71012,9 +69680,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -71063,7 +69731,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -71096,9 +69764,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -71129,14 +69797,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -71147,14 +69815,14 @@ declare namespace Phaser { /** * A TextStyle class manages all of the style settings for a Text object. - * + * * Text Game Objects create a TextStyle instance automatically, which is * accessed via the `Text.style` property. You do not normally need to * instantiate one yourself. */ class TextStyle { /** - * + * * @param text The Text object that this TextStyle is styling. * @param style The style settings to set. */ @@ -71249,7 +69917,7 @@ declare namespace Phaser { /** * The fixed height of the text. - * + * * `0` means no fixed height. */ fixedHeight: number; @@ -71351,9 +70019,9 @@ declare namespace Phaser { /** * Set the font. - * + * * If a string is given, the font family is set. - * + * * If an object is given, the `fontFamily`, `fontSize` and `fontStyle` * properties of that object are set. * @param font The font family or font settings to set. @@ -71392,7 +70060,7 @@ declare namespace Phaser { /** * Set a fixed width and height for the text. - * + * * Pass in `0` for either of these parameters to disable fixed width or height respectively. * @param width The fixed width to set. * @param height The fixed height to set. @@ -71423,10 +70091,10 @@ declare namespace Phaser { /** * Set the resolution used by the Text object. - * + * * It allows for much clearer text on High DPI devices, at the cost of memory because * it uses larger internal Canvas textures for the Text. - * + * * Please use with caution, as the more high res Text you have, the more memory it uses up. * @param value The resolution for this Text object to use. * @returns The parent Text object. @@ -71494,7 +70162,7 @@ declare namespace Phaser { /** * Set the width (in pixels) to use for wrapping lines. - * + * * Pass in null to remove wrapping by width. * @param width The maximum width of a line in pixels. Set to null to remove wrapping. * @param useAdvancedWrap Whether or not to use the advanced wrapping @@ -71506,7 +70174,7 @@ declare namespace Phaser { /** * Set a custom callback for wrapping lines. - * + * * Pass in null to remove wrapping by callback. * @param callback A custom function that will be responsible for wrapping the * text. It will receive two arguments: text (the string to wrap), textObject (this Text @@ -71519,9 +70187,9 @@ declare namespace Phaser { /** * Set the alignment of the text in this Text object. - * + * * The argument can be one of: `left`, `right`, `center` or `justify`. - * + * * Alignment only works if the Text object has more than one line of text. * @param align The text alignment for multi-line text. Default 'left'. * @returns The parent Text object. @@ -71556,10 +70224,10 @@ declare namespace Phaser { /** * A TileSprite is a Sprite that has a repeating texture. - * + * * The texture can be scrolled and scaled independently of the TileSprite itself. Textures will automatically wrap and * are designed so that you can create game backdrops using seamless textures as a source. - * + * * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will @@ -71575,7 +70243,7 @@ declare namespace Phaser { */ class TileSprite extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -71661,9 +70329,9 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * The Frame has to belong to the current Texture being used. - * + * * It can be either a string or an index. * @param frame The name or index of the frame within the Texture. * @returns This Game Object instance. @@ -71980,7 +70648,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -72026,21 +70694,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -72050,21 +70718,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -72076,7 +70744,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -72085,7 +70753,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -72094,18 +70762,18 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; @@ -72124,13 +70792,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -72161,7 +70829,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -72171,11 +70839,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -72184,11 +70852,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -72275,7 +70943,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72286,7 +70954,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72297,7 +70965,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72308,7 +70976,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72319,7 +70987,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72330,7 +70998,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72341,7 +71009,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72352,7 +71020,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72363,7 +71031,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -72445,10 +71113,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -72469,12 +71137,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -72520,7 +71188,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -72622,12 +71290,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -72641,12 +71309,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -72664,10 +71332,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -72768,11 +71436,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -72840,7 +71508,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -72854,7 +71522,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -72872,20 +71540,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -72910,9 +71578,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -72961,7 +71629,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -72994,9 +71662,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -73027,14 +71695,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -73045,33 +71713,33 @@ declare namespace Phaser { /** * A Video Game Object. - * + * * This Game Object is capable of handling playback of a video file, video stream or media stream. - * + * * You can optionally 'preload' the video into the Phaser Video Cache: - * + * * ```javascript * preload () { * this.load.video('ripley', 'assets/aliens.mp4'); * } - * + * * create () { * this.add.video(400, 300, 'ripley'); * } * ``` - * + * * You don't have to 'preload' the video. You can also play it directly from a URL: - * + * * ```javascript * create () { * this.add.video(400, 300).loadURL('assets/aliens.mp4'); * } * ``` - * + * * To all intents and purposes, a video is a standard Game Object, just like a Sprite. And as such, you can do * all the usual things to it, such as scaling, rotating, cropping, tinting, making interactive, giving a * physics body, etc. - * + * * Transparent videos are also possible via the WebM file format. Providing the video file has was encoded with * an alpha channel, and providing the browser supports WebM playback (not all of them do), then it will render * in-game with full transparency. @@ -73083,45 +71751,45 @@ declare namespace Phaser { * * Playback is handled entirely via the Request Video Frame API, which is supported by most modern browsers. * A polyfill is provided for older browsers. - * + * * ### Autoplaying Videos - * + * * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. * The policies that control autoplaying are vast and vary between browser. You can, and should, read more about * it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', true); * } * ``` - * + * * The 3rd parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for further details. - * + * * Or: - * + * * ```javascript * create () { * this.add.video(400, 300).loadURL('assets/aliens.mp4', true); * } * ``` - * + * * You can set the `noAudio` parameter to `true` even if the video does contain audio. It will still allow the video * to play immediately, but the audio will not start. * * More details about video playback and the supported media formats can be found on MDN: - * + * * https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement * https://developer.mozilla.org/en-US/docs/Web/Media/Formats */ class Video extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Lighting, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.RenderNodes, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.TextureCrop, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -73131,30 +71799,30 @@ declare namespace Phaser { /** * A reference to the HTML Video Element this Video Game Object is playing. - * + * * Will be `undefined` until a video is loaded for playback. */ video: HTMLVideoElement | null; /** * The Phaser Texture this Game Object is using to render the video to. - * + * * Will be `undefined` until a video is loaded for playback. */ videoTexture: Phaser.Textures.Texture | null; /** * A reference to the TextureSource backing the `videoTexture` Texture object. - * + * * Will be `undefined` until a video is loaded for playback. */ videoTextureSource: Phaser.Textures.TextureSource | null; /** * A Phaser `CanvasTexture` instance that holds the most recent snapshot taken from the video. - * + * * This will only be set if the `snapshot` or `snapshotArea` methods have been called. - * + * * Until those methods are called, this property will be `undefined`. */ snapshotTexture: Phaser.Textures.CanvasTexture | null; @@ -73186,19 +71854,19 @@ declare namespace Phaser { /** * This read-only property returns `true` if the video is currently stalled, i.e. it has stopped * playing due to a lack of data, or too much data, but hasn't yet reached the end of the video. - * + * * This is set if the Video DOM element emits any of the following events: - * + * * `stalled` * `suspend` * `waiting` - * + * * And is cleared if the Video DOM element emits the `playing` event, or handles * a requestVideoFrame call. - * + * * Listen for the Phaser Event `VIDEO_STALLED` to be notified and inspect the event * to see which DOM event caused it. - * + * * Note that being stalled isn't always a negative thing. A video can be stalled if it * has downloaded enough data in to its buffer to not need to download any more until * the current batch of frames have rendered. @@ -73215,15 +71883,15 @@ declare namespace Phaser { * If the browser supports the Request Video Frame API then this * property will hold the metadata that is returned from * the callback each time it is invoked. - * + * * See https://wicg.github.io/video-rvfc/#video-frame-metadata-callback * for a complete list of all properties that will be in this object. * Likely of most interest is the `mediaTime` property: - * + * * The media presentation timestamp (PTS) in seconds of the frame presented * (e.g. its timestamp on the video.currentTime timeline). MAY have a zero * value for live-streams or WebRTC applications. - * + * * If the browser doesn't support the API then this property will be undefined. */ metadata: VideoFrameCallbackMetadata; @@ -73247,14 +71915,14 @@ declare namespace Phaser { /** * The key of the current video as stored in the Video cache. - * + * * If the video did not come from the cache this will be an empty string. */ readonly cacheKey: string; /** * Is the video currently seeking? - * + * * This is set to `true` when the `seeking` event is fired, * and set to `false` when the `seeked` event is fired. */ @@ -73276,10 +71944,10 @@ declare namespace Phaser { /** * Loads a Video from the Video Cache, ready for playback with the `Video.play` method. - * + * * If a video is already playing, this method allows you to change the source of the current video element. * It works by first stopping the current video and then starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. @@ -73292,7 +71960,7 @@ declare namespace Phaser { * This method allows you to change the source of the current video element. It works by first stopping the * current video, if playing. Then deleting the video texture, if one has been created. Finally, it makes a * new video texture and starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. @@ -73315,10 +71983,10 @@ declare namespace Phaser { /** * Loads a Video from the given URL, ready for playback with the `Video.play` method. - * + * * If a video is already playing, this method allows you to change the source of the current video element. * It works by first stopping the current video and then starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. @@ -73341,10 +72009,10 @@ declare namespace Phaser { /** * Internal method that loads a Video from the given URL, ready for playback with the * `Video.play` method. - * + * * Normally you don't call this method directly, but instead use the `Video.loadURL` method, * or the `Video.load` method if you have preloaded the video. - * + * * Calling this method will skip checking if the browser supports the given format in * the URL, where-as the other two methods enforce these checks. * @param url The absolute or relative URL to load the video file from. Set to `null` if passing in a MediaStream object. @@ -73357,12 +72025,12 @@ declare namespace Phaser { /** * This method handles the Request Video Frame callback. - * + * * It is called by the browser when a new video frame is ready to be displayed. - * + * * It's also responsible for the creation of the video texture, if it doesn't * already exist. If it does, it updates the texture as required. - * + * * For more details about the Request Video Frame callback, see: * https://web.dev/requestvideoframecallback-rvfc * @param now The current time in milliseconds. @@ -73372,26 +72040,26 @@ declare namespace Phaser { /** * Starts this video playing. - * + * * If the video is already playing, or has been queued to play with `changeSource` then this method just returns. - * + * * Videos can only autoplay if the browser has been unlocked. This happens if you have interacted with the browser, i.e. * by clicking on it or pressing a key, or due to server settings. The policies that control autoplaying are vast and * vary between browser. You can read more here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is loaded, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', true); * } * ``` - * + * * The 3rd parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for details. - * + * * If you need audio in your videos, then you'll have to consider the fact that the video cannot start playing until the * user has interacted with the browser, into your game flow. * @param loop Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. Default false. @@ -73433,10 +72101,10 @@ declare namespace Phaser { /** * Creates the video.play promise and adds the success and error handlers to it. - * + * * Not all browsers support the video.play promise, so this method will fall back to * the old-school way of handling the video.play call. - * + * * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play#browser_compatibility for details. * @param catchError Should the error be caught and the video marked as failed to play? Default true. */ @@ -73444,14 +72112,14 @@ declare namespace Phaser { /** * Adds a sequence marker to this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds. - * + * * You can then play back specific markers via the `playMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * @param key A unique name to give this marker. * @param markerIn The time, in seconds, representing the start of this marker. @@ -73462,13 +72130,13 @@ declare namespace Phaser { /** * Plays a pre-defined sequence in this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds and * specified via the `addMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * @param key The name of the marker sequence to play. * @param loop Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. Default false. @@ -73478,7 +72146,7 @@ declare namespace Phaser { /** * Removes a previously set marker from this video. - * + * * If the marker is currently playing it will _not_ stop playback. * @param key The name of the marker to remove. * @returns This Video Game Object for method chaining. @@ -73488,7 +72156,7 @@ declare namespace Phaser { /** * Takes a snapshot of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a width and height. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * @param width The width of the resulting CanvasTexture. @@ -73500,7 +72168,7 @@ declare namespace Phaser { /** * Takes a snapshot of the specified area of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a different `destWidth` and `destHeight`. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * @param x The horizontal location of the top-left of the area to grab from. Default 0. @@ -73515,27 +72183,27 @@ declare namespace Phaser { /** * Stores a copy of this Videos `snapshotTexture` in the Texture Manager using the given key. - * + * * This texture is created when the `snapshot` or `snapshotArea` methods are called. - * + * * After doing this, any texture based Game Object, such as a Sprite, can use the contents of the * snapshot by using the texture key: - * + * * ```javascript * var vid = this.add.video(0, 0, 'intro'); - * + * * vid.snapshot(); - * + * * vid.saveSnapshotTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Updating the contents of the `snapshotTexture`, for example by calling `snapshot` again, * will automatically update _any_ Game Object that is using it as a texture. * Calling `saveSnapshotTexture` again will not save another copy of the same texture, * it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. @@ -73557,7 +72225,7 @@ declare namespace Phaser { /** * Called when the video emits a `playing` event. - * + * * This is the legacy handler for browsers that don't support Promise based playback. */ legacyPlayHandler(): void; @@ -73581,12 +72249,12 @@ declare namespace Phaser { /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -73602,7 +72270,7 @@ declare namespace Phaser { /** * Called when the video completes playback, i.e. reaches an `ended` state. - * + * * This will never happen if the video is coming from a live stream, where the duration is `Infinity`. */ completeHandler(): void; @@ -73610,14 +72278,14 @@ declare namespace Phaser { /** * Seeks to a given point in the video. The value is given as a float between 0 and 1, * where 0 represents the start of the video and 1 represents the end. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * If you wish to seek based on time instead, use the `Video.setCurrentTime` method. - * + * * Unfortunately, the DOM video element does not guarantee frame-accurate seeking. * This has been an ongoing subject of discussion: https://github.com/w3c/media-and-entertainment/issues/4 * @param value The point in the video to seek to. A value between 0 and 1. @@ -73627,7 +72295,7 @@ declare namespace Phaser { /** * A double-precision floating-point value indicating the current playback time in seconds. - * + * * If the media has not started to play and has not been seeked, this value is the media's initial playback time. * * For a more accurate value, use the `Video.metadata.mediaTime` property instead.undefined @@ -73637,15 +72305,15 @@ declare namespace Phaser { /** * Seeks to a given playback time in the video. The value is given in _seconds_ or as a string. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * You can provide a string prefixed with either a `+` or a `-`, such as `+2.5` or `-2.5`. * In this case it will seek to +/- the value given, relative to the _current time_. - * + * * If you wish to seek based on a duration percentage instead, use the `Video.seekTo` method. * @param value The playback time to seek to in seconds. Can be expressed as a string, such as `+2` to seek 2 seconds ahead from the current time. * @returns This Video Game Object for method chaining. @@ -73654,9 +72322,9 @@ declare namespace Phaser { /** * Returns the current progress of the video as a float. - * + * * Progress is defined as a value between 0 (the start) and 1 (the end). - * + * * Progress can only be returned if the video has a duration. Some videos, * such as those coming from a live stream, do not have a duration. In this * case the method will return -1.undefined @@ -73667,7 +72335,7 @@ declare namespace Phaser { /** * A double-precision floating-point value which indicates the duration (total length) of the media in seconds, * on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN. - * + * * If the media has no known end (such as for live streams of unknown duration, web radio, media incoming from WebRTC, * and so forth), this value is +Infinity. * @@ -73691,14 +72359,14 @@ declare namespace Phaser { /** * Sets the paused state of the currently loaded video. - * + * * If the video is playing, calling this method with `true` will pause playback. * If the video is paused, calling this method with `false` will resume playback. - * + * * If no video is loaded, this method does nothing. - * + * * If the video has not yet been played, `Video.play` will be called with no parameters. - * + * * If the video has ended, this method will do nothing. * @param value The paused value. `true` if the video should be paused, `false` to resume it. Default true. * @returns This Video Game Object for method chaining. @@ -73707,7 +72375,7 @@ declare namespace Phaser { /** * Pauses the current Video, if one is playing. - * + * * If no video is loaded, this method does nothing. * * Call `Video.resume` to resume playback.undefined @@ -73717,7 +72385,7 @@ declare namespace Phaser { /** * Resumes the current Video, if one was previously playing and has been paused. - * + * * If no video is loaded, this method does nothing. * * Call `Video.pause` to pause playback.undefined @@ -73733,7 +72401,7 @@ declare namespace Phaser { /** * Sets the volume of the currently playing video. - * + * * The value given is a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). * @param value A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). Default 1. * @returns This Video Game Object for method chaining. @@ -73748,7 +72416,7 @@ declare namespace Phaser { /** * Sets the playback rate of the current video. - * + * * The value given is a double that indicates the rate at which the media is being played back. * @param rate A double that indicates the rate at which the media is being played back. * @returns This Video Game Object for method chaining. @@ -73763,11 +72431,11 @@ declare namespace Phaser { /** * Sets the loop state of the current video. - * + * * The value given is a boolean which indicates whether the media element will start over when it reaches the end. - * + * * Not all videos can loop, for example live streams. - * + * * Please note that not all browsers support _seamless_ video looping for all encoding formats. * @param value A boolean which indicates whether the media element will start over when it reaches the end. Default true. * @returns This Video Game Object for method chaining. @@ -73789,39 +72457,39 @@ declare namespace Phaser { /** * Stores this Video in the Texture Manager using the given key as a dynamic texture, * which any texture-based Game Object, such as a Sprite, can use as its source: - * + * * ```javascript * const vid = this.add.video(0, 0, 'intro'); - * + * * vid.play(); - * + * * vid.saveTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * If the video is not yet playing then you need to listen for the `TEXTURE_READY` event before * you can use this texture on a Game Object: - * + * * ```javascript * const vid = this.add.video(0, 0, 'intro'); - * + * * vid.play(); - * + * * vid.once('textureready', (video, texture, key) => { - * + * * this.add.image(400, 300, key); - * + * * }); - * + * * vid.saveTexture('doodle'); * ``` - * + * * The saved texture is automatically updated as the video plays. If you pause this video, * or change its source, then the saved texture updates instantly. - * + * * Calling `saveTexture` again will not save another copy of the same texture, it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. @@ -73836,9 +72504,9 @@ declare namespace Phaser { /** * Stops the video playing and clears all internal event listeners. - * + * * If you only wish to pause playback of the video, and resume it a later time, use the `Video.pause` method instead. - * + * * If the video hasn't finished downloading, calling this method will not abort the download. To do that you need to * call `destroy` instead. * @param emitStopEvent Should the `VIDEO_STOP` event be emitted? Default true. @@ -73848,13 +72516,13 @@ declare namespace Phaser { /** * Removes the Video element from the DOM by calling parentNode.removeChild on itself. - * + * * Also removes the autoplay and src attributes and nulls the `Video.video` reference. - * + * * If you loaded an external video via `Video.loadURL` then you should call this function * to clear up once you are done with the instance, but don't want to destroy this * Video Game Object. - * + * * This method is called automatically by `Video.destroy`. */ removeVideoElement(): void; @@ -74091,7 +72759,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -74137,21 +72805,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -74161,21 +72829,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -74187,7 +72855,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -74196,7 +72864,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -74205,30 +72873,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -74251,13 +72919,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -74288,7 +72956,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -74298,11 +72966,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -74311,11 +72979,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -74402,7 +73070,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74413,7 +73081,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74424,7 +73092,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74435,7 +73103,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74446,7 +73114,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74457,7 +73125,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74468,7 +73136,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74479,7 +73147,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74490,7 +73158,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -74572,10 +73240,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -74596,12 +73264,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -74647,7 +73315,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -74749,12 +73417,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -74768,12 +73436,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -74791,10 +73459,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -74828,26 +73496,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -74860,7 +73528,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -74870,14 +73538,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -74946,11 +73614,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -75018,7 +73686,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -75032,7 +73700,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -75050,20 +73718,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -75088,9 +73756,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -75139,7 +73807,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -75172,9 +73840,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -75205,14 +73873,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -75234,7 +73902,7 @@ declare namespace Phaser { */ class Zone extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -75542,13 +74210,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -75579,7 +74247,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -75589,11 +74257,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -75602,11 +74270,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -75615,7 +74283,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75626,7 +74294,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75637,7 +74305,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75648,7 +74316,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75659,7 +74327,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75670,7 +74338,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75681,7 +74349,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75692,7 +74360,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75703,7 +74371,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -75762,7 +74430,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -75812,7 +74480,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -75826,7 +74494,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -75844,20 +74512,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -75882,9 +74550,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -75933,7 +74601,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -75966,9 +74634,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -75999,12 +74667,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -76018,12 +74686,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -76041,10 +74709,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -76061,14 +74729,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -76094,7 +74762,7 @@ declare namespace Phaser { */ class Circle { /** - * + * * @param x The x position of the center of the circle. Default 0. * @param y The y position of the center of the circle. Default 0. * @param radius The radius of the circle. Default 0. @@ -76397,7 +75065,7 @@ declare namespace Phaser { */ class Ellipse { /** - * + * * @param x The x position of the center of the ellipse. Default 0. * @param y The y position of the center of the ellipse. Default 0. * @param width The width of the ellipse. Default 0. @@ -76740,9 +75408,9 @@ declare namespace Phaser { * the last point is connected back to the first point. * * If no intersection is found, this function returns `null`. - * + * * If intersection was found, a Vector3 is returned with the following properties: - * + * * The `x` and `y` components contain the point of the intersection. * The `z` component contains the closest distance. * @param line The line segment, or ray, to check. If a ray, set the `isRay` parameter to `true`. @@ -76755,11 +75423,11 @@ declare namespace Phaser { /** * Checks for the closest point of intersection between a line segment and an array of polygons. - * + * * If no intersection is found, this function returns `null`. - * + * * If intersection was found, a Vector4 is returned with the following properties: - * + * * The `x` and `y` components contain the point of the intersection. * The `z` component contains the closest distance. * The `w` component contains the index of the polygon, in the given array, that triggered the intersection. @@ -76785,11 +75453,11 @@ declare namespace Phaser { * Projects rays out from the given point to each vertex of the polygons. * * If the rays intersect with the polygons, the points of intersection are returned in an array. - * + * * If no intersections are found, the returned array will be empty. - * + * * Each Vector4 intersection result has the following properties: - * + * * The `x` and `y` components contain the point of the intersection. * The `z` component contains the angle of the projected ray, in radians. * The `w` component contains the index of the polygon, in the given array, that triggered the intersection. @@ -76815,7 +75483,7 @@ declare namespace Phaser { /** * Checks if two Rectangles intersect and returns the intersection points as a Point object array. - * + * * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. As such, the two Rectangles are considered "solid". A Rectangle with no width or no height will never intersect another Rectangle. * @param rectA The first Rectangle to check for intersection. * @param rectB The second Rectangle to check for intersection. @@ -76836,7 +75504,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. - * + * * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. * @param triangle The Triangle to check for intersection. * @param circle The Circle to check for intersection. @@ -76847,7 +75515,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. - * + * * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * @param triangle The Triangle to check with. * @param line The Line to check with. @@ -76858,7 +75526,7 @@ declare namespace Phaser { /** * Checks if two Triangles intersect, and returns the intersection points as a Point object array. - * + * * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". * @param triangleA The first Triangle to check for intersection. * @param triangleB The second Triangle to check for intersection. @@ -76869,7 +75537,7 @@ declare namespace Phaser { /** * Checks for intersection between the line segment and circle. - * + * * Based on code by [Matt DesLauriers](https://github.com/mattdesl/line-circle-collision/blob/master/LICENSE.md). * @param line The line segment to check. * @param circle The circle to check against the line. @@ -76890,9 +75558,9 @@ declare namespace Phaser { /** * Checks for intersection between the Line and a Rectangle shape, or a rectangle-like * object, with public `x`, `y`, `right` and `bottom` properties, such as a Sprite or Body. - * + * * An intersection is considered valid if: - * + * * The line starts within, or ends within, the Rectangle. * The line segment intersects one of the 4 rectangle edges. * @@ -76924,7 +75592,7 @@ declare namespace Phaser { /** * Checks if two Rectangles intersect. - * + * * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. * As such, the two Rectangles are considered "solid". * A Rectangle with no width or no height will never intersect another Rectangle. @@ -76962,7 +75630,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Circle intersect. - * + * * A Circle intersects a Triangle if its center is located within it or if any of the Triangle's sides intersect the Circle. As such, the Triangle and the Circle are considered "solid" for the intersection. * @param triangle The Triangle to check for intersection. * @param circle The Circle to check for intersection. @@ -76972,7 +75640,7 @@ declare namespace Phaser { /** * Checks if a Triangle and a Line intersect. - * + * * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * @param triangle The Triangle to check with. * @param line The Line to check with. @@ -76982,7 +75650,7 @@ declare namespace Phaser { /** * Checks if two Triangles intersect. - * + * * A Triangle intersects another Triangle if any pair of their lines intersects or if any point of one Triangle is within the other Triangle. Thus, the Triangles are considered "solid". * @param triangleA The first Triangle to check for intersection. * @param triangleB The second Triangle to check for intersection. @@ -77069,9 +75737,9 @@ declare namespace Phaser { * * The amounts can be positive or negative. Positive values will increase the length of the line, * while negative ones will decrease it. - * + * * If no `right` value is provided it will extend the length of the line equally in both directions. - * + * * Pass a value of zero to leave the start or end point unchanged. * * The `left` value extends outward from the start point (x1, y1) along the line's direction, and the `right` value extends outward from the end point (x2, y2). @@ -77085,22 +75753,22 @@ declare namespace Phaser { /** * Returns an array of `quantity` Points where each point is taken from the given Line, * spaced out according to the ease function specified. - * + * * ```javascript * const line = new Phaser.Geom.Line(100, 300, 700, 300); * const points = Phaser.Geom.Line.GetEasedPoints(line, 'sine.out', 32) * ``` - * + * * In the above example, the `points` array will contain 32 points spread-out across * the length of `line`, where the position of each point is determined by the `Sine.out` * ease function. - * + * * You can optionally provide a collinear threshold. In this case, the resulting points * are checked against each other, and if they are `< collinearThreshold` distance apart, * they are dropped from the results. This can help avoid lots of clustered points at * far ends of the line with tightly-packed eases such as Quartic. Leave the value set * to zero to skip this check. - * + * * Note that if you provide a collinear threshold, the resulting array may not always * contain `quantity` points. * @param line The Line object. @@ -77132,7 +75800,7 @@ declare namespace Phaser { /** * Calculate the normal of the given line. - * + * * The normal of a line is a vector that points perpendicular from it. * @param line The line to calculate the normal of. * @param out An optional Vector2 object to store the normal in. @@ -77154,10 +75822,10 @@ declare namespace Phaser { * The last endpoint (x2, y2) is not included in the returned points. * * Provide a `quantity` to get an exact number of points along the line. - * + * * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when * providing a `stepRate`. - * + * * See also `GetEasedPoints` for a way to distribute the points across the line according to an ease type or input function. * @param line The line. * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. @@ -77227,9 +75895,9 @@ declare namespace Phaser { /** * Get a number of points along a line's length. - * + * * Provide a `quantity` to get an exact number of points along the line. - * + * * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when * providing a `stepRate`. * @param quantity The number of points to place on the line. Set to `0` to use `stepRate` instead. @@ -77425,7 +76093,7 @@ declare namespace Phaser { */ class Polygon { /** - * + * * @param points List of points defining the perimeter of this Polygon. Several formats are supported: * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` @@ -77463,43 +76131,43 @@ declare namespace Phaser { * This module implements a modified ear slicing algorithm, optimized by z-order curve hashing and extended to * handle holes, twisted polygons, degeneracies and self-intersections in a way that doesn't guarantee correctness * of triangulation, but attempts to always produce acceptable results for practical data. - * + * * Example: - * + * * ```javascript * const triangles = Phaser.Geom.Polygon.Earcut([10,0, 0,50, 60,60, 70,10]); // returns [1,0,3, 3,2,1] * ``` - * + * * Each group of three vertex indices in the resulting array forms a triangle. - * + * * ```javascript * // triangulating a polygon with a hole * earcut([0,0, 100,0, 100,100, 0,100, 20,20, 80,20, 80,80, 20,80], [4]); * // [3,0,4, 5,4,0, 3,4,7, 5,0,1, 2,3,7, 6,5,1, 2,7,6, 6,1,2] - * + * * // triangulating a polygon with 3d coords * earcut([10,0,1, 0,50,2, 60,60,3, 70,10,4], null, 3); * // [1,0,3, 3,2,1] * ``` - * + * * If you pass a single vertex as a hole, Earcut treats it as a Steiner point. - * + * * If your input is a multi-dimensional array (e.g. GeoJSON Polygon), you can convert it to the format * expected by Earcut with `Phaser.Geom.Polygon.Earcut.flatten`: - * + * * ```javascript * var data = earcut.flatten(geojson.geometry.coordinates); * var triangles = earcut(data.vertices, data.holes, data.dimensions); * ``` - * + * * After getting a triangulation, you can verify its correctness with `Phaser.Geom.Polygon.Earcut.deviation`: - * + * * ```javascript * var deviation = earcut.deviation(vertices, holes, dimensions, triangles); * ``` * Returns the relative difference between the total area of triangles and the area of the input polygon. * 0 means the triangulation is fully correct. - * + * * For more information see https://github.com/mapbox/earcut * @param data A flat array of vertex coordinates, like [x0,y0, x1,y1, x2,y2, ...] * @param holeIndices An array of hole indices if any (e.g. [5, 8] for a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11). @@ -77572,15 +76240,15 @@ declare namespace Phaser { /** * Sets this Polygon to the given points. - * + * * The points can be set from a variety of formats: - * + * * - A string containing paired values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x/y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` - * + * * `setTo` may also be called without any arguments to remove all points. * @param points Points defining the perimeter of this polygon. Please check function description above for the different supported formats. * @returns This Polygon object. @@ -77660,7 +76328,7 @@ declare namespace Phaser { */ class Rectangle { /** - * + * * @param x The X coordinate of the top left corner of the Rectangle. Default 0. * @param y The Y coordinate of the top left corner of the Rectangle. Default 0. * @param width The width of the Rectangle. Default 0. @@ -77764,7 +76432,7 @@ declare namespace Phaser { * Adjusts the target rectangle, changing its width, height and position, * so that it fits inside the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitOutside` function, there may be some space inside the source area not covered. * @param target The target rectangle to adjust. * @param source The source rectangle to envelop the target in. @@ -77776,7 +76444,7 @@ declare namespace Phaser { * Adjusts the target rectangle, changing its width, height and position, * so that it fully covers the area of the source rectangle, while maintaining its original * aspect ratio. - * + * * Unlike the `FitInside` function, the target rectangle may extend further out than the source. * @param target The target rectangle to adjust. * @param source The source rectangle to envelope the target in. @@ -77802,7 +76470,7 @@ declare namespace Phaser { * Constructs a new Rectangle or repositions and resizes an existing Rectangle so that all of the given points are on or within its bounds. * * The `points` parameter is an array of Point-like objects: - * + * * ```js * const points = [ * [100, 200], @@ -77844,9 +76512,9 @@ declare namespace Phaser { /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * @param rectangle The Rectangle to get the perimeter point from. * @param position The normalized distance into the Rectangle's perimeter to return. @@ -77876,7 +76544,7 @@ declare namespace Phaser { /** * Increases the size of a Rectangle by a specified amount. - * + * * The center of the Rectangle stays the same. The amounts are added to each side, so the actual increase in width or height is two times bigger than the respective argument. * @param rect The Rectangle to inflate. * @param x How many pixels the left and the right side should be moved by horizontally. @@ -78035,9 +76703,9 @@ declare namespace Phaser { /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * + * * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * + * * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. * @param position The normalized distance into the Rectangle's perimeter to return. * @param output A Vector2 instance to update with the `x` and `y` coordinates of the point. @@ -78200,7 +76868,7 @@ declare namespace Phaser { */ class Triangle { /** - * + * * @param x1 `x` coordinate of the first point. Default 0. * @param y1 `y` coordinate of the first point. Default 0. * @param x2 `x` coordinate of the second point. Default 0. @@ -78261,7 +76929,7 @@ declare namespace Phaser { /** * Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity). - * + * * The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio. * @param triangle The Triangle to use. * @param out A Vector2 object to store the coordinates in. @@ -80115,707 +78783,707 @@ declare namespace Phaser { namespace Events { /** * The Input Plugin Boot Event. - * + * * This internal event is dispatched by the Input Plugin when it boots, signalling to all of its systems to create themselves. */ - const BOOT: string; + const BOOT: 'boot'; /** * The Input Plugin Destroy Event. - * + * * This internal event is dispatched by the Input Plugin when it is destroyed, signalling to all of its systems to destroy themselves. */ - const DESTROY: string; + const DESTROY: 'destroy'; /** * The Pointer Drag End Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer stops dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragend', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_END]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_END} event instead. */ - const DRAG_END: string; + const DRAG_END: 'dragend'; /** * The Pointer Drag Enter Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object into a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragenter', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_ENTER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_ENTER} event instead. */ - const DRAG_ENTER: string; + const DRAG_ENTER: 'dragenter'; /** * The Pointer Drag Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves while dragging a Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('drag', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG} event instead. */ - const DRAG: string; + const DRAG: 'drag'; /** * The Pointer Drag Leave Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object out of a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('dragleave', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_LEAVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_LEAVE} event instead. */ - const DRAG_LEAVE: string; + const DRAG_LEAVE: 'dragleave'; /** * The Pointer Drag Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drags a Game Object over a Drag Target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from within a Scene using: `this.input.on('dragover', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_OVER} event instead. */ - const DRAG_OVER: string; + const DRAG_OVER: 'dragover'; /** * The Pointer Drag Start Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer starts to drag any Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('dragstart', listener)`. - * + * * A Pointer can only drag a single Game Object at once. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DRAG_START]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DRAG_START} event instead. */ - const DRAG_START: string; + const DRAG_START: 'dragstart'; /** * The Pointer Drop Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer drops a Game Object on a Drag Target. - * + * * Listen to this event from within a Scene using: `this.input.on('drop', listener)`. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_DROP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DROP} event instead. */ - const DROP: string; + const DROP: 'drop'; /** * The Game Object Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down on _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectdown', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_DOWN: string; + const GAMEOBJECT_DOWN: 'gameobjectdown'; /** * The Game Object Drag End Event. - * + * * This event is dispatched by an interactive Game Object if a pointer stops dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragend', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive](Phaser.GameObjects.GameObject#setInteractive) for more details. */ - const GAMEOBJECT_DRAG_END: string; + const GAMEOBJECT_DRAG_END: 'dragend'; /** * The Game Object Drag Enter Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it into a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragenter', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ - const GAMEOBJECT_DRAG_ENTER: string; + const GAMEOBJECT_DRAG_ENTER: 'dragenter'; /** * The Game Object Drag Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves while dragging it. - * + * * Listen to this event from a Game Object using: `gameObject.on('drag', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ - const GAMEOBJECT_DRAG: string; + const GAMEOBJECT_DRAG: 'drag'; /** * The Game Object Drag Leave Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it out of a drag target. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragleave', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ - const GAMEOBJECT_DRAG_LEAVE: string; + const GAMEOBJECT_DRAG_LEAVE: 'dragleave'; /** * The Game Object Drag Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drags it over a drag target. - * + * * When the Game Object first enters the drag target it will emit a `dragenter` event. If it then moves while within * the drag target, it will emit this event instead. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ - const GAMEOBJECT_DRAG_OVER: string; + const GAMEOBJECT_DRAG_OVER: 'dragover'; /** * The Game Object Drag Start Event. - * + * * This event is dispatched by an interactive Game Object if a pointer starts to drag it. - * + * * Listen to this event from a Game Object using: `gameObject.on('dragstart', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * There are lots of useful drag related properties that are set within the Game Object when dragging occurs. * For example, `gameObject.input.dragStartX`, `dragStartY` and so on. */ - const GAMEOBJECT_DRAG_START: string; + const GAMEOBJECT_DRAG_START: 'dragstart'; /** * The Game Object Drop Event. - * + * * This event is dispatched by an interactive Game Object if a pointer drops it on a Drag Target. - * + * * Listen to this event from a Game Object using: `gameObject.on('drop', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive and enabled for drag. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. */ - const GAMEOBJECT_DROP: string; + const GAMEOBJECT_DROP: 'drop'; /** * The Game Object Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved across _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectmove', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_MOVE: string; + const GAMEOBJECT_MOVE: 'gameobjectmove'; /** * The Game Object Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectout', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * If the pointer leaves the game canvas itself, it will not trigger this event. To handle those cases, * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. */ - const GAMEOBJECT_OUT: string; + const GAMEOBJECT_OUT: 'gameobjectout'; /** * The Game Object Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectover', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_OVER: string; + const GAMEOBJECT_OVER: 'gameobjectover'; /** * The Game Object Pointer Down Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is pressed down on it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerdown', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_POINTER_DOWN: string; + const GAMEOBJECT_POINTER_DOWN: 'pointerdown'; /** * The Game Object Pointer Move Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointermove', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_POINTER_MOVE: string; + const GAMEOBJECT_POINTER_MOVE: 'pointermove'; /** * The Game Object Pointer Out Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves out of it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerout', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * If the pointer leaves the game canvas itself, it will not trigger this event. To handle those cases, * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. */ - const GAMEOBJECT_POINTER_OUT: string; + const GAMEOBJECT_POINTER_OUT: 'pointerout'; /** * The Game Object Pointer Over Event. - * + * * This event is dispatched by an interactive Game Object if a pointer moves over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerover', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_POINTER_OVER: string; + const GAMEOBJECT_POINTER_OVER: 'pointerover'; /** * The Game Object Pointer Up Event. - * + * * This event is dispatched by an interactive Game Object if a pointer is released while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('pointerup', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_POINTER_UP: string; + const GAMEOBJECT_POINTER_UP: 'pointerup'; /** * The Game Object Pointer Wheel Event. - * + * * This event is dispatched by an interactive Game Object if a pointer has its wheel moved while over it. - * + * * Listen to this event from a Game Object using: `gameObject.on('wheel', listener)`. * Note that the scope of the listener is automatically set to be the Game Object instance itself. - * + * * To receive this event, the Game Object must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_POINTER_WHEEL: string; + const GAMEOBJECT_POINTER_WHEEL: 'wheel'; /** * The Game Object Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectup', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_UP: string; + const GAMEOBJECT_UP: 'gameobjectup'; /** * The Game Object Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel moved while over _any_ interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('gameobjectwheel', listener)`. - * + * * To receive this event, the Game Objects must have been set as interactive. * See [GameObject.setInteractive]{@link Phaser.GameObjects.GameObject#setInteractive} for more details. - * + * * To listen for this event from a _specific_ Game Object, use the [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} event instead. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const GAMEOBJECT_WHEEL: string; + const GAMEOBJECT_WHEEL: 'gameobjectwheel'; /** * The Input Plugin Game Out Event. - * + * * This event is dispatched by the Input Plugin if the active pointer leaves the game canvas and is now * outside of it, elsewhere on the web page. - * + * * Listen to this event from within a Scene using: `this.input.on('gameout', listener)`. */ - const GAME_OUT: string; + const GAME_OUT: 'gameout'; /** * The Input Plugin Game Over Event. - * + * * This event is dispatched by the Input Plugin if the active pointer enters the game canvas and is now * over it, having previously been elsewhere on the web page. * * Listen to this event from within a Scene using: `this.input.on('gameover', listener)`. */ - const GAME_OVER: string; + const GAME_OVER: 'gameover'; /** * The Input Manager Boot Event. - * + * * This internal event is dispatched by the Input Manager when it boots. */ - const MANAGER_BOOT: string; + const MANAGER_BOOT: 'boot'; /** * The Input Manager Process Event. - * + * * This internal event is dispatched by the Input Manager when not using the legacy queue system, * and it wants the Input Plugins to update themselves. */ - const MANAGER_PROCESS: string; + const MANAGER_PROCESS: 'process'; /** * The Input Manager Update Event. - * + * * This internal event is dispatched by the Input Manager as part of its update step. */ - const MANAGER_UPDATE: string; + const MANAGER_UPDATE: 'update'; /** * The Input Manager Pointer Lock Change Event. - * + * * This event is dispatched by the Input Manager when it is processing a native Pointer Lock Change DOM Event. */ - const POINTERLOCK_CHANGE: string; + const POINTERLOCK_CHANGE: 'pointerlockchange'; /** * The Pointer Down Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdown', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const POINTER_DOWN: string; + const POINTER_DOWN: 'pointerdown'; /** * The Pointer Down Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is pressed down anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerdownoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_DOWN} * 2. [GAMEOBJECT_DOWN]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_DOWN} * 3. [POINTER_DOWN]{@linkcode Phaser.Input.Events#event:POINTER_DOWN} or [POINTER_DOWN_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_DOWN_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const POINTER_DOWN_OUTSIDE: string; + const POINTER_DOWN_OUTSIDE: 'pointerdownoutside'; /** * The Pointer Move Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is moved anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointermove', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_MOVE} * 2. [GAMEOBJECT_MOVE]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_MOVE} * 3. [POINTER_MOVE]{@linkcode Phaser.Input.Events#event:POINTER_MOVE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const POINTER_MOVE: string; + const POINTER_MOVE: 'pointermove'; /** * The Pointer Out Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves out of any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerout', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OUT} * 2. [GAMEOBJECT_OUT]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OUT} * 3. [POINTER_OUT]{@linkcode Phaser.Input.Events#event:POINTER_OUT} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. * * If the pointer leaves the game canvas itself, it will not trigger this event. To handle those cases, * please listen for the [GAME_OUT]{@linkcode Phaser.Input.Events#event:GAME_OUT} event. */ - const POINTER_OUT: string; + const POINTER_OUT: 'pointerout'; /** * The Pointer Over Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer moves over any interactive Game Object. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerover', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_OVER} * 2. [GAMEOBJECT_OVER]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_OVER} * 3. [POINTER_OVER]{@linkcode Phaser.Input.Events#event:POINTER_OVER} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const POINTER_OVER: string; + const POINTER_OVER: 'pointerover'; /** * The Pointer Up Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerup', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const POINTER_UP: string; + const POINTER_UP: 'pointerup'; /** * The Pointer Up Outside Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer is released anywhere outside of the game canvas. - * + * * Listen to this event from within a Scene using: `this.input.on('pointerupoutside', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_UP} * 2. [GAMEOBJECT_UP]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_UP} * 3. [POINTER_UP]{@linkcode Phaser.Input.Events#event:POINTER_UP} or [POINTER_UP_OUTSIDE]{@linkcode Phaser.Input.Events#event:POINTER_UP_OUTSIDE} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const POINTER_UP_OUTSIDE: string; + const POINTER_UP_OUTSIDE: 'pointerupoutside'; /** * The Pointer Wheel Input Event. - * + * * This event is dispatched by the Input Plugin belonging to a Scene if a pointer has its wheel updated. - * + * * Listen to this event from within a Scene using: `this.input.on('wheel', listener)`. - * + * * The event hierarchy is as follows: - * + * * 1. [GAMEOBJECT_POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_POINTER_WHEEL} * 2. [GAMEOBJECT_WHEEL]{@linkcode Phaser.Input.Events#event:GAMEOBJECT_WHEEL} * 3. [POINTER_WHEEL]{@linkcode Phaser.Input.Events#event:POINTER_WHEEL} - * + * * With the top event being dispatched first and then flowing down the list. Note that higher-up event handlers can stop * the propagation of this event. */ - const POINTER_WHEEL: string; + const POINTER_WHEEL: 'wheel'; /** * The Input Plugin Pre-Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `preUpdate` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. */ - const PRE_UPDATE: string; + const PRE_UPDATE: 'preupdate'; /** * The Input Plugin Shutdown Event. - * + * * This internal event is dispatched by the Input Plugin when it shuts down, signalling to all of its systems to shut themselves down. */ - const SHUTDOWN: string; + const SHUTDOWN: 'shutdown'; /** * The Input Plugin Start Event. - * + * * This internal event is dispatched by the Input Plugin when it has finished setting-up, * signalling to all of its internal systems to start. */ - const START: string; + const START: 'start'; /** * The Input Plugin Update Event. - * + * * This internal event is dispatched by the Input Plugin at the start of its `update` method. * This hook is designed specifically for input plugins, but can also be listened to from user-land code. */ - const UPDATE: string; + const UPDATE: 'update'; } @@ -80828,7 +79496,7 @@ declare namespace Phaser { */ class Axis { /** - * + * * @param pad A reference to the Gamepad that this Axis belongs to. * @param index The index of this Axis. */ @@ -80883,7 +79551,7 @@ declare namespace Phaser { */ class Button { /** - * + * * @param pad A reference to the Gamepad that this Button belongs to. * @param index The index of this Button. * @param isPressed Whether or not the button is already being pressed at creation time. This prevents the Button from emitting spurious 'down' events at first update. Default false. @@ -80937,98 +79605,82 @@ declare namespace Phaser { * buttons via the `buttons` array, and axes via the `axes` array. Gamepads are typically * accessed through `this.input.gamepad.pad1` through `pad4` in a Scene. */ - class KeyboardManager { + class Gamepad extends Phaser.Events.EventEmitter { /** - * - * @param inputManager A reference to the Input Manager. + * + * @param manager A reference to the Gamepad Plugin. + * @param pad The Gamepad object, as extracted from GamepadEvent. */ - constructor(inputManager: Phaser.Input.InputManager); + constructor(manager: Phaser.Input.Gamepad.GamepadPlugin, pad: Phaser.Types.Input.Gamepad.Pad); /** - * A reference to the Input Manager. + * A reference to the Gamepad Plugin. */ - manager: Phaser.Input.InputManager; + manager: Phaser.Input.Gamepad.GamepadPlugin; /** - * A flag that controls if the non-modified keys, matching those stored in the `captures` array, - * have `preventDefault` called on them or not. - * - * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are - * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). - * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. - * However, if the user presses just the r key on its own, it will have its event prevented. - * - * If you wish to stop capturing the keys, for example switching out to a DOM based element, then - * you can toggle this property at run-time. + * A reference to the native Gamepad object that is connected to the browser. */ - preventDefault: boolean; + pad: any; /** - * An array of Key Code values that will automatically have `preventDefault` called on them, - * as long as the `KeyboardManager.preventDefault` boolean is set to `true`. - * - * By default the array is empty. - * - * The key must be non-modified when pressed in order to be captured. - * - * A non-modified key is one that doesn't have a modifier key held down with it. The modifier keys are - * shift, control, alt and the meta key (Command on a Mac, the Windows Key on Windows). - * Therefore, if the user presses shift + r, it won't prevent this combination, because of the modifier. - * However, if the user presses just the r key on its own, it will have its event prevented. - * - * If you wish to stop capturing the keys, for example switching out to a DOM based element, then - * you can toggle the `KeyboardManager.preventDefault` boolean at run-time. - * - * If you need more specific control, you can create Key objects and set the flag on each of those instead. - * - * This array can be populated via the Game Config by setting the `input.keyboard.capture` array, or you - * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. + * A string containing some information about the controller. + * + * This is not strictly specified, but in Firefox it will contain three pieces of information + * separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and + * product id of the controller, and the name of the controller as provided by the driver. + * In Chrome it will contain the name of the controller as provided by the driver, + * followed by vendor and product 4-digit hexadecimal strings. */ - captures: number[]; + id: string; /** - * A boolean that controls if the Keyboard Manager is enabled or not. - * Can be toggled on the fly. + * An integer that is unique for each Gamepad currently connected to the system. + * This can be used to distinguish multiple controllers. + * Note that disconnecting a device and then connecting a new device may reuse the previous index. */ - enabled: boolean; + index: number; /** - * The Keyboard Event target, as defined in the Game Config. - * Typically the window in which the game is rendering, but can be any interactive DOM element. + * An array of Gamepad Button objects, corresponding to the different buttons available on the Gamepad. */ - target: any; + buttons: Phaser.Input.Gamepad.Button[]; /** - * The Key Down Event handler. - * This function is sent the native DOM KeyEvent. - * Initially empty and bound in the `startListeners` method. + * An array of Gamepad Axis objects, corresponding to the different axes available on the Gamepad, if any. */ - onKeyDown: Function; + axes: Phaser.Input.Gamepad.Axis[]; /** - * The Key Up Event handler. - * This function is sent the native DOM KeyEvent. - * Initially empty and bound in the `startListeners` method. + * The Gamepad's Haptic Actuator (Vibration / Rumble support). + * This is highly experimental and only set if both present on the device, + * and exposed by both the hardware and browser. */ - onKeyUp: Function; + vibration: GamepadHapticActuator; /** - * Starts the Keyboard Event listeners running. - * This is called automatically and does not need to be manually invoked. + * A Vector2 containing the most recent values from the Gamepad's left axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a left axis stick, the values will always be zero. */ - startListeners(): void; + leftStick: Phaser.Math.Vector2; /** - * Stops the Key Event listeners. - * This is called automatically and does not need to be manually invoked. + * A Vector2 containing the most recent values from the Gamepad's right axis stick. + * This is updated automatically as part of the Gamepad.update cycle. + * The H Axis is mapped to the `Vector2.x` property, and the V Axis to the `Vector2.y` property. + * The values are based on the Axis thresholds. + * If the Gamepad does not have a right axis stick, the values will always be zero. */ - stopListeners(): void; + rightStick: Phaser.Math.Vector2; /** * Gets the total number of axis this Gamepad claims to support.undefined * @returns The total number of axes this Gamepad claims to support. */ - addCapture(keycode: string | number | number[] | any[]): void; + getAxisTotal(): number; /** * Gets the value of an axis based on the given index. @@ -81037,12 +79689,14 @@ declare namespace Phaser { * @param index The index of the axes to get the value for. * @returns The value of the axis, between -1 and 1. */ - removeCapture(keycode: string | number | number[] | any[]): void; + getAxisValue(index: number): number; /** - * Removes all keyboard captures and sets the `preventDefault` property to `false`. + * Sets the threshold value of all axis on this Gamepad. + * The value is a float between 0 and 1 and is the amount below which the axis is considered as not having been moved. + * @param value A value between 0 and 1. */ - clearCaptures(): void; + setAxisThreshold(value: number): void; /** * Gets the total number of buttons this Gamepad claims to have.undefined @@ -81074,57 +79728,158 @@ declare namespace Phaser { */ destroy(): void; + /** + * Is this Gamepad currently connected or not? + */ + connected: boolean; + + /** + * A timestamp containing the most recent time this Gamepad was updated. + */ + timestamp: number; + + /** + * Is the Gamepad's Left button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad left button under standard Gamepad mapping. + */ + left: boolean; + + /** + * Is the Gamepad's Right button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad right button under standard Gamepad mapping. + */ + right: boolean; + + /** + * Is the Gamepad's Up button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad up button under standard Gamepad mapping. + */ + up: boolean; + + /** + * Is the Gamepad's Down button being pressed? + * If the Gamepad doesn't have this button it will always return false. + * This is the d-pad down button under standard Gamepad mapping. + */ + down: boolean; + + /** + * Is the Gamepad's bottom button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the X button. + * On an XBox controller it's the A button. + */ + A: boolean; + + /** + * Is the Gamepad's top button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Triangle button. + * On an XBox controller it's the Y button. + */ + Y: boolean; + + /** + * Is the Gamepad's left button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Square button. + * On an XBox controller it's the X button. + */ + X: boolean; + + /** + * Is the Gamepad's right button in the right button cluster being pressed? + * If the Gamepad doesn't have this button it will always return false. + * On a Dual Shock controller it's the Circle button. + * On an XBox controller it's the B button. + */ + B: boolean; + + /** + * Returns the value of the Gamepad's top left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L1 button. + * On an XBox controller it's the LB button. + */ + L1: number; + + /** + * Returns the value of the Gamepad's bottom left shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the L2 button. + * On an XBox controller it's the LT button. + */ + L2: number; + + /** + * Returns the value of the Gamepad's top right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R1 button. + * On an XBox controller it's the RB button. + */ + R1: number; + + /** + * Returns the value of the Gamepad's bottom right shoulder button. + * If the Gamepad doesn't have this button it will always return zero. + * The value is a float between 0 and 1, corresponding to how depressed the button is. + * On a Dual Shock controller it's the R2 button. + * On an XBox controller it's the RT button. + */ + R2: number; + } /** - * The Keyboard Plugin is an input plugin that belongs to the Scene-owned Input system. - * - * Its role is to listen for native DOM Keyboard Events and then process them. - * + * The Gamepad Plugin is an input plugin that belongs to the Scene-owned Input system. + * + * Its role is to listen for native DOM Gamepad Events and then process them. + * * You do not need to create this class directly, the Input system will create an instance of it automatically. - * - * You can access it from within a Scene using `this.input.keyboard`. For example, you can do: - * - * ```javascript - * this.input.keyboard.on('keydown', callback, context); - * ``` - * - * Or, to listen for a specific key: - * - * ```javascript - * this.input.keyboard.on('keydown-A', callback, context); - * ``` - * - * You can also create Key objects, which you can then poll in your game loop: - * + * + * You can access it from within a Scene using `this.input.gamepad`. + * + * To listen for a gamepad being connected: + * * ```javascript - * var spaceBar = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.SPACE); + * this.input.gamepad.once('connected', function (pad) { + * // 'pad' is a reference to the gamepad that was just connected + * }); * ``` - * - * If you have multiple parallel Scenes, each trying to get keyboard input, be sure to disable capture on them to stop them from - * stealing input from another Scene in the list. You can do this with `this.input.keyboard.enabled = false` within the - * Scene to stop all input, or `this.input.keyboard.preventDefault = false` to stop a Scene halting input on another Scene. - * - * _Note_: Many keyboards are unable to process certain combinations of keys due to hardware limitations known as ghosting. - * See http://www.html5gamedevs.com/topic/4876-impossible-to-use-more-than-2-keyboard-input-buttons-at-the-same-time/ for more details - * and use the site https://w3c.github.io/uievents/tools/key-event-viewer.html to test your n-key support in browser. - * - * Also please be aware that certain browser extensions can disable or override Phaser keyboard handling. - * For example the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. - * And there are others. So, please check your extensions before opening Phaser issues about keys that don't work. + * + * Note that the browser may require you to press a button on a gamepad before it will allow you to access it, + * this is for security reasons. However, it may also trust the page already, in which case you won't get the + * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads + * already connected. + * + * Once you have received the connected event, or polled the gamepads and found them enabled, you can access + * them via the built-in properties `GamepadPlugin.pad1` to `pad4`, for up to 4 game pads. With a reference + * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on + * the `Gamepad` class for more details. + * + * As of September 2020 Chrome, and likely other browsers, will soon start to require that games requesting + * access to the Gamepad API are running under SSL. They will actively block API access if they are not. + * + * For more information about Gamepad support in browsers see the following resources: + * + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API + * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API + * https://www.smashingmagazine.com/2015/11/gamepad-api-in-web-games/ + * http://html5gamepad.com/ */ - class KeyboardPlugin extends Phaser.Events.EventEmitter { + class GamepadPlugin extends Phaser.Events.EventEmitter { /** * * @param sceneInputPlugin A reference to the Scene Input Plugin that the GamepadPlugin belongs to. */ constructor(sceneInputPlugin: Phaser.Input.InputPlugin); - /** - * A reference to the core game, so we can listen for visibility events. - */ - game: Phaser.Game; - /** * A reference to the Scene that this Input Plugin is responsible for. */ @@ -81141,25 +79896,21 @@ declare namespace Phaser { sceneInputPlugin: Phaser.Input.InputPlugin; /** - * A reference to the global Keyboard Manager. - */ - manager: Phaser.Input.Keyboard.KeyboardManager; - - /** - * A boolean that controls if this Keyboard Plugin is enabled or not. + * A boolean that controls if the Gamepad Manager is enabled or not. * Can be toggled on the fly. */ enabled: boolean; /** - * An array of Key objects to process. + * The Gamepad Event target, as defined in the Game Config. + * Typically the browser window, but can be any interactive DOM element. */ - keys: Phaser.Input.Keyboard.Key[]; + target: any; /** - * An array of KeyCombo objects to process. + * An array of the connected Gamepads. */ - combos: Phaser.Input.Keyboard.KeyCombo[]; + gamepads: Phaser.Input.Gamepad.Gamepad[]; /** * Checks to see if both this plugin and the Scene to which it belongs is active.undefined @@ -81168,58 +79919,27 @@ declare namespace Phaser { isActive(): boolean; /** - * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. - * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. - * - * This `addCapture` method enables consuming keyboard events for specific keys, so they don't bubble up the browser - * and cause the default behaviors. - * - * Please note that keyboard captures are global. This means that if you call this method from within a Scene, to say prevent - * the SPACE BAR from triggering a page scroll, then it will prevent it for any Scene in your game, not just the calling one. - * - * You can pass a single key code value: - * - * ```javascript - * this.input.keyboard.addCapture(62); - * ``` - * - * An array of key codes: - * - * ```javascript - * this.input.keyboard.addCapture([ 62, 63, 64 ]); - * ``` - * - * Or, a comma-delimited string: - * - * ```javascript - * this.input.keyboard.addCapture('W,S,A,D'); - * ``` - * - * To use non-alpha numeric keys, use a string, such as 'UP', 'SPACE' or 'LEFT'. - * - * You can also provide an array mixing both strings and key code integers. - * @param keycode The Key Codes to enable event capture for. + * Disconnects all current Gamepads. */ - addCapture(keycode: string | number | number[] | any[]): this; + disconnectAll(): void; /** * Returns an array of all currently connected Gamepads.undefined * @returns An array of all currently connected Gamepads. */ - removeCapture(keycode: string | number | number[] | any[]): this; + getAll(): Phaser.Input.Gamepad.Gamepad[]; /** * Looks up a single Gamepad based on the given index value. * @param index The index of the Gamepad to get. * @returns The Gamepad matching the given index, or undefined if none were found. */ - getCaptures(): number[]; + getPad(index: number): Phaser.Input.Gamepad.Gamepad; /** - * Allows Phaser to prevent any key captures you may have defined from bubbling up the browser. - * You can use this to re-enable event capturing if you had paused it via `disableGlobalCapture`. + * The total number of connected game pads. */ - enableGlobalCapture(): this; + total: number; /** * A reference to the first connected Gamepad. @@ -81228,7 +79948,7 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - disableGlobalCapture(): this; + pad1: Phaser.Input.Gamepad.Gamepad; /** * A reference to the second connected Gamepad. @@ -81237,7 +79957,7 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - clearCaptures(): this; + pad2: Phaser.Input.Gamepad.Gamepad; /** * A reference to the third connected Gamepad. @@ -81246,7 +79966,7 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - createCursorKeys(): Phaser.Types.Input.Keyboard.CursorKeys; + pad3: Phaser.Input.Gamepad.Gamepad; /** * A reference to the fourth connected Gamepad. @@ -81255,93 +79975,7 @@ declare namespace Phaser { * has not yet issued a gamepadconnected, which can happen even if a Gamepad * is plugged in, but hasn't yet had any buttons pressed on it. */ - addKeys(keys: object | string, enableCapture?: boolean, emitOnRepeat?: boolean): object; - - /** - * Adds a Key object to this Keyboard Plugin. - * - * The given argument can be either an existing Key object, a string, such as `A` or `SPACE`, or a key code value. - * - * If a Key object is given, and one already exists matching the same key code, the existing one is replaced with the new one. - * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. - * @param enableCapture Automatically call `preventDefault` on the native DOM browser event for the key codes being added. Default true. - * @param emitOnRepeat Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). Default false. - */ - addKey(key: Phaser.Input.Keyboard.Key | string | number, enableCapture?: boolean, emitOnRepeat?: boolean): Phaser.Input.Keyboard.Key; - - /** - * Removes a Key object from this Keyboard Plugin. - * - * The given argument can be either a Key object, a string, such as `A` or `SPACE`, or a key code value. - * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. - * @param destroy Call `Key.destroy` on the removed Key object? Default false. - * @param removeCapture Remove this Key from being captured? Only applies if set to capture when created. Default false. - */ - removeKey(key: Phaser.Input.Keyboard.Key | string | number, destroy?: boolean, removeCapture?: boolean): this; - - /** - * Removes all Key objects created by _this_ Keyboard Plugin. - * @param destroy Call `Key.destroy` on each removed Key object? Default false. - * @param removeCapture Remove all key captures for Key objects owened by this plugin? Default false. - */ - removeAllKeys(destroy?: boolean, removeCapture?: boolean): this; - - /** - * Creates a new KeyCombo. - * - * A KeyCombo will listen for a specific string of keys from the Keyboard, and when it receives them - * it will emit a `keycombomatch` event from this Keyboard Plugin. - * - * The keys to be listened for can be defined as: - * - * A string (i.e. 'ATARI') - * An array of either integers (key codes) or strings, or a mixture of both - * An array of objects (such as Key objects) with a public 'keyCode' property - * - * For example, to listen for the Konami code (up, up, down, down, left, right, left, right, b, a, enter) - * you could pass the following array of key codes: - * - * ```javascript - * this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true }); - * - * this.input.keyboard.on('keycombomatch', function (event) { - * console.log('Konami Code entered!'); - * }); - * ``` - * - * Or, to listen for the user entering the word PHASER: - * - * ```javascript - * this.input.keyboard.createCombo('PHASER'); - * ``` - * @param keys The keys that comprise this combo. - * @param config A Key Combo configuration object. - */ - createCombo(keys: string | number[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig): Phaser.Input.Keyboard.KeyCombo; - - /** - * Checks if the given Key object is currently being held down. - * - * The difference between this method and checking the `Key.isDown` property directly is that you can provide - * a duration to this method. For example, if you wanted a key press to fire a bullet, but you only wanted - * it to be able to fire every 100ms, then you can call this method with a `duration` of 100 and it - * will only return `true` every 100ms. - * - * If the Keyboard Plugin has been disabled, this method will always return `false`. - * @param key A Key object. - * @param duration The duration which must have elapsed before this Key is considered as being down. Default 0. - */ - checkDown(key: Phaser.Input.Keyboard.Key, duration?: number): boolean; - - /** - * Resets all Key objects created by _this_ Keyboard Plugin back to their default un-pressed states. - * This can only reset keys created via the `addKey`, `addKeys` or `createCursorKeys` methods. - * If you have created a Key object directly you'll need to reset it yourself. - * - * This method is called automatically when the Keyboard Plugin shuts down, but can be - * invoked directly at any time you require. - */ - resetKeys(): this; + pad4: Phaser.Input.Gamepad.Gamepad; } @@ -81667,7 +80301,7 @@ declare namespace Phaser { * * You can also listen for a DOWN event from a Gamepad instance. See the [GAMEPAD_BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_DOWN} event for details. */ - const BUTTON_DOWN: string; + const BUTTON_DOWN: 'down'; /** * The Gamepad Button Up Event. @@ -81678,7 +80312,7 @@ declare namespace Phaser { * * You can also listen for an UP event from a Gamepad instance. See the [GAMEPAD_BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:GAMEPAD_BUTTON_UP} event for details. */ - const BUTTON_UP: string; + const BUTTON_UP: 'up'; /** * The Gamepad Connected Event. @@ -81692,7 +80326,7 @@ declare namespace Phaser { * 'connected' event and instead should check `GamepadPlugin.total` to see if it thinks there are any gamepads * already connected. */ - const CONNECTED: string; + const CONNECTED: 'connected'; /** * The Gamepad Disconnected Event. @@ -81701,7 +80335,7 @@ declare namespace Phaser { * * Listen to this event from within a Scene using: `this.input.gamepad.once('disconnected', listener)`. */ - const DISCONNECTED: string; + const DISCONNECTED: 'disconnected'; /** * The Gamepad Button Down Event. @@ -81715,7 +80349,7 @@ declare namespace Phaser { * * You can also listen for a DOWN event from the Gamepad Plugin. See the [BUTTON_DOWN]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_DOWN} event for details. */ - const GAMEPAD_BUTTON_DOWN: string; + const GAMEPAD_BUTTON_DOWN: 'down'; /** * The Gamepad Button Up Event. @@ -81729,7 +80363,7 @@ declare namespace Phaser { * * You can also listen for an UP event from the Gamepad Plugin. See the [BUTTON_UP]{@linkcode Phaser.Input.Gamepad.Events#event:BUTTON_UP} event for details. */ - const GAMEPAD_BUTTON_UP: string; + const GAMEPAD_BUTTON_UP: 'up'; } @@ -82359,7 +80993,7 @@ declare namespace Phaser { * For example, the Chrome extension vimium is known to disable Phaser from using the D key, while EverNote disables the backtick key. * There are others. So, please check your extensions if you find you have specific keys that don't work. */ - const ANY_KEY_DOWN: string; + const ANY_KEY_DOWN: 'keydown'; /** * The Global Key Up Event. @@ -82372,7 +81006,7 @@ declare namespace Phaser { * * Finally, you can create Key objects, which you can also listen for events from. See [Keyboard.Events.UP]{@linkcode Phaser.Input.Keyboard.Events#event:UP} for details. */ - const ANY_KEY_UP: string; + const ANY_KEY_UP: 'keyup'; /** * The Key Combo Match Event. @@ -82389,7 +81023,7 @@ declare namespace Phaser { * }); * ``` */ - const COMBO_MATCH: string; + const COMBO_MATCH: 'keycombomatch'; /** * The Key Down Event. @@ -82406,7 +81040,7 @@ declare namespace Phaser { * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_DOWN]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_DOWN} for details. */ - const DOWN: string; + const DOWN: 'down'; /** * The Key Down Event. @@ -82462,7 +81096,7 @@ declare namespace Phaser { * * You can also create a generic 'global' listener. See [Keyboard.Events.ANY_KEY_UP]{@linkcode Phaser.Input.Keyboard.Events#event:ANY_KEY_UP} for details. */ - const UP: string; + const UP: 'up'; } @@ -82477,9 +81111,9 @@ declare namespace Phaser { /** * The justDown value allows you to test if this Key has just been pressed down or not. - * + * * When you check this value it will return `true` if the Key is down, otherwise `false`. - * + * * You can only call justDown once per key press. It will only return `true` once, until the Key is released and pressed down again. * This allows you to use it in situations where you want to check if this key is down without using an event, such as in a core game loop. * @param key The Key to check to see if it's just down or not. @@ -82489,9 +81123,9 @@ declare namespace Phaser { /** * The justUp value allows you to test if this Key has just been released or not. - * + * * When you check this value it will return `true` if the Key is up, otherwise `false`. - * + * * You can only call JustUp once per key release. It will only return `true` once, until the Key is pressed down and released again. * This allows you to use it in situations where you want to check if this key is up without using an event, such as in a core game loop. * @param key The Key to check to see if it's just up or not. @@ -82509,7 +81143,7 @@ declare namespace Phaser { */ class Key extends Phaser.Events.EventEmitter { /** - * + * * @param plugin The Keyboard Plugin instance that owns this Key object. * @param keyCode The keycode of this key. */ @@ -82590,7 +81224,7 @@ declare namespace Phaser { /** * When a key is held down should it continuously fire the `down` event each time it repeats? - * + * * By default it will emit the `down` event just once, but if you wish to receive the event * for each repeat as well, enable this property. */ @@ -82633,9 +81267,9 @@ declare namespace Phaser { /** * Returns the duration, in ms, that the Key has been held down for. - * + * * If the key is not currently down it will return zero. - * + * * To get the duration the Key was held down for in the previous up-down cycle, * use the `Key.duration` property value instead.undefined * @returns The duration, in ms, that the Key has been held down for if currently down. @@ -83168,14 +81802,14 @@ declare namespace Phaser { namespace Mouse { /** * The Mouse Manager is a helper class that belongs to the Input Manager. - * + * * Its role is to listen for native DOM Mouse Events and then pass them onto the Input Manager for further processing. - * + * * You do not need to create this class directly, the Input Manager will create an instance of it automatically. */ class MouseManager { /** - * + * * @param inputManager A reference to the Input Manager. */ constructor(inputManager: Phaser.Input.InputManager); @@ -83287,7 +81921,7 @@ declare namespace Phaser { /** * Are the event listeners hooked into `window.top` or `window`? - * + * * This is set during the `boot` sequence. If the browser does not have access to `window.top`, * such as in cross-origin iframe environments, this property gets set to `false` and the events * are hooked into `window` instead. @@ -83296,9 +81930,9 @@ declare namespace Phaser { /** * Attempts to disable the context menu from appearing if you right-click on the game canvas, or specified input target. - * + * * Works by listening for the `contextmenu` event and prevent defaulting it. - * + * * Use this if you need to enable right-button mouse support in your game, and the context * menu keeps getting in the way.undefined * @returns This Mouse Manager instance. @@ -83307,16 +81941,16 @@ declare namespace Phaser { /** * If the browser supports it, you can request that the pointer be locked to the browser window. - * + * * This is classically known as 'FPS controls', where the pointer can't leave the browser until * the user presses an exit key. - * + * * If the browser successfully enters a locked state, a `POINTER_LOCK_CHANGE_EVENT` will be dispatched, * from the games Input Manager, with an `isPointerLocked` property. - * + * * It is important to note that pointer lock can only be enabled after an 'engagement gesture', * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. - * + * * Note for Firefox: There is a bug in certain Firefox releases that cause native DOM events like * `mousemove` to fire continuously when in pointer lock mode. You can get around this by setting * `this.preventDefaultMove` to `false` in this class. You may also need to do the same for @@ -83356,14 +81990,14 @@ declare namespace Phaser { namespace Touch { /** * The Touch Manager is a helper class that belongs to the Input Manager. - * + * * Its role is to listen for native DOM Touch Events and then pass them onto the Input Manager for further processing. - * + * * You do not need to create this class directly, the Input Manager will create an instance of it automatically. */ class TouchManager { /** - * + * * @param inputManager A reference to the Input Manager. */ constructor(inputManager: Phaser.Input.InputManager); @@ -83434,7 +82068,7 @@ declare namespace Phaser { /** * Are the event listeners hooked into `window.top` or `window`? - * + * * This is set during the `boot` sequence. If the browser does not have access to `window.top`, * such as in cross-origin iframe environments, this property gets set to `false` and the events * are hooked into `window` instead. @@ -83453,7 +82087,7 @@ declare namespace Phaser { /** * Starts the Touch Event listeners running as long as an input target is set. - * + * * This method is called automatically if Touch Input is enabled in the game config, * which it is by default. However, you can call it manually should you need to * delay input capturing until later in the game. @@ -87119,7 +85753,7 @@ declare namespace Phaser { * * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them. */ - const ADD: string; + const ADD: 'addfile'; /** * The Loader Plugin Complete Event. @@ -87129,7 +85763,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.load.on('complete', listener)`. */ - const COMPLETE: string; + const COMPLETE: 'complete'; /** * The File Load Complete Event. @@ -87142,7 +85776,7 @@ declare namespace Phaser { * * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event. */ - const FILE_COMPLETE: string; + const FILE_COMPLETE: 'filecomplete'; /** * The File Load Complete Event. @@ -87189,7 +85823,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.load.on('loaderror', listener)`. */ - const FILE_LOAD_ERROR: string; + const FILE_LOAD_ERROR: 'loaderror'; /** * The File Load Event. @@ -87199,7 +85833,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.load.on('load', listener)`. */ - const FILE_LOAD: string; + const FILE_LOAD: 'load'; /** * The File Load Progress Event. @@ -87209,7 +85843,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`. */ - const FILE_PROGRESS: string; + const FILE_PROGRESS: 'fileprogress'; /** * The Loader Plugin Post Process Event. @@ -87222,7 +85856,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.load.on('postprocess', listener)`. */ - const POST_PROCESS: string; + const POST_PROCESS: 'postprocess'; /** * The Loader Plugin Progress Event. @@ -87231,7 +85865,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.load.on('progress', listener)`. */ - const PROGRESS: string; + const PROGRESS: 'progress'; /** * The Loader Plugin Start Event. @@ -87242,7 +85876,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.load.on('start', listener)`. */ - const START: string; + const START: 'start'; } @@ -88863,10 +87497,8 @@ declare namespace Phaser { */ class Matrix3 { /** - * A Smoother Step interpolation method. - * @param t The percentage of interpolation, between 0 and 1. - * @param min The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param max The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @param m Optional Matrix3 to copy values from. */ constructor(m?: Phaser.Math.Matrix3); @@ -93751,9 +92383,9 @@ declare namespace Phaser { namespace BitmapText { /** * The font data for an individual character of a Bitmap Font. - * + * * Describes the character's position, size, offset and kerning. - * + * * As of version 3.50 it also includes the WebGL texture uv data. */ type BitmapFontCharacterData = { @@ -93843,7 +92475,7 @@ declare namespace Phaser { /** * A single entry from the `BitmapTextSize` characters array. - * + * * The position and dimensions take the font size into account, * but are not translated into the local space of the Game Object itself. */ @@ -94423,11 +93055,11 @@ declare namespace Phaser { /** * The total number of objects created will be - * + * * key.length * frame.length * frameQuantity * (yoyo ? 2 : 1) * (1 + repeat) - * + * * If `max` is nonzero, then the total created will not exceed `max`. - * + * * `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used. */ type GroupCreateConfig = { @@ -96670,7 +95302,7 @@ declare namespace Phaser { /** * A Phaser Input Event Data object. - * + * * This object is passed to the registered event listeners and allows you to stop any further propagation. */ type EventData = { @@ -98957,22 +97589,22 @@ declare namespace Phaser { /** * An `Object` that specifies the collision filtering properties of this body. - * + * * Collisions between two bodies will obey the following rules: * - If the two bodies have the same non-zero value of `collisionFilter.group`, * they will always collide if the value is positive, and they will never collide * if the value is negative. * - If the two bodies have different values of `collisionFilter.group` or if one * (or both) of the bodies has a value of 0, then the category/mask rules apply as follows: - * + * * Each body belongs to a collision category, given by `collisionFilter.category`. This * value is used as a bit field and the category should have only one bit set, meaning that * the value of this property is a power of two in the range [1, 2^31]. Thus, there are 32 * different collision categories available. - * + * * Each body also defines a collision bitmask, given by `collisionFilter.mask` which specifies * the categories it collides with (the value is the bitwise AND value of all these categories). - * + * * Using the category/mask rules, two bodies `A` and `B` collide if each includes the other's * category in its mask, i.e. `(categoryA & maskB) !== 0` and `(categoryB & maskA) !== 0` * are both true. @@ -99338,9 +97970,9 @@ declare namespace Phaser { /** * Configuration for the Matter Physics Runner. - * + * * Set only one of `fps` and `delta`. - * + * * `delta` is the size of the Runner's fixed time step (one physics update). * The "frame delta" is the time elapsed since the last game step. * Depending on the size of the frame delta, the Runner makes zero or more updates per game step. @@ -100683,7 +99315,7 @@ declare namespace Phaser { /** * Config object containing settings for the source of the spatial sound. - * + * * See https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics */ type SpatialSoundConfig = { @@ -102460,7 +101092,7 @@ declare namespace Phaser { */ class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Collision, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -102706,7 +101338,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -102752,21 +101384,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -102776,21 +101408,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -102802,13 +101434,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -102839,7 +101471,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -102849,11 +101481,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -102862,11 +101494,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -102953,7 +101585,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -102964,7 +101596,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -102975,7 +101607,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -102986,7 +101618,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -102997,7 +101629,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103008,7 +101640,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103019,7 +101651,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103030,7 +101662,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103041,7 +101673,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -103123,10 +101755,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -103147,12 +101779,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -103198,7 +101830,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -103300,12 +101932,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -103319,12 +101951,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -103342,10 +101974,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -103362,7 +101994,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -103371,7 +102003,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -103380,30 +102012,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -103413,12 +102045,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -103459,26 +102091,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -103491,7 +102123,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -103501,14 +102133,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -103577,11 +102209,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -103649,7 +102281,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -103663,7 +102295,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -103681,20 +102313,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -103719,9 +102351,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -103770,7 +102402,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -103803,9 +102435,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -103836,14 +102468,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -103874,7 +102506,7 @@ declare namespace Phaser { /** * Sets the angular velocity of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -103885,7 +102517,7 @@ declare namespace Phaser { /** * Sets the angular acceleration of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -103903,7 +102535,7 @@ declare namespace Phaser { /** * Sets the bounce values of this body. - * + * * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. @@ -103932,7 +102564,7 @@ declare namespace Phaser { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. * @param bounceX If given, this will replace the `worldBounce.x` value. @@ -103945,9 +102577,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -103983,10 +102615,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -104006,7 +102638,7 @@ declare namespace Phaser { /** * Sets the debug values of this body. - * + * * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. * Note that there is a performance cost in drawing debug displays. It should never be used in production. * @param showBody Set to `true` to have this body render its outline to the debug display. @@ -104040,16 +102672,16 @@ declare namespace Phaser { /** * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param x The amount of horizontal drag to apply. * @param y The amount of vertical drag to apply. Default x. @@ -104059,16 +102691,16 @@ declare namespace Phaser { /** * Sets the body's horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of horizontal drag to apply. * @returns This Game Object. @@ -104077,16 +102709,16 @@ declare namespace Phaser { /** * Sets the body's vertical drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of vertical drag to apply. * @returns This Game Object. @@ -104099,7 +102731,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. @@ -104212,7 +102844,7 @@ declare namespace Phaser { /** * Sets if this Body can be separated during collisions with other bodies. - * + * * When a body is immovable it means it won't move at all, not even to separate it from collision * overlap. If you just wish to prevent a body from being knocked around by other bodies, see * the `setPushable` method instead. @@ -104231,7 +102863,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -104279,7 +102911,7 @@ declare namespace Phaser { /** * Sets the horizontal component of the body's velocity. - * + * * Positive values move the body to the right, while negative values move it to the left. * @param x The new horizontal velocity, in pixels per second. * @returns This Game Object. @@ -104288,7 +102920,7 @@ declare namespace Phaser { /** * Sets the vertical component of the body's velocity. - * + * * Positive values move the body down, while negative values move it up. * @param y The new vertical velocity, in pixels per second. * @returns This Game Object. @@ -104308,9 +102940,9 @@ declare namespace Phaser { /** * The Arcade Physics Plugin belongs to a Scene and sets up and manages the Scene's physics simulation. * It also holds some useful methods for moving and rotating Arcade Physics Bodies. - * + * * You can access it from within a Scene using `this.physics`. - * + * * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. * The separation that stops two objects penetrating may create a new penetration against a different object. If you @@ -104318,7 +102950,7 @@ declare namespace Phaser { */ class ArcadePhysics { /** - * + * * @param scene The Scene that this Plugin belongs to. */ constructor(scene: Phaser.Scene); @@ -104362,7 +102994,7 @@ declare namespace Phaser { * If you wish to run the World update at your own rate, or from your own * component, then you should call this method to disable the built-in link, * and then call `World.update(time, delta)` accordingly. - * + * * Note that `World.postUpdate` is always automatically called when the Scene * emits a `POST_UPDATE` event, regardless of this setting. */ @@ -104376,11 +103008,11 @@ declare namespace Phaser { /** * Returns the next available collision category. - * + * * You can have a maximum of 32 categories. - * + * * By default all bodies collide with all other bodies. - * + * * Use the `Body.setCollisionCategory()` and * `Body.setCollidesWith()` methods to change this.undefined * @returns The next collision category. @@ -104401,18 +103033,18 @@ declare namespace Phaser { /** * Performs a collision check and separation between the two physics enabled objects given, which can be single * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. - * + * * If you don't require separation then use {@link #overlap} instead. - * + * * If two Groups or arrays are passed, each member of one will be tested against each member of the other. - * + * * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. - * + * * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. - * + * * Two callbacks can be provided. The `collideCallback` is invoked if a collision occurs and the two colliding * objects are passed to it. - * + * * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. * The separation that stops two objects penetrating may create a new penetration against a different object. If you @@ -104428,15 +103060,15 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. - * + * * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for collision with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, * you should filter them before passing them to this method. - * + * * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on @@ -104452,10 +103084,10 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. - * + * * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, @@ -104483,9 +103115,9 @@ declare namespace Phaser { /** * Sets the acceleration.x/y property on the game object so it will move towards the x/y coordinates at the given rate (in pixels per second squared) - * + * * You must give a maximum speed value, beyond which the game object won't go any faster. - * + * * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. * Note: The game object doesn't stop moving once it reaches the destination coordinates. * @param gameObject Any Game Object with an Arcade Physics body. @@ -104502,7 +103134,7 @@ declare namespace Phaser { * Sets the acceleration.x/y property on the game object so it will move towards the destination object at the given rate (in pixels per second squared) * * You must give a maximum speed value, beyond which the game object won't go any faster. - * + * * Note: The game object does not continuously track the target. If the target changes location during transit the game object will not modify its course. * Note: The game object doesn't stop moving once it reaches the destination coordinates. * @param gameObject Any Game Object with an Arcade Physics body. @@ -104516,12 +103148,12 @@ declare namespace Phaser { /** * Finds the Body or Game Object closest to a source point or object. - * + * * If a `targets` argument is passed, this method finds the closest of those. * The targets can be Arcade Physics Game Objects, Dynamic Bodies, or Static Bodies. - * + * * If no `targets` argument is passed, this method finds the closest Dynamic Body. - * + * * If two or more targets are the exact same distance from the source point, only the first target * is returned. * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. @@ -104532,12 +103164,12 @@ declare namespace Phaser { /** * Finds the Body or Game Object farthest from a source point or object. - * + * * If a `targets` argument is passed, this method finds the farthest of those. * The targets can be Arcade Physics Game Objects, Dynamic Bodies, or Static Bodies. - * + * * If no `targets` argument is passed, this method finds the farthest Dynamic Body. - * + * * If two or more targets are the exact same distance from the source point, only the first target * is returned. * @param source Any object with public `x` and `y` properties, such as a Game Object or Geometry object. @@ -104600,7 +103232,7 @@ declare namespace Phaser { /** * This method will search the given rectangular area and return an array of all physics bodies that * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. - * + * * A body only has to intersect with the search area to be considered, it doesn't have to be fully * contained within it. * @@ -104619,10 +103251,10 @@ declare namespace Phaser { /** * This method will search the given circular area and return an array of all physics bodies that * overlap with it. It can return either Dynamic, Static bodies or a mixture of both. - * + * * A body only has to intersect with the search area to be considered, it doesn't have to be fully * contained within it. - * + * * If Arcade Physics is set to use the RTree (which it is by default) then the search is rather fast, * otherwise the search is O(N) for Dynamic Bodies. * @param x The x coordinate of the center of the area to search within. @@ -104663,7 +103295,7 @@ declare namespace Phaser { */ class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Collision, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** - * + * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. @@ -104913,7 +103545,7 @@ declare namespace Phaser { /** * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * If your game is running under WebGL you can optionally specify four different alpha values, each of which * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. @@ -104959,21 +103591,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -104983,21 +103615,21 @@ declare namespace Phaser { /** * Sets the Blend Mode being used by this Game Object. - * + * * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * + * * Under WebGL only the following Blend Modes are available: - * + * * * NORMAL * * ADD * * MULTIPLY * * SCREEN * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * + * * Canvas has more available depending on browser support. - * + * * You can also create your own custom Blend Modes in WebGL. - * + * * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these * reasons try to be careful about the construction of your Scene and the frequency with which blend modes @@ -105009,13 +103641,13 @@ declare namespace Phaser { /** * The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. - * + * * The default depth is zero. A Game Object with a higher depth * value will always render in front of one with a lower value. - * + * * Setting the depth will queue a depth sort event within the Scene. */ depth: number; @@ -105046,7 +103678,7 @@ declare namespace Phaser { /** * Sets this Game Object to the back of the display list, or the back of its parent container. - * + * * Being at the back means it will render below everything else. * * This method does not change this Game Objects `depth` value, it simply alters its list position.undefined @@ -105056,11 +103688,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears above the given Game Object. - * + * * This means it will render immediately after the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be above. * @returns This Game Object instance. @@ -105069,11 +103701,11 @@ declare namespace Phaser { /** * Move this Game Object so that it appears below the given Game Object. - * + * * This means it will render immediately under the other object in the display list. - * + * * Both objects must belong to the same display list, or parent container. - * + * * This method does not change this Game Objects `depth` value, it simply alters its list position. * @param gameObject The Game Object that this Game Object will be moved to be below. * @returns This Game Object instance. @@ -105160,7 +103792,7 @@ declare namespace Phaser { /** * Gets the center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105171,7 +103803,7 @@ declare namespace Phaser { /** * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105182,7 +103814,7 @@ declare namespace Phaser { /** * Gets the top-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105193,7 +103825,7 @@ declare namespace Phaser { /** * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105204,7 +103836,7 @@ declare namespace Phaser { /** * Gets the left-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105215,7 +103847,7 @@ declare namespace Phaser { /** * Gets the right-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105226,7 +103858,7 @@ declare namespace Phaser { /** * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105237,7 +103869,7 @@ declare namespace Phaser { /** * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105248,7 +103880,7 @@ declare namespace Phaser { /** * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * + * * The returned point is calculated in local space and does not factor in any parent Containers, * unless the `includeParent` argument is set to `true`. * @param output An object to store the values in. If not provided a new Vector2 will be created. @@ -105330,10 +103962,10 @@ declare namespace Phaser { * In WebGL, use a Mask filter instead (see {@link Phaser.GameObjects.Components.FilterList#addMask}). * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @param mask The mask this Game Object will use when rendering. @@ -105354,12 +103986,12 @@ declare namespace Phaser { /** * Creates and returns a Geometry Mask. This mask can be used by any Game Object, * including this one. - * + * * To create the mask you need to pass in a reference to a Graphics Game Object. - * + * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * This only works in the Canvas Renderer. @@ -105405,7 +104037,7 @@ declare namespace Phaser { /** * Sets the origin of this Game Object. - * + * * The values are given in the range 0 to 1. * @param x The horizontal origin value. Default 0.5. * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. @@ -105507,12 +104139,12 @@ declare namespace Phaser { /** * The horizontal scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -105526,12 +104158,12 @@ declare namespace Phaser { /** * The vertical scroll factor of this Game Object. - * + * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -105549,10 +104181,10 @@ declare namespace Phaser { * and `scrollFactorY` in a single call. * * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * + * * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. * It does not change the Game Objects actual position values. - * + * * A value of 1 means it will move exactly in sync with a camera. * A value of 0 means it will not move at all, even if the camera moves. * Other values control the degree to which the camera movement is mapped to this Game Object. @@ -105569,7 +104201,7 @@ declare namespace Phaser { /** * The native (un-scaled) width of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayWidth` property. @@ -105578,7 +104210,7 @@ declare namespace Phaser { /** * The native (un-scaled) height of this Game Object. - * + * * Changing this value will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or use * the `displayHeight` property. @@ -105587,30 +104219,30 @@ declare namespace Phaser { /** * The displayed width of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayWidth: number; /** * The displayed height of this Game Object. - * + * * This value takes into account the scale factor. - * + * * Setting this value will adjust the Game Object's scale property. */ displayHeight: number; /** * Sets the size of this Game Object to be that of the given Frame. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param frame The frame to base the size of this Game Object on. @@ -105620,12 +104252,12 @@ declare namespace Phaser { /** * Sets the internal size of this Game Object, as used for frame or physics body creation. - * + * * This will not change the size that the Game Object is rendered in-game. * For that you need to either set the scale of the Game Object (`setScale`) or call the * `setDisplaySize` method, which is the same thing as changing the scale but allows you * to do so by giving pixel values. - * + * * If you have enabled this Game Object for input, changing the size will _not_ change the * size of the hit area. To do this you should adjust the `input.hitArea` object directly. * @param width The width of this Game Object. @@ -105666,26 +104298,26 @@ declare namespace Phaser { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. * * The crop size as well as coordinates can not exceed the size of the texture frame. * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rectangle of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @param x The x coordinate to start the crop from. Cannot be negative or exceed the Frame width. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored. @@ -105698,7 +104330,7 @@ declare namespace Phaser { /** * Sets the texture and frame this Game Object will use to render with. - * + * * Textures are referenced by their string-based keys, as stored in the Texture Manager. * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. @@ -105708,14 +104340,14 @@ declare namespace Phaser { /** * Sets the frame this Game Object will use to render with. - * + * * If you pass a string or index then the Frame has to belong to the current Texture being used * by this Game Object. - * + * * If you pass a Frame instance, then the Texture being used by this Game Object will also be updated. - * + * * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * + * * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. * @param frame The name or index of the frame within the Texture, or a Frame instance. * @param updateSize Should this call adjust the size of the Game Object? Default true. @@ -105784,11 +104416,11 @@ declare namespace Phaser { * combining it with the color value of the tint. You can provide either one color value, * in which case the whole Game Object will be tinted in that color. Or you can provide a color * per corner. The colors are blended together across the extent of the Game Object. - * + * * To modify the tint color once set, either call this method again with new values or use the * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight`, * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently. - * + * * To remove a tint call `clearTint`. * * The tint color is combined according to the tint mode. @@ -105856,7 +104488,7 @@ declare namespace Phaser { /** * The z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#depth} instead. */ @@ -105870,7 +104502,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -105888,20 +104520,20 @@ declare namespace Phaser { /** * The angle of this Game Object as expressed in degrees. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left * and -90 is up. - * + * * If you prefer to work in radians, see the `rotation` property instead. */ angle: number; /** * The angle of this Game Object in radians. - * + * * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left * and -PI/2 is up. - * + * * If you prefer to work in degrees, see the `angle` property instead. */ rotation: number; @@ -105926,9 +104558,9 @@ declare namespace Phaser { /** * 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. * @param x The x position of the top-left of the random area. Default 0. @@ -105977,7 +104609,7 @@ declare namespace Phaser { /** * Sets the z position of this Game Object. - * + * * Note: The z position does not control the rendering order of 2D Game Objects. Use * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. * @param value The z position of this Game Object. Default 0. @@ -106010,9 +104642,9 @@ declare namespace Phaser { /** * Takes the given `x` and `y` coordinates and converts them into local space for this * Game Object, taking into account parent and local transforms, and the Display Origin. - * + * * The returned Vector2 contains the translated point in its properties. - * + * * A Camera needs to be provided in order to handle modified scroll factors. If no * camera is specified, it will use the `main` camera from the Scene to which this * Game Object belongs. @@ -106043,14 +104675,14 @@ declare namespace Phaser { /** * The visible state of the Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. */ visible: boolean; /** * Sets the visibility of this Game Object. - * + * * An invisible Game Object will skip rendering, but will still process update logic. * @param value The visible state of the Game Object. * @returns This Game Object instance. @@ -106081,7 +104713,7 @@ declare namespace Phaser { /** * Sets the angular velocity of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -106092,7 +104724,7 @@ declare namespace Phaser { /** * Sets the angular acceleration of the body. - * + * * In Arcade Physics, bodies cannot rotate. They are always axis-aligned. * However, they can have angular motion, which is passed on to the Game Object bound to the body, * causing them to visually rotate, even though the body remains axis-aligned. @@ -106110,7 +104742,7 @@ declare namespace Phaser { /** * Sets the bounce values of this body. - * + * * Bounce is the amount of restitution, or elasticity, the body has when it collides with another object. * A value of 1 means that it will retain its full velocity after the rebound. A value of 0 means it will not rebound at all. * @param x The amount of horizontal bounce to apply on collision. A float, typically between 0 and 1. @@ -106139,7 +104771,7 @@ declare namespace Phaser { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. * @param bounceX If given, this will replace the `worldBounce.x` value. @@ -106152,9 +104784,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -106190,10 +104822,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -106213,7 +104845,7 @@ declare namespace Phaser { /** * Sets the debug values of this body. - * + * * Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. * Note that there is a performance cost in drawing debug displays. It should never be used in production. * @param showBody Set to `true` to have this body render its outline to the debug display. @@ -106247,16 +104879,16 @@ declare namespace Phaser { /** * Sets the body's horizontal and vertical drag. If the vertical drag value is not provided, the vertical drag is set to the same value as the horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param x The amount of horizontal drag to apply. * @param y The amount of vertical drag to apply. Default x. @@ -106266,16 +104898,16 @@ declare namespace Phaser { /** * Sets the body's horizontal drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of horizontal drag to apply. * @returns This Game Object. @@ -106284,16 +104916,16 @@ declare namespace Phaser { /** * Sets the body's vertical drag. - * + * * Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. * It is the absolute loss of velocity due to movement, in pixels per second squared. * The x and y components are applied separately. - * + * * When `useDamping` is true, this is 1 minus the damping factor. * A value of 1 means the Body loses no velocity. * A value of 0.95 means the Body loses 5% of its velocity per step. * A value of 0.5 means the Body loses 50% of its velocity per step. - * + * * Drag is applied only when `acceleration` is zero. * @param value The amount of vertical drag to apply. * @returns This Game Object. @@ -106306,7 +104938,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. @@ -106419,7 +105051,7 @@ declare namespace Phaser { /** * Sets if this Body can be separated during collisions with other bodies. - * + * * When a body is immovable it means it won't move at all, not even to separate it from collision * overlap. If you just wish to prevent a body from being knocked around by other bodies, see * the `setPushable` method instead. @@ -106438,7 +105070,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -106486,7 +105118,7 @@ declare namespace Phaser { /** * Sets the horizontal component of the body's velocity. - * + * * Positive values move the body to the right, while negative values move it to the left. * @param x The new horizontal velocity, in pixels per second. * @returns This Game Object. @@ -106495,7 +105127,7 @@ declare namespace Phaser { /** * Sets the vertical component of the body's velocity. - * + * * Positive values move the body down, while negative values move it up. * @param y The new vertical velocity, in pixels per second. * @returns This Game Object. @@ -106523,7 +105155,7 @@ declare namespace Phaser { */ class Body implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The Arcade Physics simulation this Body belongs to. * @param gameObject The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ @@ -106536,7 +105168,7 @@ declare namespace Phaser { /** * The Game Object this Body belongs to. - * + * * As of Phaser 3.60 this is now optional and can be undefined. */ gameObject: Phaser.GameObjects.GameObject; @@ -106668,7 +105300,7 @@ declare namespace Phaser { /** * The Body's change in position (due to velocity) at the last step, in pixels. - * + * * The size of this value depends on the simulation's step rate. */ readonly newVelocity: Phaser.Math.Vector2; @@ -106690,7 +105322,7 @@ declare namespace Phaser { /** * When `useDamping` is false (the default), this is absolute loss of velocity due to movement, in pixels per second squared. - * + * * When `useDamping` is true, this is a damping multiplier between 0 and 1. * * A value of 0 means the Body stops instantly. @@ -106698,9 +105330,9 @@ declare namespace Phaser { * A value of 0.1 means the Body keeps 10% of its velocity per second, losing 90%. * A value of 1 means the Body loses no velocity. * You can use very small values (e.g., 0.001) to stop the Body quickly. - * + * * The x and y components are applied separately. - * + * * Drag is applied only when `acceleration` is zero. */ drag: Phaser.Math.Vector2; @@ -106729,10 +105361,10 @@ declare namespace Phaser { /** * The rectangle used for world boundary collisions. - * + * * By default it is set to the world boundary rectangle. Or, if this Body was * created by a Physics Group, then whatever rectangle that Group defined. - * + * * You can also change it by using the `Body.setBoundsRectangle` method. */ customBoundsRectangle: Phaser.Geom.Rectangle; @@ -106761,9 +105393,9 @@ declare namespace Phaser { /** * The maximum speed this Body is allowed to reach, in pixels per second. - * + * * If not negative it limits the scalar value of speed. - * + * * Any negative value means no maximum is being applied (the default). */ maxSpeed: number; @@ -106782,7 +105414,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration. @@ -106801,7 +105433,7 @@ declare namespace Phaser { /** * Loss of angular velocity due to angular movement, in degrees per second. - * + * * Angular drag is applied only when angular acceleration is zero. */ angularDrag: number; @@ -106841,7 +105473,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -106854,18 +105486,18 @@ declare namespace Phaser { /** * The Slide Factor of this Body. - * + * * The Slide Factor controls how much velocity is preserved when * this Body is pushed by another Body. - * + * * The default value is 1, which means that it will take on all * velocity given in the push. You can adjust this value to control * how much velocity is retained by this Body when the push ends. - * + * * A value of 0, for example, will allow this Body to be pushed * but then remain completely still after the push ends, such as * you see in a game like Sokoban. - * + * * Or you can set a mid-point, such as 0.25 which will allow it * to keep 25% of the original velocity when the push ends. You * can combine this with the `setDrag()` method to create deceleration. @@ -106949,16 +105581,16 @@ declare namespace Phaser { /** * The Arcade Physics Body Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Body Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; @@ -106986,18 +105618,18 @@ declare namespace Phaser { /** * Updates the Body's `position`, `width`, `height`, and `center` from its Game Object and `offset`. - * + * * You don't need to call this for Dynamic Bodies, as it happens automatically during the physics step. * But you could use it if you have modified the Body offset or Game Object transform and need to immediately * read the Body's new `position` or `center`. - * + * * To resynchronize the Body with its Game Object, use `reset()` instead. */ updateFromGameObject(): void; /** * Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states. - * + * * This method is only called if the physics world is going to run a step this frame. * @param clear Set the `wasTouching` values to their defaults. Default false. */ @@ -107014,9 +105646,9 @@ declare namespace Phaser { /** * Performs a single physics step and updates the body velocity, angle, speed and other properties. - * + * * This method can be called multiple times per game frame, depending on the physics step rate. - * + * * The results are synced back to the Game Object in `postUpdate`. * @param delta The delta time, in seconds, elapsed since the last frame. */ @@ -107024,7 +105656,7 @@ declare namespace Phaser { /** * Feeds the Body results back into the parent Game Object. - * + * * This method is called every game frame, regardless if the world steps or not. */ postUpdate(): void; @@ -107054,12 +105686,12 @@ declare namespace Phaser { /** * Assign this Body to a new Game Object. - * + * * Removes this body from the Physics World, assigns to the new Game Object, calls `setSize` and then * adds this body back into the World again, setting it enabled, unless the `enable` argument is set to `false`. - * + * * If this body already has a Game Object, then it will remove itself from that Game Object first. - * + * * If the given `gameObject` doesn't have a `body` property, it is created and this Body is assigned to it. * @param gameObject The Game Object to assign this Body to. * @param enable Automatically enable this Body for physics. Default true. @@ -107149,7 +105781,7 @@ declare namespace Phaser { /** * The change in this Body's horizontal position from the previous step. * This value is set during the Body's update phase. - * + * * As a Body can update multiple times per step this may not hold the final * delta value for the Body. In this case, please see the `deltaXFinal` method.undefined * @returns The change in horizontal position since the last step, in pixels. @@ -107159,7 +105791,7 @@ declare namespace Phaser { /** * The change in this Body's vertical position from the previous step. * This value is set during the Body's update phase. - * + * * As a Body can update multiple times per step this may not hold the final * delta value for the Body. In this case, please see the `deltaYFinal` method.undefined * @returns The change in vertical position since the last step, in pixels. @@ -107168,10 +105800,10 @@ declare namespace Phaser { /** * The change in this Body's horizontal position from the previous game update. - * + * * This value is set during the `postUpdate` phase and takes into account the * `deltaMax` and final position of the Body. - * + * * Because this value is not calculated until `postUpdate`, you must listen for it * during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will * not be calculated by that point. If you _do_ use these values in `update` they @@ -107182,10 +105814,10 @@ declare namespace Phaser { /** * The change in this Body's vertical position from the previous game update. - * + * * This value is set during the `postUpdate` phase and takes into account the * `deltaMax` and final position of the Body. - * + * * Because this value is not calculated until `postUpdate`, you must listen for it * during a Scene `POST_UPDATE` or `RENDER` event, and not in `update`, as it will * not be calculated by that point. If you _do_ use these values in `update` they @@ -107231,7 +105863,7 @@ declare namespace Phaser { /** * Sets whether this Body collides with the world boundary. - * + * * Optionally also sets the World Bounce and `onWorldBounds` values. * @param value `true` if the Body should collide with the world bounds, otherwise `false`. Default true. * @param bounceX If given this replaces the Body's `worldBounce.x` value. @@ -107294,18 +105926,18 @@ declare namespace Phaser { /** * Sets the Slide Factor of this Body. - * + * * The Slide Factor controls how much velocity is preserved when * this Body is pushed by another Body. - * + * * The default value is 1, which means that it will take on all * velocity given in the push. You can adjust this value to control * how much velocity is retained by this Body when the push ends. - * + * * A value of 0, for example, will allow this Body to be pushed * but then remain completely still after the push ends, such as * you see in a game like Sokoban. - * + * * Or you can set a mid-point, such as 0.25 which will allow it * to keep 25% of the original velocity when the push ends. You * can combine this with the `setDrag()` method to create deceleration. @@ -107394,7 +106026,7 @@ declare namespace Phaser { * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in * the game Asteroids) then you will get a far smoother and more visually correct deceleration * by using damping, avoiding the axis-drift that is prone with linear deceleration. - * + * * If you enable this property then you should use far smaller `drag` values than with linear, as * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. @@ -107556,9 +106188,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -107594,10 +106226,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -107626,7 +106258,7 @@ declare namespace Phaser { */ class Collider { /** - * + * * @param world The Arcade physics World that will manage the collisions. * @param overlapOnly Whether to check for collisions or overlaps. * @param object1 The first object to check for collision. @@ -107684,7 +106316,7 @@ declare namespace Phaser { /** * A name for the Collider. - * + * * Phaser does not use this value, it's for your own reference. * @param name The name to assign to the Collider. * @returns This Collider instance. @@ -107709,7 +106341,7 @@ declare namespace Phaser { */ class Factory { /** - * + * * @param world The Arcade Physics World instance. */ constructor(world: Phaser.Physics.Arcade.World); @@ -107819,7 +106451,7 @@ declare namespace Phaser { /** * Creates a new physics Body with the given position and size. - * + * * This Body is not associated with any Game Object, but still exists within the world * and can be tested for collision, have velocity, etc. * @param x The horizontal position of this Body in the physics world. @@ -107832,7 +106464,7 @@ declare namespace Phaser { /** * Creates a new static physics Body with the given position and size. - * + * * This Body is not associated with any Game Object, but still exists within the world * and can be tested for collision, etc. * @param x The horizontal position of this Body in the physics world. @@ -107887,20 +106519,20 @@ declare namespace Phaser { * The primary use of a Physics Group is a way to collect together physics-enabled objects * that share the same intrinsic structure into a single pool. They can then be easily * compared against other Groups, or Game Objects. - * + * * All Game Objects created by, or added to this Group will automatically be given **dynamic** * Arcade Physics bodies (if they have no body already) and the bodies will receive the * Groups {@link Phaser.Physics.Arcade.Group#defaults default values}. - * + * * You should not pass objects into this Group that should not receive a body. For example, * do not add basic Geometry or Tilemap Layers into a Group, as they will not behave in the * way you may expect. Groups should all ideally have objects of the same type in them. - * + * * If you wish to create a Group filled with Static Bodies, please see {@link Phaser.Physics.Arcade.StaticGroup}. */ class Group extends Phaser.GameObjects.Group implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The physics simulation. * @param scene The scene this group belongs to. * @param children Game Objects to add to this group; or the `config` argument. @@ -107915,7 +106547,7 @@ declare namespace Phaser { /** * The class to create new Group members from. - * + * * This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those. * * The constructor arguments must match `(scene, x, y, texture, frame)`. @@ -107929,23 +106561,23 @@ declare namespace Phaser { /** * The Arcade Physics Group Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Group Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; /** * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. - * + * * You can remove the default values by setting this property to `{}`. */ defaults: Phaser.Types.Physics.Arcade.PhysicsGroupDefaults; @@ -107996,9 +106628,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -108034,10 +106666,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -108059,7 +106691,7 @@ declare namespace Phaser { /** * Separates two overlapping bodies on the X-axis (horizontally). - * + * * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. * * The bodies won't be separated if there is no horizontal overlap between them, if both are immovable, or if either one uses custom separation logic via `customSeparateX`. @@ -108074,9 +106706,9 @@ declare namespace Phaser { /** * Separates two overlapping bodies on the Y-axis (vertically). - * + * * Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection. - * + * * The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation. * @param body1 The first Body to separate. * @param body2 The second Body to separate. @@ -108103,10 +106735,10 @@ declare namespace Phaser { /** * A Static Arcade Physics Body. - * + * * A Static Body never moves, and isn't automatically synchronized with its parent Game Object. * That means if you make any change to the parent's origin, position, or scale after creating or adding the body, you'll need to update the Static Body manually. - * + * * A Static Body can collide with other Bodies, but is never moved by collisions. * * Static Bodies are ideal for platforms, walls, floors, and other immovable environmental @@ -108117,7 +106749,7 @@ declare namespace Phaser { */ class StaticBody implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The Arcade Physics simulation this Static Body belongs to. * @param gameObject The Game Object this Body belongs to. As of Phaser 3.60 this is now optional. */ @@ -108130,7 +106762,7 @@ declare namespace Phaser { /** * The Game Object this Static Body belongs to. - * + * * As of Phaser 3.60 this is now optional and can be undefined. */ gameObject: Phaser.GameObjects.GameObject; @@ -108168,7 +106800,7 @@ declare namespace Phaser { /** * The offset set by {@link Phaser.Physics.Arcade.StaticBody#setCircle} or {@link Phaser.Physics.Arcade.StaticBody#setSize}. - * + * * This doesn't affect the Static Body's position, because a Static Body does not follow its Game Object. */ readonly offset: Phaser.Math.Vector2; @@ -108256,7 +106888,7 @@ declare namespace Phaser { /** * Sets if this Body can be pushed by another Body. - * + * * A body that cannot be pushed will reflect back all of the velocity it is given to the * colliding body. If that body is also not pushable, then the separation will be split * between them evenly. @@ -108334,25 +106966,25 @@ declare namespace Phaser { /** * The Arcade Physics Body Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Body Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; /** * Changes the Game Object this Body is bound to. - * + * * First it removes its reference from the old Game Object, then sets the new one. - * + * * This body will be resized to match the frame dimensions of the given Game Object, if it has a texture frame. * You can optionally update the position and dimensions of this Body to reflect that of the new Game Object. * @param gameObject The Game Object to assign this Body to. @@ -108403,7 +107035,7 @@ declare namespace Phaser { /** * Resets this Static Body to its parent Game Object's position. - * + * * If `x` and `y` are given, the parent Game Object is placed there and this Static Body is centered on it. * Otherwise this Static Body is centered on the Game Object's current position. * @param x The x coordinate to reset the body to. If not given will use the parent Game Object's coordinate. @@ -108524,9 +107156,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -108562,10 +107194,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -108601,7 +107233,7 @@ declare namespace Phaser { */ class StaticGroup extends Phaser.GameObjects.Group implements Phaser.Physics.Arcade.Components.Collision { /** - * + * * @param world The physics simulation. * @param scene The scene this group belongs to. * @param children Game Objects to add to this group; or the `config` argument. @@ -108621,16 +107253,16 @@ declare namespace Phaser { /** * The Arcade Physics Static Group Collision Category. - * + * * This can be set to any valid collision bitfield value. - * + * * See the `setCollisionCategory` method for more details. */ collisionCategory: number; /** * The Arcade Physics Static Group Collision Mask. - * + * * See the `setCollidesWith` method for more details. */ collisionMask: number; @@ -108672,9 +107304,9 @@ declare namespace Phaser { /** * Sets the Collision Category that this Arcade Physics Body * will use in order to determine what it can collide with. - * + * * It can only have one single category assigned to it. - * + * * If you wish to reset the collision category and mask, call * the `resetCollisionCategory` method. * @param category The collision category to assign to this body. Typically a power of 2, such as 1, 2, 4, 8, and so on. @@ -108710,10 +107342,10 @@ declare namespace Phaser { * Sets all of the Collision Categories that this Arcade Physics Body * will collide with. You can either pass a single category value, or * an array of them. - * + * * Calling this method will reset all of the collision categories, * so only those passed to this method are enabled. - * + * * If you wish to add a new category to the existing mask, call * the `addCollidesWith` method. * @@ -108735,9 +107367,9 @@ declare namespace Phaser { /** * The Arcade Physics World. - * + * * The World is responsible for creating, managing, colliding and updating all of the bodies within it. - * + * * An instance of the World belongs to a Phaser.Scene and is accessed via the property `physics.world`. * * It uses an RTree spatial index for fast broad-phase collision detection and supports @@ -108746,7 +107378,7 @@ declare namespace Phaser { */ class World extends Phaser.Events.EventEmitter { /** - * + * * @param scene The Scene to which this World instance belongs. * @param config An Arcade Physics Configuration object. */ @@ -108794,7 +107426,7 @@ declare namespace Phaser { /** * The number of physics steps to be taken per second. - * + * * This property is read-only. Use the `setFPS` method to modify it at run-time. */ readonly fps: number; @@ -108812,7 +107444,7 @@ declare namespace Phaser { /** * Scaling factor applied to the frame rate. - * + * * - 1.0 = normal speed * - 2.0 = half speed * - 0.5 = double speed @@ -108862,7 +107494,7 @@ declare namespace Phaser { /** * The maximum number of items per node on the RTree. - * + * * This is ignored if `useTree` is `false`. If you have a large number of bodies in * your world then you may find search performance improves by increasing this value, * to allow more items per node and less node division. @@ -108871,17 +107503,17 @@ declare namespace Phaser { /** * Should this Arcade Physics World use an RTree for Dynamic bodies? - * + * * An RTree is a fast way of spatially sorting of all the bodies in the world. * However, at certain limits, the cost of clearing and inserting the bodies into the * tree every frame becomes more expensive than the search speed gains it provides. - * + * * If you have a large number of dynamic bodies in your world then it may be best to * disable the use of the RTree by setting this property to `false` in the physics config. - * + * * The number it can cope with depends on browser and device, but a conservative estimate * of around 5,000 bodies should be considered the max before disabling it. - * + * * This only applies to dynamic bodies. Static bodies are always kept in an RTree, * because they don't have to be cleared every frame, so you benefit from the * massive search speeds all the time. @@ -108910,23 +107542,23 @@ declare namespace Phaser { /** * Adds an Arcade Physics Body to a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `enableBody` method is that you can pass arrays or Groups * to this method. - * + * * You can specify if the bodies are to be Dynamic or Static. A dynamic body can move via velocity and * acceleration. A static body remains fixed in place and as such is able to use an optimized search * tree, making it ideal for static elements such as level objects. You can still collide and overlap * with static bodies. - * + * * Normally, rather than calling this method directly, you'd use the helper methods available in the * Arcade Physics Factory, such as: - * + * * ```javascript * this.physics.add.image(x, y, textureKey); * this.physics.add.sprite(x, y, textureKey); * ``` - * + * * Calling factory methods encapsulates the creation of a Game Object and the creation of its * body at the same time. If you are creating custom classes then you can pass them to this * method to have their bodies created. @@ -108937,22 +107569,22 @@ declare namespace Phaser { /** * Creates an Arcade Physics Body on a single Game Object. - * + * * If the Game Object already has a body, this method will simply add it back into the simulation. - * + * * You can specify if the body is Dynamic or Static. A dynamic body can move via velocity and * acceleration. A static body remains fixed in place and as such is able to use an optimized search * tree, making it ideal for static elements such as level objects. You can still collide and overlap * with static bodies. - * + * * Normally, rather than calling this method directly, you'd use the helper methods available in the * Arcade Physics Factory, such as: - * + * * ```javascript * this.physics.add.image(x, y, textureKey); * this.physics.add.sprite(x, y, textureKey); * ``` - * + * * Calling factory methods encapsulates the creation of a Game Object and the creation of its * body at the same time. If you are creating custom classes then you can pass them to this * method to have their bodies created. @@ -108964,7 +107596,7 @@ declare namespace Phaser { /** * Adds an existing Arcade Physics Body or StaticBody to the simulation. - * + * * The body is enabled and added to the local search trees. * @param body The Body to be added to the simulation. * @returns The Body that was added to the simulation. @@ -108973,10 +107605,10 @@ declare namespace Phaser { /** * Disables the Arcade Physics Body of a Game Object, an array of Game Objects, or the children of a Group. - * + * * The difference between this and the `disableBody` method is that you can pass arrays or Groups * to this method. - * + * * The body itself is not deleted, it just has its `enable` property set to false, which * means you can re-enable it again at any point by passing it to `World.enable` or `World.add`. * @param object The object, or objects, on which to disable the bodies. @@ -108985,9 +107617,9 @@ declare namespace Phaser { /** * Disables an existing Arcade Physics Body or StaticBody and removes it from the simulation. - * + * * The body is disabled and removed from the local search trees. - * + * * The body itself is not deleted, it just has its `enable` property set to false, which * means you can re-enable it again at any point by passing it to `World.enable` or `World.add`. * @param body The Body to be disabled. @@ -108996,9 +107628,9 @@ declare namespace Phaser { /** * Removes an existing Arcade Physics Body or StaticBody from the simulation. - * + * * The body is disabled and removed from the local search trees. - * + * * The body itself is not deleted, it just has its `enabled` property set to false, which * means you can re-enable it again at any point by passing it to `World.enable` or `World.add`. * @param body The body to be removed from the simulation. @@ -109007,11 +107639,11 @@ declare namespace Phaser { /** * Creates a Graphics Game Object that the world will use to render the debug display to. - * + * * This is called automatically when the World is instantiated if the `debug` config property * was set to `true`. However, you can call it at any point should you need to display the * debug Graphic from a fixed point. - * + * * You can control which objects are drawn to the Graphics object, and the colors they use, * by setting the debug properties in the physics config. * @@ -109022,7 +107654,7 @@ declare namespace Phaser { /** * Sets the position, size and properties of the World boundary. - * + * * The World boundary is an invisible rectangle that defines the edges of the World. * If a Body is set to collide with the world bounds then it will automatically stop * when it reaches any of the edges. You can optionally set which edges of the boundary @@ -109051,9 +107683,9 @@ declare namespace Phaser { /** * Pauses the simulation. - * + * * A paused simulation does not update any existing bodies, or run any Colliders. - * + * * However, you can still enable and disable bodies within it, or manually run collide or overlap * checks.undefined * @returns This World object. @@ -109068,10 +107700,10 @@ declare namespace Phaser { /** * Creates a new Collider object and adds it to the simulation. - * + * * A Collider is a way to automatically perform collision checks between two objects, * calling the collide and process callbacks if they occur. - * + * * Colliders are run as part of the World update, after all of the Bodies have updated. * * By creating a Collider you don't need to then call `World.collide` in your `update` loop, @@ -109087,10 +107719,10 @@ declare namespace Phaser { /** * Creates a new Overlap Collider object and adds it to the simulation. - * + * * A Collider is a way to automatically perform overlap checks between two objects, * calling the collide and process callbacks if they occur. - * + * * Colliders are run as part of the World update, after all of the Bodies have updated. * * By creating a Collider you don't need to then call `World.overlap` in your `update` loop, @@ -109106,10 +107738,10 @@ declare namespace Phaser { /** * Removes a Collider from the simulation so it is no longer processed. - * + * * This method does not destroy the Collider. If you wish to add it back at a later stage you can call * `World.colliders.add(Collider)`. - * + * * If you no longer need the Collider you can call the `Collider.destroy` method instead, which will * automatically clear all of its references and then remove it from the World. If you call destroy on * a Collider you _don't_ need to pass it to this method too. @@ -109120,14 +107752,14 @@ declare namespace Phaser { /** * Sets the frame rate to run the simulation at. - * + * * The frame rate value is used to simulate a fixed update time step. This fixed * time step allows for a straightforward implementation of a deterministic game state. - * + * * This frame rate is independent of the frequency at which the game is rendering. The * higher you set the fps, the more physics simulation steps will occur per game step. * Conversely, the lower you set it, the less will take place. - * + * * You can optionally advance the simulation directly yourself by calling the `step` method. * @param framerate The frame rate to advance the simulation at. * @returns This World object. @@ -109136,7 +107768,7 @@ declare namespace Phaser { /** * Advances the simulation based on the elapsed time and fps rate. - * + * * This is called automatically by your Scene and does not need to be invoked directly. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. @@ -109218,7 +107850,7 @@ declare namespace Phaser { /** * Tests if Game Objects overlap. - * + * * See details in {@link Phaser.Physics.Arcade.World#collide}. * @param object1 The first object or array of objects to check. * @param object2 The second object or array of objects to check, or `undefined`. @@ -109232,19 +107864,19 @@ declare namespace Phaser { /** * Performs a collision check and separation between the two physics enabled objects given, which can be single * Game Objects, arrays of Game Objects, Physics Groups, arrays of Physics Groups or normal Groups. - * + * * If you don't require separation then use {@link Phaser.Physics.Arcade.World#overlap} instead. - * + * * If two Groups or arrays are passed, each member of one will be tested against each member of the other. - * + * * If **only** one Group is passed (as `object1`), each member of the Group will be collided against the other members. - * + * * If **only** one Array is passed, the array is iterated and every element in it is tested against the others. - * + * * Two callbacks can be provided; they receive the colliding game objects as arguments. * If an overlap is detected, the `processCallback` is called first. It can cancel the collision by returning false. * Next the objects are separated and `collideCallback` is invoked. - * + * * Arcade Physics uses the Projection Method of collision resolution and separation. While it's fast and suitable * for 'arcade' style games it lacks stability when multiple objects are in close proximity or resting upon each other. * The separation that stops two objects penetrating may create a new penetration against a different object. If you @@ -109269,20 +107901,20 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for collision between a single Sprite and an array of Tile objects. - * + * * You should generally use the `collide` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for collision with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic collisions * on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, * you should filter them before passing them to this method. - * + * * Important: Use of this method skips the `interesting faces` system that Tilemap Layers use. This means if you have * say a row or column of tiles, and you jump into, or walk over them, it's possible to get stuck on the edges of the * tiles as the interesting face calculations are skipped. However, for quick-fire small collision set tests on * dynamic maps, this method can prove very useful. - * + * * This method does not factor in the Collision Mask or Category. * @param sprite The first object to check for collision. * @param tiles An array of Tiles to check for collision against. @@ -109295,15 +107927,15 @@ declare namespace Phaser { /** * This advanced method is specifically for testing for overlaps between a single Sprite and an array of Tile objects. - * + * * You should generally use the `overlap` method instead, with a Sprite vs. a Tilemap Layer, as that will perform * tile filtering and culling for you, as well as handle the interesting face collision automatically. - * + * * This method is offered for those who would like to check for overlaps with specific Tiles in a layer, without * having to set any collision attributes on the tiles in question. This allows you to perform quick dynamic overlap * tests on small sets of Tiles. As such, no culling or checks are made to the array of Tiles given to this method, * you should filter them before passing them to this method. - * + * * This method does not factor in the Collision Mask or Category. * @param sprite The first object to check for collision. * @param tiles An array of Tiles to check for collision against. @@ -109329,7 +107961,7 @@ declare namespace Phaser { /** * Wrap an object's coordinates (or several objects' coordinates) within {@link Phaser.Physics.Arcade.World#bounds}. - * + * * If the object is outside any boundary edge (left, top, right, bottom), it will be moved to the same offset from the opposite edge (the interior). * @param object A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. * @param padding An amount added to each boundary edge during the operation. Default 0. @@ -109990,7 +108622,7 @@ declare namespace Phaser { * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. */ - const COLLIDE: string; + const COLLIDE: 'collide'; /** * The Arcade Physics World Overlap Event. @@ -110004,7 +108636,7 @@ declare namespace Phaser { * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. */ - const OVERLAP: string; + const OVERLAP: 'overlap'; /** * The Arcade Physics World Pause Event. @@ -110013,7 +108645,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.physics.world.on('pause', listener)`. */ - const PAUSE: string; + const PAUSE: 'pause'; /** * The Arcade Physics World Resume Event. @@ -110022,7 +108654,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.physics.world.on('resume', listener)`. */ - const RESUME: string; + const RESUME: 'resume'; /** * The Arcade Physics Tile Collide Event. @@ -110036,7 +108668,7 @@ declare namespace Phaser { * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. */ - const TILE_COLLIDE: string; + const TILE_COLLIDE: 'tilecollide'; /** * The Arcade Physics Tile Overlap Event. @@ -110050,7 +108682,7 @@ declare namespace Phaser { * * Please note that 'collide' and 'overlap' are two different things in Arcade Physics. */ - const TILE_OVERLAP: string; + const TILE_OVERLAP: 'tileoverlap'; /** * The Arcade Physics World Bounds Event. @@ -110062,7 +108694,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.physics.world.on('worldbounds', listener)`. */ - const WORLD_BOUNDS: string; + const WORLD_BOUNDS: 'worldbounds'; /** * The Arcade Physics World Step Event. @@ -110074,7 +108706,7 @@ declare namespace Phaser { * * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. */ - const WORLD_STEP: string; + const WORLD_STEP: 'worldstep'; } @@ -110178,13 +108810,13 @@ declare namespace Phaser { * The Body Bounds class contains methods to help you extract the world coordinates from various points around * the bounds of a Matter Body. Because Matter bodies are positioned based on their center of mass, and not a * dimension based center, you often need to get the bounds coordinates in order to properly align them in the world. - * + * * You can access this class via the MatterPhysics class from a Scene, i.e.: - * + * * ```javascript * this.matter.bodyBounds.getTopLeft(body); * ``` - * + * * See also the `MatterPhysics.alignBody` method. */ class BodyBounds { @@ -110200,9 +108832,9 @@ declare namespace Phaser { /** * Parses the given body to get the bounds diff values from it. - * + * * They're stored in this class in the temporary properties `boundsCenter` and `centerDiff`. - * + * * This method is called automatically by all other methods in this class. * @param body The Body to get the bounds position from. * @returns `true` if it was able to get the bounds, otherwise `false`. @@ -110211,7 +108843,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the top-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110223,7 +108855,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the top-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110235,7 +108867,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the top-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110247,7 +108879,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the left-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110259,7 +108891,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110271,7 +108903,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the right-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110283,7 +108915,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the bottom-left of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110295,7 +108927,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the bottom-center of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -110307,7 +108939,7 @@ declare namespace Phaser { /** * Takes a Body and returns the world coordinates of the bottom-right of its _bounds_. - * + * * Body bounds are updated by Matter each step and factor in scale and rotation. * This will return the world coordinate based on the body's _current_ position and bounds. * @param body The Body to get the position from. @@ -116174,7 +114806,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked when this Game Object's Matter Body begins colliding with another body. * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param callback The callback to invoke when this body starts colliding with another. @@ -116184,7 +114816,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked when this Game Object's Matter Body stops colliding with another body. * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param callback The callback to invoke when this body stops colliding with another. @@ -116194,7 +114826,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked each step while this Game Object's Matter Body is actively colliding with another body. * The callback is sent a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param callback The callback to invoke for the duration of this body colliding with another. @@ -116204,7 +114836,7 @@ declare namespace Phaser { /** * Sets a callback to be invoked when this Game Object's Matter Body collides with a specific body or bodies. * The callback is sent a reference to the other body, along with a `Phaser.Types.Physics.Matter.MatterCollisionData` object. - * + * * This does not change the bodies collision category, group or filter. Those must be set in addition * to the callback. * @param body The body, or an array of bodies, to test for collisions with. @@ -116415,7 +115047,7 @@ declare namespace Phaser { setTrapezoid(width: number, height: number, slope: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): this; /** * Set this Game Object to use the given existing Matter Body. - * + * * The body is first removed from the world before being added to this Game Object. * @param body The Body this Game Object should use. * @param addToWorld Should the body be immediately added to the World? Default true. @@ -116464,9 +115096,9 @@ declare namespace Phaser { setSleepThreshold(value?: number): this; /** * Enable sleep and wake events for this body. - * + * * By default when a body goes to sleep, or wakes up, it will not emit any events. - * + * * The events are emitted by the Matter World instance and can be listened to via * the `SLEEP_START` and `SLEEP_END` events. * @param start `true` if you want the sleep start event to be emitted for this body. @@ -116523,7 +115155,7 @@ declare namespace Phaser { /** * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * + * * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this * isn't the case, use the `scaleX` or `scaleY` properties instead. */ @@ -116662,13 +115294,13 @@ declare namespace Phaser { /** * The Matter Physics After Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the end of the process when a new Body * or Constraint has just been added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afteradd', listener)`. */ - const AFTER_ADD: string; + const AFTER_ADD: 'afteradd'; type AfterRemoveEvent = { /** @@ -116687,13 +115319,13 @@ declare namespace Phaser { /** * The Matter Physics After Remove Event. - * + * * This event is dispatched by a Matter Physics World instance at the end of the process when a * Body or Constraint was removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterremove', listener)`. */ - const AFTER_REMOVE: string; + const AFTER_REMOVE: 'afterremove'; type AfterUpdateEvent = { /** @@ -116712,12 +115344,12 @@ declare namespace Phaser { /** * The Matter Physics After Update Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated and all collision events have resolved. - * + * * Listen to it from a Scene using: `this.matter.world.on('afterupdate', listener)`. */ - const AFTER_UPDATE: string; + const AFTER_UPDATE: 'afterupdate'; type BeforeAddEvent = { /** @@ -116736,13 +115368,13 @@ declare namespace Phaser { /** * The Matter Physics Before Add Event. - * + * * This event is dispatched by a Matter Physics World instance at the start of the process when a new Body * or Constraint is being added to the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeadd', listener)`. */ - const BEFORE_ADD: string; + const BEFORE_ADD: 'beforeadd'; type BeforeRemoveEvent = { /** @@ -116761,13 +115393,13 @@ declare namespace Phaser { /** * The Matter Physics Before Remove Event. - * + * * This event is dispatched by a Matter Physics World instance at the start of the process when a * Body or Constraint is being removed from the world. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeremove', listener)`. */ - const BEFORE_REMOVE: string; + const BEFORE_REMOVE: 'beforeremove'; type BeforeUpdateEvent = { /** @@ -116786,12 +115418,12 @@ declare namespace Phaser { /** * The Matter Physics Before Update Event. - * + * * This event is dispatched by a Matter Physics World instance right before all the collision processing takes place. - * + * * Listen to it from a Scene using: `this.matter.world.on('beforeupdate', listener)`. */ - const BEFORE_UPDATE: string; + const BEFORE_UPDATE: 'beforeupdate'; type CollisionActiveEvent = { /** @@ -116814,13 +115446,13 @@ declare namespace Phaser { /** * The Matter Physics Collision Active Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that are colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionactive', listener)`. */ - const COLLISION_ACTIVE: string; + const COLLISION_ACTIVE: 'collisionactive'; type CollisionEndEvent = { /** @@ -116843,13 +115475,13 @@ declare namespace Phaser { /** * The Matter Physics Collision End Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have finished colliding in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionend', listener)`. */ - const COLLISION_END: string; + const COLLISION_END: 'collisionend'; type CollisionStartEvent = { /** @@ -116872,61 +115504,61 @@ declare namespace Phaser { /** * The Matter Physics Collision Start Event. - * + * * This event is dispatched by a Matter Physics World instance after the engine has updated. * It provides a list of all pairs that have started to collide in the current tick (if any). - * + * * Listen to it from a Scene using: `this.matter.world.on('collisionstart', listener)`. */ - const COLLISION_START: string; + const COLLISION_START: 'collisionstart'; /** * The Matter Physics Drag End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * stops dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragend', listener)`. */ - const DRAG_END: string; + const DRAG_END: 'dragend'; /** * The Matter Physics Drag Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * is actively dragging a body. It is emitted each time the pointer moves. - * + * * Listen to it from a Scene using: `this.matter.world.on('drag', listener)`. */ - const DRAG: string; + const DRAG: 'drag'; /** * The Matter Physics Drag Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * starts dragging a body. - * + * * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. */ - const DRAG_START: string; + const DRAG_START: 'dragstart'; /** * The Matter Physics World Pause Event. - * + * * This event is dispatched by an Matter Physics World instance when it is paused. - * + * * Listen to it from a Scene using: `this.matter.world.on('pause', listener)`. */ - const PAUSE: string; + const PAUSE: 'pause'; /** * The Matter Physics World Resume Event. - * + * * This event is dispatched by an Matter Physics World instance when it resumes from a paused state. - * + * * Listen to it from a Scene using: `this.matter.world.on('resume', listener)`. */ - const RESUME: string; + const RESUME: 'resume'; type SleepEndEvent = { /** @@ -116941,12 +115573,12 @@ declare namespace Phaser { /** * The Matter Physics Sleep End Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body stop sleeping. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepend', listener)`. */ - const SLEEP_END: string; + const SLEEP_END: 'sleepend'; type SleepStartEvent = { /** @@ -116961,12 +115593,12 @@ declare namespace Phaser { /** * The Matter Physics Sleep Start Event. - * + * * This event is dispatched by a Matter Physics World instance when a Body goes to sleep. - * + * * Listen to it from a Scene using: `this.matter.world.on('sleepstart', listener)`. */ - const SLEEP_START: string; + const SLEEP_START: 'sleepstart'; } @@ -116986,7 +115618,7 @@ declare namespace Phaser { */ class BasePlugin { /** - * + * * @param pluginManager A reference to the Plugin Manager. */ constructor(pluginManager: Phaser.Plugins.PluginManager); @@ -117067,20 +115699,20 @@ declare namespace Phaser { /** * These are the core plugins that are installed into every Scene.Systems instance, no matter what. * They are optionally exposed in the Scene as well (see the InjectionMap for details) - * + * * They are created in the order in which they appear in this array and EventEmitter is always first. */ var CoreScene: any[]; /** * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. - * + * * You can elect not to have these plugins by either creating a DefaultPlugins object as part * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array * and building your own bundle. - * + * * They are optionally exposed in the Scene as well (see the InjectionMap for details) - * + * * They are always created in the order in which they appear in the array. */ var DefaultScene: any[]; @@ -117159,7 +115791,7 @@ declare namespace Phaser { /** * Removes all Core Plugins. - * + * * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. * So be sure you only call this if you do not wish to run Phaser again. */ @@ -117177,40 +115809,40 @@ declare namespace Phaser { /** * The PluginManager is responsible for installing and adding plugins to Phaser. - * + * * It is a global system and therefore belongs to the Game instance, not a specific Scene. - * + * * It works in conjunction with the PluginCache. Core internal plugins automatically register themselves * with the Cache, but it's the Plugin Manager that is responsible for injecting them into the Scenes. - * + * * There are two types of plugin: - * + * * 1. A Global Plugin * 2. A Scene Plugin - * + * * A Global Plugin is a plugin that lives within the Plugin Manager rather than a Scene. You can get * access to it by calling `PluginManager.get` and providing a key. Any Scene that requests a plugin in * this way will get access to the same plugin instance, allowing you to use a single plugin across * multiple Scenes. - * + * * A Scene Plugin is a plugin dedicated to running within a Scene. These are different to Global Plugins * in that their instances do not live within the Plugin Manager, but within the Scene Systems class instead. * Also, every Scene created is given its own unique instance of a Scene Plugin. Examples of core Scene * Plugins include the Input Plugin, the Tween Plugin and the physics Plugins. - * + * * You can add a plugin to Phaser in three different ways: - * + * * 1. Preload it * 2. Include it in your source code and install it via the Game Config * 3. Include it in your source code and install it within a Scene - * + * * For examples of all of these approaches please see the Phaser 3 Examples Repo `plugins` folder. - * + * * For information on creating your own plugin please see the Phaser 3 Plugin Template. */ class PluginManager { /** - * + * * @param game The game instance that owns this Plugin Manager. */ constructor(game: Phaser.Game); @@ -117238,7 +115870,7 @@ declare namespace Phaser { /** * Called by the Scene Systems class. Tells the plugin manager to install all Scene plugins into it. - * + * * First it will install global references, i.e. references from the Game systems into the Scene Systems (and Scene if mapped.) * Then it will install Core Scene Plugins followed by Scene Plugins registered with the PluginManager. * Finally it will install any references to Global Plugins that have a Scene mapping property into the Scene itself. @@ -117258,19 +115890,19 @@ declare namespace Phaser { * Installs a new Scene Plugin into the Plugin Manager and optionally adds it * to the given Scene as well. A Scene Plugin added to the manager in this way * will be automatically installed into all new Scenes using the key and mapping given. - * + * * The `key` property is what the plugin is injected into Scene.Systems as. * The `mapping` property is optional, and if specified is what the plugin is installed into * the Scene as. For example: - * + * * ```javascript * this.plugins.installScenePlugin('powerupsPlugin', pluginCode, 'powerups'); - * + * * // and from within the scene: * this.sys.powerupsPlugin; // key value * this.powerups; // mapping value * ``` - * + * * This method is called automatically by Phaser if you install your plugins using either the * Game Configuration object, or by preloading them via the Loader. * @param key The property key that will be used to add this plugin to Scene.Systems. @@ -117285,19 +115917,19 @@ declare namespace Phaser { * Installs a new Global Plugin into the Plugin Manager and optionally starts it running. * A global plugin belongs to the Plugin Manager, rather than a specific Scene, and can be accessed * and used by all Scenes in your game. - * + * * The `key` property is what you use to access this plugin from the Plugin Manager. - * + * * ```javascript * this.plugins.install('powerupsPlugin', pluginCode); - * + * * // and from within the scene: * this.plugins.get('powerupsPlugin'); * ``` - * + * * This method is called automatically by Phaser if you install your plugins using either the * Game Configuration object, or by preloading them via the Loader. - * + * * The same plugin can be installed multiple times into the Plugin Manager by simply giving each * instance its own unique key. * @param key The unique handle given to this plugin within the Plugin Manager. @@ -117332,13 +115964,13 @@ declare namespace Phaser { /** * Starts a global plugin running. - * + * * If the plugin was previously active then calling `start` will reset it to an active state and then * call its `start` method. - * + * * If the plugin has never been run before a new instance of it will be created within the Plugin Manager, * its active state set and then both of its `init` and `start` methods called, in that order. - * + * * If the plugin is already running under the given key then nothing happens. * @param key The key of the plugin to start. * @param runAs Run the plugin under a new key. This allows you to run one plugin multiple times. @@ -117348,10 +115980,10 @@ declare namespace Phaser { /** * Stops a global plugin from running. - * + * * If the plugin is active then its active state will be set to false and the plugins `stop` method * will be called. - * + * * If the plugin is not already running, nothing will happen. * @param key The key of the plugin to stop. * @returns The Plugin Manager. @@ -117360,7 +115992,7 @@ declare namespace Phaser { /** * Gets a global plugin from the Plugin Manager based on the given key and returns it. - * + * * If it cannot find an active plugin based on the key, but there is one in the Plugin Cache with the same key, * then it will create a new instance of the cached plugin and return that. * @param key The key of the plugin to get. @@ -117379,7 +116011,7 @@ declare namespace Phaser { /** * Removes a global plugin from the Plugin Manager and Plugin Cache. - * + * * It is up to you to remove all references to this plugin that you may hold within your game code. * @param key The key of the plugin to remove. */ @@ -117387,9 +116019,9 @@ declare namespace Phaser { /** * Removes a scene plugin from the Plugin Manager and Plugin Cache. - * + * * This will not remove the plugin from any active Scenes that are already using it. - * + * * It is up to you to remove all references to this plugin that you may hold within your game code. * @param key The key of the plugin to remove. */ @@ -117399,26 +116031,26 @@ declare namespace Phaser { * Registers a new type of Game Object with the global Game Object Factory and / or Creator. * This is usually called from within your Plugin code and is a helpful short-cut for creating * new Game Objects. - * + * * The key is the property that will be injected into the factories and used to create the * Game Object. For example: - * + * * ```javascript * this.plugins.registerGameObject('clown', clownFactoryCallback, clownCreatorCallback); * // later in your game code: * this.add.clown(); * this.make.clown(); * ``` - * + * * The callbacks are what are called when the factories try to create a Game Object * matching the given key. It's important to understand that the callbacks are invoked within * the context of the GameObjectFactory. In this context there are several properties available * to use: - * + * * this.scene - A reference to the Scene that owns the GameObjectFactory. * this.displayList - A reference to the Display List the Scene owns. * this.updateList - A reference to the Update List the Scene owns. - * + * * See the GameObjectFactory and GameObjectCreator classes for more details. * Any public property or method listed is available from your callbacks under `this`. * @param key The key of the Game Object that the given callbacks will create, i.e. `image`, `sprite`. @@ -117439,13 +116071,13 @@ declare namespace Phaser { /** * Registers a new file type with the global File Types Manager, making it available to all Loader * Plugins created after this. - * + * * This is usually called from within your Plugin code and is a helpful short-cut for creating * new loader file types. - * + * * The key is the property that will be injected into the Loader Plugin and used to load the * files. For example: - * + * * ```javascript * this.plugins.registerFileType('wad', doomWadLoaderCallback); * // later in your preload code: @@ -117456,10 +116088,10 @@ declare namespace Phaser { * It's important to understand that the callback is invoked within * the context of the LoaderPlugin. In this context there are several properties / methods available * to use: - * + * * this.addFile - A method to add the new file to the load queue. * this.scene - The Scene that owns the Loader Plugin instance. - * + * * See the LoaderPlugin class for more details. Any public property or method listed is available from * your callback under `this`. * @param key The key of the file type to register with the Loader Plugin, i.e. `wad`, `atlas`. @@ -117471,7 +116103,7 @@ declare namespace Phaser { /** * Destroys this Plugin Manager and all associated plugins. * It will iterate all plugins found and call their `destroy` methods. - * + * * The PluginCache will remove all custom plugins. */ destroy(): void; @@ -117492,7 +116124,7 @@ declare namespace Phaser { */ class ScenePlugin extends Phaser.Plugins.BasePlugin { /** - * + * * @param scene A reference to the Scene that has installed this plugin. * @param pluginManager A reference to the Plugin Manager. * @param pluginKey The key under which this plugin has been installed into the Scene Systems. @@ -117517,7 +116149,7 @@ declare namespace Phaser { /** * The key under which this plugin was installed into the Scene Systems. - * + * * This property is only set when the plugin is instantiated and added to the Scene, not before. * You can use it during the `boot` method. */ @@ -117525,12 +116157,12 @@ declare namespace Phaser { /** * This method is called when the Scene boots. It is only ever called once. - * + * * By this point the plugin properties `scene` and `systems` will have already been set. - * + * * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. * Here are the Scene events you can listen to: - * + * * - start * - ready * - preupdate @@ -117547,9 +116179,9 @@ declare namespace Phaser { * - transitionout * - shutdown * - destroy - * + * * At the very least you should offer a destroy handler for when the Scene closes down, i.e: - * + * * ```javascript * var eventEmitter = this.systems.events; * eventEmitter.once('destroy', this.sceneDestroy, this); @@ -117786,7 +116418,7 @@ declare namespace Phaser { */ class CanvasRenderer extends Phaser.Events.EventEmitter { /** - * + * * @param game The Phaser Game instance that owns this renderer. */ constructor(game: Phaser.Game); @@ -117843,14 +116475,14 @@ declare namespace Phaser { /** * The blend modes supported by the Canvas Renderer. - * + * * This object maps the {@link Phaser.BlendModes} to canvas compositing operations. */ blendModes: any[]; /** * Details about the currently scheduled snapshot. - * + * * If a non-null `callback` is set in this object, a snapshot of the canvas will be taken after the current frame is fully rendered. */ snapshotState: Phaser.Types.Renderer.Snapshot.SnapshotState; @@ -117922,12 +116554,12 @@ declare namespace Phaser { /** * The core render step for a Scene Camera. - * + * * Iterates through the given array of Game Objects and renders them with the given Camera. - * + * * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked * by the Scene Systems.render method. - * + * * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * @param scene The Scene to render. * @param children An array of filtered Game Objects that can be rendered by the given Camera. @@ -117937,16 +116569,16 @@ declare namespace Phaser { /** * Restores the game context's global settings and takes a snapshot if one is scheduled. - * + * * The post-render step happens after all Cameras in all Scenes have been rendered. */ postRender(): void; /** * Takes a snapshot of the given area of the given canvas. - * + * * Unlike the other snapshot methods, this one is processed immediately and doesn't wait for the next render. - * + * * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. * @param canvas The canvas to grab from. @@ -117964,12 +116596,12 @@ declare namespace Phaser { /** * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. - * + * * To capture a specific area see the `snapshotArea` method. To capture a specific pixel, see `snapshotPixel`. - * + * * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then * calling this method will override it. - * + * * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. * @param callback The Function to invoke after the snapshot image is created. @@ -117981,12 +116613,12 @@ declare namespace Phaser { /** * Schedules a snapshot of the given area of the game viewport to be taken after the current frame is rendered. - * + * * To capture the whole game viewport see the `snapshot` method. To capture a specific pixel, see `snapshotPixel`. - * + * * Only one snapshot can be active _per frame_. If you have already called `snapshotPixel`, for example, then * calling this method will override it. - * + * * Snapshots work by creating an Image object from the canvas data, this is a blocking process, which gets * more expensive the larger the canvas size gets, so please be careful how you employ this in your game. * @param x The x coordinate to grab from. @@ -118002,12 +116634,12 @@ declare namespace Phaser { /** * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. - * + * * To capture the whole game viewport see the `snapshot` method. To capture a specific area, see `snapshotArea`. - * + * * Only one snapshot can be active _per frame_. If you have already called `snapshotArea`, for example, then * calling this method will override it. - * + * * Unlike the other two snapshot methods, this one will return a `Color` object containing the color data for * the requested pixel. It doesn't need to create an internal Canvas or Image object, so is a lot faster to execute, * using less memory. @@ -118046,7 +116678,7 @@ declare namespace Phaser { /** * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix * and then performs the following steps: - * + * * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. * 3. Sets the blend mode of the context to be that used by the Game Object. @@ -118055,7 +116687,7 @@ declare namespace Phaser { * 6. Sets the final matrix values into the context via setTransform. * 7. If the Game Object has a texture frame, imageSmoothingEnabled is set based on frame.source.scaleMode. * 8. If the Game Object does not have a texture frame, imageSmoothingEnabled is set based on Renderer.antialias. - * + * * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. * @param renderer A reference to the current active Canvas renderer. * @param ctx The canvas context to set the transform on. @@ -118071,95 +116703,95 @@ declare namespace Phaser { namespace Events { /** * The Lose WebGL Event. - * + * * This event is dispatched by the WebGLRenderer when the WebGL context * is lost. - * + * * Context can be lost for a variety of reasons, like leaving the browser tab. * The game canvas DOM object will dispatch `webglcontextlost`. * All WebGL resources get wiped, and the context is reset. - * + * * While WebGL is lost, the game will continue to run, but all WebGL resources * are lost, and new ones cannot be created. - * + * * Once the context is restored and the renderer has automatically restored * the state, the renderer will emit a `RESTORE_WEBGL` event. At that point, * it is safe to continue. */ - const LOSE_WEBGL: string; + const LOSE_WEBGL: 'losewebgl'; /** * The Post-Render Event. - * + * * This event is dispatched by the Renderer when all rendering, for all cameras in all Scenes, * has completed, but before any pending snapshots have been taken. */ - const POST_RENDER: string; + const POST_RENDER: 'postrender'; /** * The Pre-Render Clear Event. - * + * * This event is dispatched by the Phaser Renderer. It happens at the start of the render step, before * the WebGL gl.clear function has been called. This allows you to toggle the `config.clearBeforeRender` property * as required, to have fine-grained control over when the canvas is cleared during rendering. - * + * * Listen to it from within a Scene using: `this.renderer.events.on('prerenderclear', listener)`. - * + * * It's very important to understand that this event is called _before_ the scissor and mask stacks are cleared. * This means you should not use this event to modify the scissor or mask. Instead, use the `prerender` event for that. - * + * * If using the Canvas Renderer, this event is dispatched before the canvas is cleared, but after the context globalAlpha * and transform have been reset. */ - const PRE_RENDER_CLEAR: string; + const PRE_RENDER_CLEAR: 'prerenderclear'; /** * The Pre-Render Event. - * + * * This event is dispatched by the Phaser Renderer. This happens right at the start of the render * process, after the context has been cleared, the scissors enabled (WebGL only) and everything has been * reset ready for the render. */ - const PRE_RENDER: string; + const PRE_RENDER: 'prerender'; /** * The Render Event. - * + * * This event is dispatched by the Phaser Renderer for every camera in every Scene. - * + * * It is dispatched before any of the children in the Scene have been rendered. */ - const RENDER: string; + const RENDER: 'render'; /** * The Renderer Resize Event. - * + * * This event is dispatched by the Phaser Renderer when it is resized, usually as a result * of the Scale Manager resizing. */ - const RESIZE: string; + const RESIZE: 'resize'; /** * The Restore WebGL Event. - * + * * This event is dispatched by the WebGLRenderer when the WebGL context * is restored. - * + * * It is dispatched after all WebGL resources have been recreated. * Most resources should come back automatically, but you will need to redraw * dynamic textures that were GPU bound. * Listen to this event to know when you can safely do that. - * + * * Context can be lost for a variety of reasons, like leaving the browser tab. * The game canvas DOM object will dispatch `webglcontextlost`. * All WebGL resources get wiped, and the context is reset. - * + * * Once the context is restored, the canvas will dispatch * `webglcontextrestored`. Phaser uses this to re-create necessary resources. * Please wait for Phaser to dispatch the `RESTORE_WEBGL` event before * re-creating any resources of your own. */ - const RESTORE_WEBGL: string; + const RESTORE_WEBGL: 'restorewebgl'; /** * The Set Parallel Texture Units Event. @@ -118176,7 +116808,7 @@ declare namespace Phaser { * * The primary consumer of this event is batch render nodes. */ - const SET_PARALLEL_TEXTURE_UNITS: string; + const SET_PARALLEL_TEXTURE_UNITS: 'setparalleltextureunits'; } @@ -118472,7 +117104,7 @@ declare namespace Phaser { /** * The renderer that owns this DrawingContextPool. */ - const LIGHT_PIPELINE: string; + renderer: Phaser.Renderer.WebGL.WebGLRenderer; /** * The maximum age of a DrawingContext in milliseconds. @@ -123412,7 +122044,7 @@ declare namespace Phaser { /** * Wrapper for a WebGL buffer, containing all the information that was used * to create it. This can be a VertexBuffer or IndexBuffer. - * + * * A WebGLBuffer should never be exposed outside the WebGLRenderer, so the * WebGLRenderer can handle context loss and other events without other * systems having to be aware of it. Always use WebGLBufferWrapper instead. @@ -123434,7 +122066,7 @@ declare namespace Phaser { /** * The WebGLBuffer being wrapped by this class. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -123492,7 +122124,7 @@ declare namespace Phaser { /** * Creates a WebGLBuffer for this WebGLBufferWrapper. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLBuffer needs re-creating. */ @@ -123533,7 +122165,7 @@ declare namespace Phaser { /** * Wrapper for a WebGL frame buffer, * containing all the information that was used to create it. - * + * * A WebGLFramebuffer should never be exposed outside the WebGLRenderer, * so the WebGLRenderer can handle context loss and other events * without other systems having to be aware of it. @@ -123554,7 +122186,7 @@ declare namespace Phaser { /** * The WebGLFramebuffer being wrapped by this class. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -123604,7 +122236,7 @@ declare namespace Phaser { /** * Creates a WebGLFramebuffer from the given parameters. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLFramebuffer needs re-creating. */ @@ -123921,7 +122553,7 @@ declare namespace Phaser { /** * The WebGLProgram being wrapped by this class. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -123992,7 +122624,7 @@ declare namespace Phaser { /** * Creates a WebGLProgram from the given vertex and fragment shaders. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLProgram needs re-creating. */ @@ -124152,7 +122784,7 @@ declare namespace Phaser { /** * Wrapper for a WebGL texture, containing all the information that was used * to create it. - * + * * A WebGLTexture should never be exposed outside the WebGLRenderer, * so the WebGLRenderer can handle context loss and other events * without other systems having to be aware of it. @@ -124184,7 +122816,7 @@ declare namespace Phaser { /** * The WebGLTexture that this wrapper is wrapping. - * + * * This property could change at any time. * Therefore, you should never store a reference to this value. * It should only be passed directly to the WebGL API for drawing. @@ -124283,7 +122915,7 @@ declare namespace Phaser { /** * Creates a WebGLTexture from the given parameters. - * + * * This is called automatically by the constructor. It may also be * called again if the WebGLTexture needs re-creating. */ @@ -124309,7 +122941,7 @@ declare namespace Phaser { /** * Updates the WebGLTexture from an updated source. - * + * * This should only be used when the source is a Canvas or Video element. * * Because textures usually change into something complex and unique, @@ -124501,7 +123133,7 @@ declare namespace Phaser { namespace Scale { /** * The Scale Manager handles the scaling, resizing and alignment of the game canvas. - * + * * The way scaling is handled is by setting the game canvas to a fixed size, which is defined in the * game configuration. You also define the parent container in the game config. If no parent is given, * it will default to using the document body. The Scale Manager will then look at the available space @@ -124510,37 +123142,37 @@ declare namespace Phaser { * Scaling is therefore achieved by keeping the core canvas the same size and 'stretching' * it via its CSS properties. This gives the same result and speed as using the `transform-scale` CSS * property, without the need for browser prefix handling. - * + * * The calculations for the scale are heavily influenced by the bounding parent size, which is the computed * dimensions of the canvas's parent. The CSS rules of the parent element play an important role in the * operation of the Scale Manager. For example, if the parent has no defined width or height, then actions * like auto-centering will fail to achieve the required result. The Scale Manager works in tandem with the * CSS you set-up on the page hosting your game, rather than taking control of it. - * + * * #### Parent and Display canvas containment guidelines: - * + * * - Style the Parent element (of the game canvas) to control the Parent size and thus the games size and layout. - * + * * - The Parent element's CSS styles should _effectively_ apply maximum (and minimum) bounding behavior. - * + * * - The Parent element should _not_ apply a padding as this is not accounted for. * If a padding is required apply it to the Parent's parent or apply a margin to the Parent. * If you need to add a border, margin or any other CSS around your game container, then use a parent element and * apply the CSS to this instead, otherwise you'll be constantly resizing the shape of the game container. - * + * * - The Display canvas layout CSS styles (i.e. margins, size) should not be altered / specified as * they may be updated by the Scale Manager. - * + * * #### Scale Modes - * + * * The way the scaling is handled is determined by the `scaleMode` property. The default is `NONE`, * which prevents Phaser from scaling or touching the canvas, or its parent, at all. In this mode, you are * responsible for all scaling. The other scaling modes afford you automatic scaling. - * + * * If you wish to scale your game so that it always fits into the available space within the parent, you * should use the scale mode `FIT`. Look at the documentation for other scale modes to see what options are * available. Here is a basic config showing how to set this scale mode: - * + * * ```javascript * scale: { * parent: 'yourgamediv', @@ -124549,33 +123181,33 @@ declare namespace Phaser { * height: 600 * } * ``` - * + * * Place the `scale` config object within your game config. - * + * * If you wish for the canvas to be resized directly, so that the canvas itself fills the available space * (i.e. it isn't scaled, it's resized) then use the `RESIZE` scale mode. This will give you a 1:1 mapping * of canvas pixels to game size. In this mode CSS isn't used to scale the canvas, it's literally adjusted * to fill all available space within the parent. You should be extremely careful about the size of the * canvas you're creating when doing this, as the larger the area, the more work the GPU has to do and it's * very easy to hit fill-rate limits quickly. - * + * * For complex, custom-scaling requirements, you should probably consider using the `RESIZE` scale mode, * with your own limitations in place re: canvas dimensions and managing the scaling with the game scenes * yourself. For the vast majority of games, however, the `FIT` mode is likely to be the most used. - * + * * Please appreciate that the Scale Manager cannot perform miracles. All it does is scale your game canvas * as best it can, based on what it can infer from its surrounding area. There are all kinds of environments * where it's up to you to guide and help the canvas position itself, especially when built into rendering * frameworks like React and Vue. If your page requires meta tags to prevent user scaling gestures, or such * like, then it's up to you to ensure they are present in the html. - * + * * #### Centering - * + * * You can also have the game canvas automatically centered. Again, this relies heavily on the parent being * properly configured and styled, as the centering offsets are based entirely on the available space * within the parent element. Centering is disabled by default, or can be applied horizontally, vertically, * or both. Here's an example: - * + * * ```javascript * scale: { * parent: 'yourgamediv', @@ -124584,9 +123216,9 @@ declare namespace Phaser { * height: 600 * } * ``` - * + * * #### Fullscreen API - * + * * If the browser supports it, you can send your game into fullscreen mode. In this mode, the game will fill * the entire display, removing all browser UI and anything else present on the screen. It will remain in this * mode until your game either disables it, or until the user tabs out or presses ESCape if on desktop. It's a @@ -124595,7 +123227,7 @@ declare namespace Phaser { */ class ScaleManager extends Phaser.Events.EventEmitter { /** - * + * * @param game A reference to the Phaser.Game instance. */ constructor(game: Phaser.Game); @@ -124617,7 +123249,7 @@ declare namespace Phaser { /** * The parent object of the Canvas. Often a div, or the browser window, or nothing in non-browser environments. - * + * * This is set in the Game Config as the `parent` property. If undefined (or just not present), it will default * to use the document body. If specifically set to `null` Phaser will ignore all parent operations. */ @@ -124635,7 +123267,7 @@ declare namespace Phaser { /** * The Game Size component. - * + * * The un-modified game size, as requested in the game config (the raw width / height), * as used for world bounds, cameras, etc */ @@ -124643,7 +123275,7 @@ declare namespace Phaser { /** * The Base Size component. - * + * * The modified game size, which is the auto-rounded gameSize, used to set the canvas width and height * (but not the CSS style) */ @@ -124651,7 +123283,7 @@ declare namespace Phaser { /** * The Display Size component. - * + * * The size used for the canvas style, factoring in the scale mode, parent and other values. */ displaySize: Phaser.Structs.Size; @@ -124663,11 +123295,11 @@ declare namespace Phaser { /** * The game zoom factor. - * + * * This value allows you to multiply your games base size by the given zoom factor. * This is then used when calculating the display size, even in `NONE` situations. * If you don't want Phaser to touch the canvas style at all, this value should be 1. - * + * * Can also be set to `MAX_ZOOM` in which case the zoom value will be derived based * on the game size and available space within the parent. */ @@ -124692,12 +123324,12 @@ declare namespace Phaser { /** * Automatically center the canvas within the parent? The different centering modes are: - * + * * 1. No centering. * 2. Center both horizontally and vertically. * 3. Center horizontally. * 4. Center vertically. - * + * * Please be aware that in order to center the game canvas, you must have specified a parent * that has a size set, or the canvas parent is the document.body. */ @@ -124705,7 +123337,7 @@ declare namespace Phaser { /** * The current device orientation. - * + * * Orientation events are dispatched via the Device Orientation API, typically only on mobile browsers. */ orientation: Phaser.Scale.OrientationType; @@ -124728,7 +123360,7 @@ declare namespace Phaser { /** * How many milliseconds should elapse before checking if the browser size has changed? - * + * * Most modern browsers dispatch a 'resize' event, which the Scale Manager will listen for. * However, older browsers fail to do this, or do it consistently, so we fall back to a * more traditional 'size check' based on a time interval. You can control how often it is @@ -124768,7 +123400,7 @@ declare namespace Phaser { /** * Attempts to lock the orientation of the web browser using the Screen Orientation API. - * + * * This API is only available on modern mobile browsers. * See https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation for details. * @param orientation The orientation you'd like to lock the browser in. Should be an API string such as 'landscape', 'landscape-primary', 'portrait', etc. @@ -124789,7 +123421,7 @@ declare namespace Phaser { /** * This method will set a new size for your game. - * + * * It should only be used if you're looking to change the base size of your game and are using * one of the Scale Manager scaling modes, i.e. `FIT`. If you're using `NONE` and wish to * change the game and canvas size directly, then please use the `resize` method instead. @@ -124803,18 +123435,18 @@ declare namespace Phaser { * Call this to modify the size of the Phaser canvas element directly. * You should only use this if you are using the `NONE` scale mode, * it will update all internal components completely. - * + * * If all you want to do is change the size of the parent, see the `setParentSize` method. - * + * * If all you want is to change the base size of the game, but still have the Scale Manager * manage all the scaling (i.e. you're **not** using `NONE`), then see the `setGameSize` method. - * + * * This method will set the `gameSize`, `baseSize` and `displaySize` components to the given * dimensions. It will then resize the canvas width and height to the values given, by * directly setting the properties. Finally, if you have set the Scale Manager zoom value * to anything other than 1 (the default), it will set the canvas CSS width and height to * be the given size multiplied by the zoom factor (the canvas pixel size remains untouched). - * + * * If you have enabled `autoCenter`, it is then passed to the `updateCenter` method and * the margins are set, allowing the canvas to be centered based on its parent element * alone. Finally, the `displayScale` is adjusted and the RESIZE event dispatched. @@ -124841,11 +123473,11 @@ declare namespace Phaser { * By setting a Snap value, when the browser size is modified, its dimensions will automatically * be snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) - * + * * This mode is best used with the `FIT` scale mode. - * + * * Call this method with no arguments to reset the snap values. - * + * * Calling this method automatically invokes `ScaleManager.refresh` which emits a `RESIZE` event. * @param snapWidth The amount to snap the width to. If you don't want to snap the width, pass a value of zero. Default 0. * @param snapHeight The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero. Default snapWidth. @@ -124855,9 +123487,9 @@ declare namespace Phaser { /** * Refreshes the internal scale values, bounds sizes and orientation checks. - * + * * Once finished, dispatches the resize event. - * + * * This is called automatically by the Scale Manager when the browser window size changes, * as long as it is using a Scale Mode other than 'NONE'. * @param previousWidth The previous width of the game. Only set if the gameSize has changed. @@ -124868,7 +123500,7 @@ declare namespace Phaser { /** * Internal method that checks the current screen orientation, only if the internal check flag is set. - * + * * If the orientation has changed it updates the orientation property and then dispatches the orientation change event. */ updateOrientation(): void; @@ -124891,11 +123523,11 @@ declare namespace Phaser { * bounds of its parent. If you have explicitly set parent to be `null` in your * game config then this method will likely give incorrect results unless you have called the * `setParentSize` method first. - * + * * It works by modifying the canvas CSS `marginLeft` and `marginTop` properties. - * + * * If they have already been set by your own style sheet, or code, this will overwrite them. - * + * * To prevent the Scale Manager from centering the canvas, either do not set the * `autoCenter` property in your game config, or make sure it is set to `NO_CENTER`. */ @@ -124923,22 +123555,22 @@ declare namespace Phaser { /** * Sends a request to the browser to ask it to go in to full screen mode, using the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API Fullscreen API}. - * + * * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. - * + * * This method _must_ be called from a `pointerup` user-input gesture (**not** `pointerdown`). You cannot launch * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked * from fullscreen unless the iframe has the `allowfullscreen` attribute. - * + * * On touch devices, such as Android and iOS Safari, you should always use `pointerup` and NOT `pointerdown`, * otherwise the request will fail unless the document in which your game is embedded has already received * some form of touch input, which you cannot guarantee. Activating fullscreen via `pointerup` circumvents * this issue. - * + * * Performing an action that navigates to another page, or opens another tab, will automatically cancel * fullscreen mode, as will the user pressing the ESC key. To cancel fullscreen mode directly from your game, * i.e. by clicking an icon, call the `stopFullscreen` method. - * + * * A browser can only send one DOM element into fullscreen. You can control which element this is by * setting the `fullscreenTarget` property in your game config, or changing the property in the Scale Manager. * Note that the game canvas _must_ be a child of the target. If you do not give a target, Phaser will @@ -124972,7 +123604,7 @@ declare namespace Phaser { /** * Toggles the fullscreen mode. If already in fullscreen, calling this will cancel it. * If not in fullscreen, this will request the browser to enter fullscreen mode. - * + * * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. * * This method _must_ be called from a `pointerup` user-input gesture (**not** `pointerdown`). You cannot launch @@ -125036,14 +123668,14 @@ declare namespace Phaser { /** * The game width. - * + * * This is typically the size given in the game configuration. */ readonly width: number; /** * The game height. - * + * * This is typically the size given in the game configuration. */ readonly height: number; @@ -125062,14 +123694,14 @@ declare namespace Phaser { /** * Are the game dimensions portrait? (i.e. taller than they are wide) - * + * * This is different to the device itself being in a portrait orientation. */ readonly isGamePortrait: boolean; /** * Are the game dimensions landscape? (i.e. wider than they are tall) - * + * * This is different to the device itself being in a landscape orientation. */ readonly isGameLandscape: boolean; @@ -125228,30 +123860,30 @@ declare namespace Phaser { /** * The Scale Manager has successfully entered fullscreen mode. */ - const ENTER_FULLSCREEN: string; + const ENTER_FULLSCREEN: 'enterfullscreen'; /** * The Scale Manager tried to enter fullscreen mode but failed. */ - const FULLSCREEN_FAILED: string; + const FULLSCREEN_FAILED: 'fullscreenfailed'; /** * The Scale Manager tried to enter fullscreen mode, but it is unsupported by the browser. */ - const FULLSCREEN_UNSUPPORTED: string; + const FULLSCREEN_UNSUPPORTED: 'fullscreenunsupported'; /** * The Scale Manager was in fullscreen mode, but has since left, either directly via game code, * or via a user gestured, such as pressing the ESC key. */ - const LEAVE_FULLSCREEN: string; + const LEAVE_FULLSCREEN: 'leavefullscreen'; /** * The Scale Manager Orientation Change Event. * * This event is dispatched whenever the Scale Manager detects an orientation change event from the browser. */ - const ORIENTATION_CHANGE: string; + const ORIENTATION_CHANGE: 'orientationchange'; /** * The Scale Manager Resize Event. @@ -125261,7 +123893,7 @@ declare namespace Phaser { * the `width`, `height`, `aspectRatio` and other properties of these components to help with * scaling your own game content. */ - const RESIZE: string; + const RESIZE: 'resize'; } @@ -125274,7 +123906,7 @@ declare namespace Phaser { /** * The game canvas is centered both horizontally and vertically within the parent. * To do this, the parent has to have a bounds that can be calculated and not be empty. - * + * * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. */ @@ -126690,7 +125322,7 @@ declare namespace Phaser { * * Listen for it from a Scene using `this.events.on('addedtoscene', listener)`. */ - const ADDED_TO_SCENE: string; + const ADDED_TO_SCENE: 'addedtoscene'; /** * The Scene Systems Boot Event. @@ -126699,7 +125331,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('boot', listener)`. */ - const BOOT: string; + const BOOT: 'boot'; /** * The Scene Create Event. @@ -126712,7 +125344,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('create', listener)`. */ - const CREATE: string; + const CREATE: 'create'; /** * The Scene Systems Destroy Event. @@ -126723,7 +125355,7 @@ declare namespace Phaser { * * You should destroy any resources that may be in use by your Scene in this event handler. */ - const DESTROY: string; + const DESTROY: 'destroy'; /** * The Scene Systems Pause Event. @@ -126733,7 +125365,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('pause', listener)`. */ - const PAUSE: string; + const PAUSE: 'pause'; /** * The Scene Systems Post Update Event. @@ -126753,7 +125385,7 @@ declare namespace Phaser { * * A Scene will only run its step if it is active. */ - const POST_UPDATE: string; + const POST_UPDATE: 'postupdate'; /** * The Scene Systems Pre-Render Event. @@ -126775,7 +125407,7 @@ declare namespace Phaser { * * This event is dispatched after the Scene Display List is sorted and before the Scene is rendered. */ - const PRE_RENDER: string; + const PRE_RENDER: 'prerender'; /** * The Scene Systems Pre Update Event. @@ -126795,7 +125427,7 @@ declare namespace Phaser { * * A Scene will only run its step if it is active. */ - const PRE_UPDATE: string; + const PRE_UPDATE: 'preupdate'; /** * The Scene Systems Ready Event. @@ -126806,7 +125438,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('ready', listener)`. */ - const READY: string; + const READY: 'ready'; /** * The Game Object Removed from Scene Event. @@ -126815,7 +125447,7 @@ declare namespace Phaser { * * Listen for it from a Scene using `this.events.on('removedfromscene', listener)`. */ - const REMOVED_FROM_SCENE: string; + const REMOVED_FROM_SCENE: 'removedfromscene'; /** * The Scene Systems Render Event. @@ -126837,7 +125469,7 @@ declare namespace Phaser { * * By the time this event is dispatched, the Scene will have already been rendered. */ - const RENDER: string; + const RENDER: 'render'; /** * The Scene Systems Resume Event. @@ -126847,7 +125479,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('resume', listener)`. */ - const RESUME: string; + const RESUME: 'resume'; /** * The Scene Systems Shutdown Event. @@ -126860,7 +125492,7 @@ declare namespace Phaser { * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources. */ - const SHUTDOWN: string; + const SHUTDOWN: 'shutdown'; /** * The Scene Systems Sleep Event. @@ -126870,7 +125502,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('sleep', listener)`. */ - const SLEEP: string; + const SLEEP: 'sleep'; /** * The Scene Systems Start Event. @@ -126879,7 +125511,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('start', listener)`. */ - const START: string; + const START: 'start'; /** * The Scene Transition Complete Event. @@ -126899,7 +125531,7 @@ declare namespace Phaser { * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. */ - const TRANSITION_COMPLETE: string; + const TRANSITION_COMPLETE: 'transitioncomplete'; /** * The Scene Transition Init Event. @@ -126919,7 +125551,7 @@ declare namespace Phaser { * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. */ - const TRANSITION_INIT: string; + const TRANSITION_INIT: 'transitioninit'; /** * The Scene Transition Out Event. @@ -126936,7 +125568,7 @@ declare namespace Phaser { * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. */ - const TRANSITION_OUT: string; + const TRANSITION_OUT: 'transitionout'; /** * The Scene Transition Start Event. @@ -126959,7 +125591,7 @@ declare namespace Phaser { * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. */ - const TRANSITION_START: string; + const TRANSITION_START: 'transitionstart'; /** * The Scene Transition Wake Event. @@ -126977,7 +125609,7 @@ declare namespace Phaser { * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to. * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes. */ - const TRANSITION_WAKE: string; + const TRANSITION_WAKE: 'transitionwake'; /** * The Scene Systems Update Event. @@ -126997,7 +125629,7 @@ declare namespace Phaser { * * A Scene will only run its step if it is active. */ - const UPDATE: string; + const UPDATE: 'update'; /** * The Scene Systems Wake Event. @@ -127007,7 +125639,7 @@ declare namespace Phaser { * * Listen to it from a Scene using `this.events.on('wake', listener)`. */ - const WAKE: string; + const WAKE: 'wake'; } @@ -127022,7 +125654,7 @@ declare namespace Phaser { */ class BaseSound extends Phaser.Events.EventEmitter { /** - * + * * @param manager Reference to the current sound manager instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. @@ -127107,7 +125739,7 @@ declare namespace Phaser { /** * Play this sound, or a marked section of it. - * + * * It always plays the sound from the start. If you want to start playback from a specific time * you can set 'seek' setting of the config object, provided to this call, to that value. * @param markerName If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object. Default ''. @@ -127176,7 +125808,7 @@ declare namespace Phaser { */ class BaseSoundManager extends Phaser.Events.EventEmitter { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -127221,9 +125853,9 @@ declare namespace Phaser { /** * The Spatial Audio listener position. - * + * * Only available with WebAudio. - * + * * You can modify the x/y properties of this Vec2 directly to * adjust the listener position within the game world. */ @@ -127257,7 +125889,7 @@ declare namespace Phaser { /** * Gets all sounds in this Sound Manager. - * + * * You can optionally specify a key, in which case only Sound instances that match the given key * will be returned. * @param key Optional asset key. If given, only Sound instances with this key will be returned. @@ -127275,9 +125907,9 @@ declare namespace Phaser { /** * Adds a new sound to the sound manager and plays it. - * + * * The sound will be automatically removed (destroyed) once playback ends. - * + * * This lets you play a new sound on the fly without the need to keep a reference to it. * @param key Asset key for the sound. * @param extra An optional additional object containing settings to be applied to the sound. It could be either config or marker object. @@ -127333,7 +125965,7 @@ declare namespace Phaser { * If you call this method with no parameters it will default to the center-point of * the game canvas. Depending on the type of game you're making, you may need to call * this method constantly to reset the listener position as the camera scrolls. - * + * * Calling this method does nothing on HTML5Audio. * @param x The x position of the Spatial Audio listener. * @param y The y position of the Spatial Audio listener. @@ -127354,7 +125986,7 @@ declare namespace Phaser { /** * When a key is given, returns true if any sound with that key is playing. - * + * * When no key is given, returns true if any sound is playing. * @param key Sound asset key. * @returns - Per the key argument, true if any matching sound is playing, otherwise false. @@ -127364,7 +125996,7 @@ declare namespace Phaser { /** * Method used internally for unlocking audio playback on devices that * require user interaction before any sound can be played on a web page. - * + * * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). */ protected unlock(): void; @@ -127396,7 +126028,7 @@ declare namespace Phaser { /** * Sets the global playback rate at which all the sounds will be played. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audios playback speed. * @param value Global playback rate at which all the sounds will be played. @@ -127455,74 +126087,74 @@ declare namespace Phaser { namespace Events { /** * The Sound Complete Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they complete playback. - * + * * Listen to it from a Sound instance using `Sound.on('complete', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('complete', listener); * music.play(); * ``` */ - const COMPLETE: string; + const COMPLETE: 'complete'; /** * The Audio Data Decoded All Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method, * once all files passed to the method have been decoded (or errored). - * + * * Use `Phaser.Sound.Events#DECODED` to listen for single sounds being decoded, and `DECODED_ALL` to * listen for them all completing. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decodedall', listener)`, i.e.: - * + * * ```javascript * this.sound.once('decodedall', handler); * this.sound.decodeAudio([ audioFiles ]); * ``` */ - const DECODED_ALL: string; + const DECODED_ALL: 'decodedall'; /** * The Audio Data Decoded Event. - * + * * This event is dispatched by the Web Audio Sound Manager as a result of calling the `decodeAudio` method. - * + * * Listen to it from the Sound Manager in a Scene using `this.sound.on('decoded', listener)`, i.e.: - * + * * ```javascript * this.sound.on('decoded', handler); * this.sound.decodeAudio(key, audioData); * ``` */ - const DECODED: string; + const DECODED: 'decoded'; /** * The Sound Destroy Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are destroyed, either * directly or via a Sound Manager. - * + * * Listen to it from a Sound instance using `Sound.on('destroy', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('destroy', listener); * music.destroy(); * ``` */ - const DESTROY: string; + const DESTROY: 'destroy'; /** * The Sound Detune Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their detune value changes. - * + * * Listen to it from a Sound instance using `Sound.on('detune', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('detune', listener); @@ -127530,92 +126162,92 @@ declare namespace Phaser { * music.setDetune(200); * ``` */ - const DETUNE: string; + const DETUNE: 'detune'; /** * The Sound Manager Global Detune Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `detune` property of the Sound Manager is changed, which globally * adjusts the detuning of all active sounds. * * Listen to it from a Scene using: `this.sound.on('detune', listener)`. */ - const GLOBAL_DETUNE: string; + const GLOBAL_DETUNE: 'detune'; /** * The Sound Manager Global Mute Event. - * + * * This event is dispatched by the Sound Manager when its `mute` property is changed, either directly * or via the `setMute` method. This changes the mute state of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('mute', listener)`. */ - const GLOBAL_MUTE: string; + const GLOBAL_MUTE: 'mute'; /** * The Sound Manager Global Rate Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `rate` property of the Sound Manager is changed, which globally * adjusts the playback rate of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('rate', listener)`. */ - const GLOBAL_RATE: string; + const GLOBAL_RATE: 'rate'; /** * The Sound Manager Global Volume Event. - * + * * This event is dispatched by the Sound Manager when its `volume` property is changed, either directly * or via the `setVolume` method. This changes the volume of all active sounds. - * + * * Listen to it from a Scene using: `this.sound.on('volume', listener)`. */ - const GLOBAL_VOLUME: string; + const GLOBAL_VOLUME: 'volume'; /** * The Sound Looped Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they loop during playback. - * + * * Listen to it from a Sound instance using `Sound.on('looped', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('looped', listener); * music.setLoop(true); * music.play(); * ``` - * + * * This is not to be confused with the [LOOP]{@linkcode Phaser.Sound.Events#event:LOOP} event, which only emits when the loop state of a Sound is changed. */ - const LOOPED: string; + const LOOPED: 'looped'; /** * The Sound Loop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their loop state is changed. - * + * * Listen to it from a Sound instance using `Sound.on('loop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('loop', listener); * music.setLoop(true); * ``` - * + * * This is not to be confused with the [LOOPED]{@linkcode Phaser.Sound.Events#event:LOOPED} event, which emits each time a Sound loops during playback. */ - const LOOP: string; + const LOOP: 'loop'; /** * The Sound Mute Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their mute state changes. - * + * * Listen to it from a Sound instance using `Sound.on('mute', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('mute', listener); @@ -127623,15 +126255,15 @@ declare namespace Phaser { * music.setMute(true); * ``` */ - const MUTE: string; + const MUTE: 'mute'; /** * The Sound Pan Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their pan changes. - * + * * Listen to it from a Sound instance using `Sound.on('pan', listener)`, i.e.: - * + * * ```javascript * var sound = this.sound.add('key'); * sound.on('pan', listener); @@ -127639,26 +126271,26 @@ declare namespace Phaser { * sound.setPan(0.5); * ``` */ - const PAN: string; + const PAN: 'pan'; /** * The Pause All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `pauseAll` method is invoked and after all current Sounds * have been paused. - * + * * Listen to it from a Scene using: `this.sound.on('pauseall', listener)`. */ - const PAUSE_ALL: string; + const PAUSE_ALL: 'pauseall'; /** * The Sound Pause Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are paused. - * + * * Listen to it from a Sound instance using `Sound.on('pause', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('pause', listener); @@ -127666,30 +126298,30 @@ declare namespace Phaser { * music.pause(); * ``` */ - const PAUSE: string; + const PAUSE: 'pause'; /** * The Sound Play Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are played. - * + * * Listen to it from a Sound instance using `Sound.on('play', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('play', listener); * music.play(); * ``` */ - const PLAY: string; + const PLAY: 'play'; /** * The Sound Rate Change Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their rate changes. - * + * * Listen to it from a Sound instance using `Sound.on('rate', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('rate', listener); @@ -127697,26 +126329,26 @@ declare namespace Phaser { * music.setRate(0.5); * ``` */ - const RATE: string; + const RATE: 'rate'; /** * The Resume All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `resumeAll` method is invoked and after all current Sounds * have been resumed. - * + * * Listen to it from a Scene using: `this.sound.on('resumeall', listener)`. */ - const RESUME_ALL: string; + const RESUME_ALL: 'resumeall'; /** * The Sound Resume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are resumed from a paused state. - * + * * Listen to it from a Sound instance using `Sound.on('resume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('resume', listener); @@ -127725,15 +126357,15 @@ declare namespace Phaser { * music.resume(); * ``` */ - const RESUME: string; + const RESUME: 'resume'; /** * The Sound Seek Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are seeked to a new position. - * + * * Listen to it from a Sound instance using `Sound.on('seek', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('seek', listener); @@ -127741,26 +126373,26 @@ declare namespace Phaser { * music.setSeek(5000); * ``` */ - const SEEK: string; + const SEEK: 'seek'; /** * The Stop All Sounds Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched when the `stopAll` method is invoked and after all current Sounds * have been stopped. - * + * * Listen to it from a Scene using: `this.sound.on('stopall', listener)`. */ - const STOP_ALL: string; + const STOP_ALL: 'stopall'; /** * The Sound Stop Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when they are stopped. - * + * * Listen to it from a Sound instance using `Sound.on('stop', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('stop', listener); @@ -127768,26 +126400,26 @@ declare namespace Phaser { * music.stop(); * ``` */ - const STOP: string; + const STOP: 'stop'; /** * The Sound Manager Unlocked Event. - * + * * This event is dispatched by the Base Sound Manager, or more typically, an instance of the Web Audio Sound Manager, * or the HTML5 Audio Manager. It is dispatched during the update loop when the Sound Manager becomes unlocked. For * Web Audio this is on the first user gesture on the page. - * + * * Listen to it from a Scene using: `this.sound.on('unlocked', listener)`. */ - const UNLOCKED: string; + const UNLOCKED: 'unlocked'; /** * The Sound Volume Event. - * + * * This event is dispatched by both Web Audio and HTML5 Audio Sound objects when their volume changes. - * + * * Listen to it from a Sound instance using `Sound.on('volume', listener)`, i.e.: - * + * * ```javascript * var music = this.sound.add('key'); * music.on('volume', listener); @@ -127795,7 +126427,7 @@ declare namespace Phaser { * music.setVolume(0.5); * ``` */ - const VOLUME: string; + const VOLUME: 'volume'; } @@ -127817,7 +126449,7 @@ declare namespace Phaser { */ class HTML5AudioSound extends Phaser.Sound.BaseSound { /** - * + * * @param manager Reference to the current sound manager instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. Default {}. @@ -127851,10 +126483,10 @@ declare namespace Phaser { /** * Play this sound, or a marked section of it. - * + * * It always plays the sound from the start. If you want to start playback from a specific time * you can set 'seek' setting of the config object, provided to this call, to that value. - * + * * If you want to play the same sound simultaneously, then you need to create another instance * of it and play that Sound. For HTML5 Audio this also requires creating multiple audio instances * when loading the audio files. @@ -127988,7 +126620,7 @@ declare namespace Phaser { /** * Sets the playback rate of this Sound. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audio's playback speed. * @param value The playback rate of this Sound. @@ -128039,14 +126671,14 @@ declare namespace Phaser { /** * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Has no audible effect on HTML5 Audio Sound, but still generates the PAN Event. */ pan: number; /** * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Has no audible effect on HTML5 Audio Sound, but still generates the PAN Event. * @param value The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). * @returns This Sound instance. @@ -128060,7 +126692,7 @@ declare namespace Phaser { */ class HTML5AudioSoundManager extends Phaser.Sound.BaseSoundManager { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -128077,7 +126709,7 @@ declare namespace Phaser { * Value representing time difference, in seconds, between calling * play method on an audio tag and when it actually starts playing. * It is used to achieve more accurate delayed sound playback. - * + * * You might need to tweak this value to get the desired results * since audio play delay varies depending on the browser/platform. */ @@ -128087,7 +126719,7 @@ declare namespace Phaser { * A value by which we should offset the loop end marker of the * looping sound to compensate for lag, caused by changing audio * tag playback position, in order to achieve gapless looping. - * + * * You might need to tweak this value to get the desired results * since loop lag varies depending on the browser/platform. */ @@ -128169,14 +126801,14 @@ declare namespace Phaser { /** * No audio implementation of the sound. It is used if audio has been * disabled in the game config or the device doesn't support any audio. - * + * * It represents a graceful degradation of sound logic that provides * minimal functionality and prevents Phaser projects that use audio from * breaking on devices that don't support any audio playback technologies. */ class NoAudioSound extends Phaser.Events.EventEmitter { /** - * + * * @param manager Reference to the current sound manager instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. Default {}. @@ -128272,7 +126904,7 @@ declare namespace Phaser { /** * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. */ pan: number; @@ -128356,7 +126988,7 @@ declare namespace Phaser { /** * Sets the playback rate of this Sound. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audios playback speed. * @param value The playback rate of this Sound. @@ -128388,7 +127020,7 @@ declare namespace Phaser { /** * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Note: iOS / Safari doesn't support the stereo panner node. * @param value The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). * @returns This Sound instance. @@ -128427,14 +127059,14 @@ declare namespace Phaser { /** * No-audio implementation of the Sound Manager. It is used if audio has been * disabled in the game config or the device doesn't support any audio. - * + * * It represents a graceful degradation of Sound Manager logic that provides * minimal functionality and prevents Phaser projects that use audio from * breaking on devices that don't support any audio playback technologies. */ class NoAudioSoundManager extends Phaser.Sound.BaseSoundManager { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -128656,7 +127288,7 @@ declare namespace Phaser { */ class WebAudioSound extends Phaser.Sound.BaseSound { /** - * + * * @param manager Reference to the WebAudio Sound Manager that owns this Sound instance. * @param key Asset key for the sound. * @param config An optional config object containing default sound settings. Default {}. @@ -128710,34 +127342,34 @@ declare namespace Phaser { /** * The time at which the sound should have started playback from the beginning. - * + * * Treat this property as read-only. - * + * * Based on `BaseAudioContext.currentTime` value. */ playTime: number; /** * The time at which the sound source should have actually started playback. - * + * * Treat this property as read-only. - * + * * Based on `BaseAudioContext.currentTime` value. */ startTime: number; /** * The time at which the sound loop source should actually start playback. - * + * * Based on `BaseAudioContext.currentTime` value. */ loopTime: number; /** * An array where we keep track of all rate updates during playback. - * + * * Treat this property as read-only. - * + * * Array of object types: `{ time: number, rate: number }` */ rateUpdates: any[]; @@ -128756,10 +127388,10 @@ declare namespace Phaser { /** * Play this sound, or a marked section of it. - * + * * It always plays the sound from the start. If you want to start playback from a specific time * you can set 'seek' setting of the config object, provided to this call, to that value. - * + * * If you want to play the same sound simultaneously, then you need to create another instance * of it and play that Sound. * @param markerName If you want to play a marker then provide the marker name here. Alternatively, this parameter can be a SoundConfig object. Default ''. @@ -128816,9 +127448,9 @@ declare namespace Phaser { * Gets or sets the x position of this Sound in Spatial Audio space. * * This only has any effect if the sound was created with a SpatialSoundConfig object. - * + * * Also see the `WebAudioSoundManager.setListenerPosition` method. - * + * * If you find that the sound becomes too quiet, too quickly, as it moves away from * the listener, then try different `refDistance` property values when configuring * the spatial sound. @@ -128829,9 +127461,9 @@ declare namespace Phaser { * Gets or sets the y position of this Sound in Spatial Audio space. * * This only has any effect if the sound was created with a SpatialSoundConfig object. - * + * * Also see the `WebAudioSoundManager.setListenerPosition` method. - * + * * If you find that the sound becomes too quiet, too quickly, as it moves away from * the listener, then try different `refDistance` property values when configuring * the spatial sound. @@ -128874,7 +127506,7 @@ declare namespace Phaser { /** * Sets the playback rate of this Sound. - * + * * For example, a value of 1.0 plays the audio at full speed, 0.5 plays the audio at half speed * and 2.0 doubles the audio's playback speed. * @param value The playback rate of this Sound. @@ -128949,14 +127581,14 @@ declare namespace Phaser { /** * Gets or sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Always returns zero on iOS / Safari as it doesn't support the stereo panner node. */ pan: number; /** * Sets the pan of this sound, a value between -1 (full left pan) and 1 (full right pan). - * + * * Note: iOS / Safari doesn't support the stereo panner node. * @param value The pan of the sound. A value between -1 (full left pan) and 1 (full right pan). * @returns This Sound instance. @@ -128978,12 +127610,12 @@ declare namespace Phaser { * Phaser will fall back to the `HTML5AudioSoundManager` instead. * * Not all browsers can play all audio formats. - * + * * There is a good guide to what's supported: [Cross-browser audio basics: Audio codec support](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support). */ class WebAudioSoundManager extends Phaser.Sound.BaseSoundManager { /** - * + * * @param game Reference to the current game instance. */ constructor(game: Phaser.Game); @@ -129022,7 +127654,7 @@ declare namespace Phaser { /** * This method takes a new AudioContext reference and then sets * this Sound Manager to use that context for all playback. - * + * * As part of this call it also disconnects the master mute and volume * nodes and then re-creates them on the new given context. * @param context Reference to an already created AudioContext instance. @@ -129040,16 +127672,16 @@ declare namespace Phaser { /** * Decode audio data into a format ready for playback via Web Audio. - * + * * The audio data can be a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. - * + * * The `audioKey` is the key that will be used to save the decoded audio to the audio cache. - * + * * Instead of passing a single entry you can instead pass an array of `Phaser.Types.Sound.DecodeAudioConfig` * objects as the first and only argument. - * + * * Decoding is an async process, so be sure to listen for the events to know when decoding has completed. - * + * * Once the audio has decoded it can be added to the Sound Manager or played via its key. * @param audioKey The string-based key to be used to reference the decoded audio in the audio cache, or an array of audio config objects. * @param audioData The audio data, either a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance. @@ -129062,7 +127694,7 @@ declare namespace Phaser { * If you call this method with no parameters it will default to the center-point of * the game canvas. Depending on the type of game you're making, you may need to call * this method constantly to reset the listener position as the camera scrolls. - * + * * Calling this method does nothing on HTML5Audio. * @param x The x position of the Spatial Audio listener. * @param y The y position of the Spatial Audio listener. @@ -129071,7 +127703,7 @@ declare namespace Phaser { /** * Unlocks Web Audio API on the initial input event. - * + * * Read more about how this issue is handled here in [this article](https://medium.com/@pgoloskokovic/unlocking-web-audio-the-smarter-way-8858218c0e09). */ unlock(): void; @@ -129090,7 +127722,7 @@ declare namespace Phaser { /** * Update method called on every game step. - * + * * Removes destroyed sounds and updates every active sound in the game. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time elapsed since the last frame. @@ -129137,7 +127769,7 @@ declare namespace Phaser { */ class List { /** - * + * * @param parent The parent of this list. */ constructor(parent: any); @@ -129243,15 +127875,15 @@ declare namespace Phaser { /** * Returns all children in this List. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. - * + * * For example: `getAll('parent')` would return only children that have a property called `parent`. - * + * * You can also specify a value to compare the property to: - * + * * `getAll('visible', true)` would return only children that have their visible property set to `true`. - * + * * Optionally you can specify a start and end index. For example if this List had 100 children, * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only * the first 50 children in the List. @@ -129435,14 +128067,14 @@ declare namespace Phaser { /** * The next item in the List, or `null` if the entire List has been traversed. - * + * * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. */ readonly next: T; /** * The previous item in the List, or `null` if the entire List has been traversed. - * + * * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. */ readonly previous: T; @@ -129465,7 +128097,7 @@ declare namespace Phaser { */ class Map { /** - * + * * @param elements An optional array of key-value pairs to populate this Map with. */ constructor(elements: V[]); @@ -129491,9 +128123,9 @@ declare namespace Phaser { /** * Adds an element with a specified `key` and `value` to this Map. - * + * * If the `key` already exists, the value will be replaced. - * + * * If you wish to add multiple elements in a single call, use the `setAll` method instead. * @param key The key of the element to be added to this Map. * @param value The value of the element to be added to this Map. @@ -129553,7 +128185,7 @@ declare namespace Phaser { /** * Iterates through all entries in this Map, passing each one to the given callback. - * + * * If the callback returns `false`, the iteration will break. * @param callback The callback which will receive the keys and entries held in this Map. * @returns This Map object. @@ -129580,11 +128212,11 @@ declare namespace Phaser { /** * A Process Queue maintains three internal lists. - * + * * The `pending` list is a selection of items which are due to be made 'active' in the next update. * The `active` list is a selection of items which are considered active and should be updated. * The `destroy` list is a selection of items that were active and are awaiting being destroyed in the next update. - * + * * When new items are added to a Process Queue they are put in the pending list, rather than being added * immediately to the active list. Equally, items that are removed are put into the destroy list, rather than * being destroyed immediately. This allows the Process Queue to carefully process each item at a specific, fixed @@ -129627,7 +128259,7 @@ declare namespace Phaser { /** * Adds a new item to the Process Queue. - * + * * The item is added to the pending list and made active in the next update. * @param item The item to add to the queue. * @returns The item that was added. @@ -129636,7 +128268,7 @@ declare namespace Phaser { /** * Removes an item from the Process Queue. - * + * * The item is added to the 'destroy' list and is fully removed in the next update. * @param item The item to be removed from the queue. * @returns The item that was removed. @@ -129653,7 +128285,7 @@ declare namespace Phaser { /** * Update this queue. First it will process any items awaiting destruction, and remove them. - * + * * Then it will check to see if there are any items pending insertion, and move them to an * active state. Finally, it will return a list of active items for further processing.undefined * @returns A list of active items. @@ -129662,7 +128294,7 @@ declare namespace Phaser { /** * Returns the current list of active items. - * + * * This method returns a reference to the active list array, not a copy of it. * Therefore, be careful to not modify this array outside of the ProcessQueue.undefined * @returns A list of active items. @@ -129684,10 +128316,10 @@ declare namespace Phaser { /** * RBush is a high-performance JavaScript library for 2D spatial indexing of points and rectangles. * It's based on an optimized R-tree data structure with bulk insertion support. - * + * * Spatial index is a special data structure for points and rectangles that allows you to perform queries like * "all items within this bounding box" very efficiently (e.g. hundreds of times faster than looping over all items). - * + * * This version of RBush uses a fixed min/max accessor structure of `[ '.left', '.top', '.right', '.bottom' ]`. * This is to avoid the eval-like function creation that the original library used, which caused CSP policy violations. * @@ -129804,14 +128436,14 @@ declare namespace Phaser { /** * The Size component allows you to set `width` and `height` properties and define the relationship between them. - * + * * The component can automatically maintain the aspect ratios between the two values, and clamp them * to a defined min-max range. You can also control the dominant axis. When dimensions are given to the Size component * that would cause it to exceed its min-max range, the dimensions are adjusted based on the dominant axis. */ class Size { /** - * + * * @param width The width of the Size component. Default 0. * @param height The height of the Size component. If not given, it will use the `width`. Default width. * @param aspectMode The aspect mode of the Size component. Defaults to 0, no mode. Default 0. @@ -129827,7 +128459,7 @@ declare namespace Phaser { /** * The proportional relationship between the width and height. - * + * * This property is read-only and is updated automatically when either the `width` or `height` properties are changed, * depending on the aspect mode. */ @@ -129861,26 +128493,26 @@ declare namespace Phaser { /** * A Vector2 containing the horizontal and vertical snap values, which the width and height are snapped to during resizing. - * + * * By default this is disabled. - * + * * This property is read-only. To change it see the `setSnap` method. */ readonly snapTo: Phaser.Math.Vector2; /** * Sets the aspect mode of this Size component. - * + * * The aspect mode controls what happens when you modify the `width` or `height` properties, or call `setSize`. - * + * * It can be a number from 0 to 4, or a Size constant: - * + * * 0. NONE = Do not make the size fit the aspect ratio. Change the ratio when the size changes. * 1. WIDTH_CONTROLS_HEIGHT = The height is automatically adjusted based on the width. * 2. HEIGHT_CONTROLS_WIDTH = The width is automatically adjusted based on the height. * 3. FIT = The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. * 4. ENVELOP = The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. * @param value The aspect mode value. Default 0. * @returns This Size component instance. @@ -129891,12 +128523,12 @@ declare namespace Phaser { * By setting snap values, when this Size component is modified its dimensions will automatically * be snapped to the nearest grid slice, using floor. For example, if you have snap value of 16, * and the width changes to 68, then it will snap down to 64 (the closest multiple of 16 when floored) - * + * * Note that snapping takes place before adjustments by the parent, or the min / max settings. If these * values are not multiples of the given snap values, then this can result in un-snapped dimensions. - * + * * Call this method with no arguments to reset the snap values. - * + * * Calling this method automatically recalculates the `width` and the `height`, if required. * @param snapWidth The amount to snap the width to. If you don't want to snap the width, pass a value of zero. Default 0. * @param snapHeight The amount to snap the height to. If not provided it will use the `snapWidth` value. If you don't want to snap the height, pass a value of zero. Default snapWidth. @@ -129906,18 +128538,18 @@ declare namespace Phaser { /** * Sets, or clears, the parent of this Size component. - * + * * To clear the parent call this method with no arguments. - * + * * The parent influences the maximum extents to which this Size component can expand, * based on the aspect mode: - * + * * NONE - The parent clamps both the width and height. * WIDTH_CONTROLS_HEIGHT - The parent clamps just the width. * HEIGHT_CONTROLS_WIDTH - The parent clamps just the height. * FIT - The parent clamps whichever axis is required to ensure the size fits within it. * ENVELOP - The parent is used to ensure the size fully envelops the parent. - * + * * Calling this method automatically calls `setSize`. * @param parent Sets the parent of this Size component. Don't provide a value to clear an existing parent. * @returns This Size component instance. @@ -129926,11 +128558,11 @@ declare namespace Phaser { /** * Set the minimum width and height values this Size component will allow. - * + * * The minimum values can never be below zero, or greater than the maximum values. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the minimums set here * _can_ be exceeded in some situations. * @param width The minimum allowed width of the Size component. Default 0. @@ -129941,9 +128573,9 @@ declare namespace Phaser { /** * Set the maximum width and height values this Size component will allow. - * + * * Setting this will automatically adjust both the `width` and `height` properties to ensure they are within range. - * + * * Note that based on the aspect mode, and if this Size component has a parent set or not, the maximums set here * _can_ be exceeded in some situations. * @param width The maximum allowed width of the Size component. Default Number.MAX_VALUE. @@ -129954,16 +128586,16 @@ declare namespace Phaser { /** * Sets the width and height of this Size component based on the aspect mode. - * + * * If the aspect mode is 'none' then calling this method will change the aspect ratio, otherwise the current * aspect ratio is honored across all other modes. - * + * * If snapTo values have been set then the given width and height are snapped first, prior to any further * adjustment via min/max values, or a parent. - * + * * If minimum and/or maximum dimensions have been specified, the values given to this method will be clamped into * that range prior to adjustment, but may still exceed them depending on the aspect mode. - * + * * If this Size component has a parent set, and the aspect mode is `fit` or `envelop`, then the given sizes will * be clamped to the range specified by the parent. * @param width The new width of the Size component. Default 0. @@ -129974,7 +128606,7 @@ declare namespace Phaser { /** * Sets a new aspect ratio, overriding what was there previously. - * + * * It then calls `setSize` immediately using the current dimensions. * @param ratio The new aspect ratio. * @returns This Size component instance. @@ -129983,7 +128615,7 @@ declare namespace Phaser { /** * Sets a new width and height for this Size component and updates the aspect ratio based on them. - * + * * It _doesn't_ change the `aspectMode` and still factors in size limits such as the min max and parent bounds. * @param width The new width of the Size component. * @param height The new height of the Size component. If not given, it will use the `width`. Default width. @@ -130009,10 +128641,10 @@ declare namespace Phaser { /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * If `fit` is true there may be some space inside the target area which is not covered if its aspect ratio differs. * If `fit` is false the size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @param width The new width of the Size component. Default 0. @@ -130024,9 +128656,9 @@ declare namespace Phaser { /** * The current `width` and `height` are adjusted to fit inside the given dimensions, while keeping the aspect ratio. - * + * * There may be some space inside the target area which is not covered if its aspect ratio differs. - * + * * If this Size component has a parent set, then the width and height passed to this method will be clamped so * it cannot exceed that of the parent. * @param width The new width of the Size component. Default 0. @@ -130037,9 +128669,9 @@ declare namespace Phaser { /** * The current `width` and `height` are adjusted so that they fully envelope the given dimensions, while keeping the aspect ratio. - * + * * The size may extend further out than the target area if the aspect ratios differ. - * + * * If this Size component has a parent set, then the values are clamped so that it never exceeds the parent * on the longest axis. * @param width The new width of the Size component. Default 0. @@ -130050,7 +128682,7 @@ declare namespace Phaser { /** * Sets the width of this Size component. - * + * * Depending on the aspect mode, changing the width may also update the height and aspect ratio. * @param value The new width of the Size component. * @returns This Size component instance. @@ -130059,7 +128691,7 @@ declare namespace Phaser { /** * Sets the height of this Size component. - * + * * Depending on the aspect mode, changing the height may also update the width and aspect ratio. * @param value The new height of the Size component. * @returns This Size component instance. @@ -130089,20 +128721,20 @@ declare namespace Phaser { /** * Destroys this Size component. - * + * * This clears the local properties and any parent object, if set. - * + * * A destroyed Size component cannot be re-used. */ destroy(): void; /** * The width of this Size component. - * + * * This value is clamped to the range specified by `minWidth` and `maxWidth`, if enabled. - * + * * A width can never be less than zero. - * + * * Changing this value will automatically update the `height` if the aspect ratio lock is enabled. * You can also use the `setWidth` method. */ @@ -130110,11 +128742,11 @@ declare namespace Phaser { /** * The height of this Size component. - * + * * This value is clamped to the range specified by `minHeight` and `maxHeight`, if enabled. - * + * * A height can never be less than zero. - * + * * Changing this value will automatically update the `width` if the aspect ratio lock is enabled. * You can also use the `setHeight` method. */ @@ -130157,7 +128789,7 @@ declare namespace Phaser { * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('add', listener)`. */ - const PROCESS_QUEUE_ADD: string; + const PROCESS_QUEUE_ADD: 'add'; /** * The Process Queue Remove Event. @@ -130168,7 +128800,7 @@ declare namespace Phaser { * * In that instance, listen to this event from within a Scene using: `this.sys.updateList.on('remove', listener)`. */ - const PROCESS_QUEUE_REMOVE: string; + const PROCESS_QUEUE_REMOVE: 'remove'; } @@ -130177,26 +128809,26 @@ declare namespace Phaser { namespace Textures { /** * A Canvas Texture is a special kind of Texture that is backed by an HTML Canvas Element as its source. - * + * * You can use the properties of this texture to draw to the canvas element directly, using all of the standard * canvas operations available in the browser. Any Game Object can be given this texture and will render with it. - * + * * Note: When running under WebGL the Canvas Texture needs to re-generate its base WebGLTexture and reupload it to * the GPU every time you modify it, otherwise the changes you make to this texture will not be visible. To do this * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading * texture data to it. This restriction does not apply if using the Canvas Renderer. - * + * * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify * sections of the canvas using the `add` method. - * + * * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause * graphical errors. */ class CanvasTexture extends Phaser.Textures.Texture { /** - * + * * @param manager A reference to the Texture Manager this Texture belongs to. * @param key The unique string-based key of this Texture. * @param source The canvas element that is used as the base of this texture. @@ -130284,7 +128916,7 @@ declare namespace Phaser { /** * Sets a pixel in the CanvasTexture to the given color and alpha values. - * + * * This is an expensive operation to run in large quantities, so use sparingly. * @param x The x coordinate of the pixel to set. Must lay within the dimensions of this CanvasTexture and be an integer. * @param y The y coordinate of the pixel to set. Must lay within the dimensions of this CanvasTexture and be an integer. @@ -130322,7 +128954,7 @@ declare namespace Phaser { /** * Get the color of a specific pixel from this texture and store it in a Color object. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. @@ -130334,10 +128966,10 @@ declare namespace Phaser { /** * Returns an array containing all of the pixels in the given region. - * + * * If the requested region extends outside the bounds of this CanvasTexture, * the region is truncated to fit. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * @param x The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. Default 0. @@ -130350,9 +128982,9 @@ declare namespace Phaser { /** * Returns the Image Data index for the given pixel in this CanvasTexture. - * + * * The index can be used to read directly from the `this.data` array. - * + * * The index points to the red value in the array. The subsequent 3 indexes * point to green, blue and alpha respectively. * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. @@ -130411,24 +129043,24 @@ declare namespace Phaser { /** * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of * Game Objects directly to it. - * + * * You can take many complex objects and draw them to this one texture, which can then be used as the * base texture for other Game Objects, such as Sprites. Should you then update this texture, all * Game Objects using it will instantly be updated as well, reflecting the changes immediately. - * + * * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke * expensive GPU uploads on each change. - * + * * ```js * const t = this.textures.addDynamicTexture('player', 64, 128); * // draw objects to t * this.add.sprite(x, y, 'player'); * this.render(); * ``` - * + * * Because this is a standard Texture within Phaser, you can add frames to it, meaning you can use it * to generate sprite sheets, texture atlases or tile sets. - * + * * Under WebGL1, a FrameBuffer, which is what this Dynamic Texture uses internally, cannot be anti-aliased. * This means that when drawing objects such as Shapes or Graphics instances to this texture, they may appear * to be drawn with no aliasing around the edges. This is a technical limitation of WebGL1. To get around it, @@ -130448,7 +129080,7 @@ declare namespace Phaser { */ class DynamicTexture extends Phaser.Textures.Texture { /** - * + * * @param manager A reference to the Texture Manager this Texture belongs to. * @param key The unique string-based key of this Texture. * @param width The width of this Dynamic Texture in pixels. Defaults to 256 x 256. Default 256. @@ -130469,14 +129101,14 @@ declare namespace Phaser { /** * The width of this Dynamic Texture. - * + * * Treat this property as read-only. Use the `setSize` method to change the size. */ width: number; /** * The height of this Dynamic Texture. - * + * * Treat this property as read-only. Use the `setSize` method to change the size. */ height: number; @@ -130500,10 +129132,10 @@ declare namespace Phaser { /** * An internal Camera that can be used to move around this Dynamic Texture. - * + * * Control it just like you would any Scene Camera. The difference is that it only impacts * the placement of **Game Objects** (not textures) that you then draw to this texture. - * + * * You can scroll, zoom and rotate this Camera. */ camera: Phaser.Cameras.Scene2D.Camera; @@ -130516,12 +129148,12 @@ declare namespace Phaser { /** * Resizes this Dynamic Texture to the new dimensions given. - * + * * In WebGL it will destroy and then re-create the frame buffer being used by this Dynamic Texture. * In Canvas it will resize the underlying canvas DOM element. - * + * * Both approaches will erase everything currently drawn to this texture. - * + * * If the dimensions given are the same as those already being used, calling this method will do nothing. * @param width The new width of this Dynamic Texture. * @param height The new height of this Dynamic Texture. If not specified, will be set the same as the `width`. Default width. @@ -130539,10 +129171,10 @@ declare namespace Phaser { /** * Fills this Dynamic Texture with the given color. - * + * * By default it will fill the entire texture, however you can set it to fill a specific * rectangular area by using the x, y, width and height arguments. - * + * * The color should be given in hex format, i.e. 0xff0000 for red, 0x00ff00 for green, etc. * @param rgb The color to fill this Dynamic Texture with, such as 0xff0000 for red. * @param alpha The alpha value used by the fill. Default 1. @@ -130570,9 +129202,9 @@ declare namespace Phaser { * x and y coordinates. You can use the optional 'config' argument to provide * lots more options about how the stamp is applied, including the alpha, * tint, angle, scale and origin. - * + * * By default, the frame will stamp on the x/y coordinates based on its center. - * + * * If you wish to stamp from the top-left, set the config `originX` and * `originY` properties both to zero. * @@ -130603,9 +129235,9 @@ declare namespace Phaser { /** * Draws the given object, or an array of objects, to this Dynamic Texture. - * + * * It can accept any of the following: - * + * * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. * * Tilemap Layers. * * A Group. The contents of which will be iterated and drawn in turn. @@ -130614,7 +129246,7 @@ declare namespace Phaser { * * Another Dynamic Texture, or a Render Texture. * * A Texture Frame instance. * * A string. This is used to look-up the texture from the Texture Manager. - * + * * Note 1: You cannot draw a Dynamic Texture to itself. * * Note 2: GameObjects will use the camera, while textures and frames will not. @@ -130623,14 +129255,14 @@ declare namespace Phaser { * If passing in a Group or Container it will only draw children that return `true` * when their `willRender()` method is called. I.e. a Container with 10 children, * 5 of which have `visible=false` will only draw the 5 visible ones. - * + * * If passing in an array of Game Objects it will draw them all, regardless if * they pass a `willRender` check or not. - * + * * You can pass in a string in which case it will look for a texture in the Texture * Manager matching that string, and draw the base frame. If you need to specify * exactly which frame to draw then use the method `drawFrame` instead. - * + * * You can pass in the `x` and `y` coordinates to draw the objects at. The use of * the coordinates differ based on what objects are being drawn. If the object is * a Group, Container or Display List, the coordinates are _added_ to the positions @@ -130683,11 +129315,11 @@ declare namespace Phaser { * It uses a `TileSprite` internally to draw the frame repeatedly. * * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * + * * You can optionally provide a position, width, height, alpha and tint value to apply to * the frames before they are drawn. The position controls the top-left where the repeating * fill will start from. The width and height control the size of the filled area. - * + * * The position can be negative if required, but the dimensions cannot. * * This method respects the camera settings of the Dynamic Texture. @@ -130728,16 +129360,16 @@ declare namespace Phaser { /** * Takes a snapshot of the given area of this Dynamic Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Dynamic Texture see the `snapshot` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Dynamic Texture has, so please be careful how you employ this in your game. * @param x The x coordinate to grab from. @@ -130753,16 +129385,16 @@ declare namespace Phaser { /** * Takes a snapshot of the whole of this Dynamic Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture a portion of this Dynamic Texture see the `snapshotArea` method. * To capture just a specific pixel, see the `snapshotPixel` method. - * + * * Snapshots work by using the WebGL `readPixels` feature to grab every pixel from the frame buffer * into an ArrayBufferView. It then parses this, copying the contents to a temporary Canvas and finally * creating an Image object from it, which is the image returned to the callback provided. - * + * * All in all, this is a computationally expensive and blocking process, which gets more expensive * the larger the resolution this Dynamic Texture has, so please be careful how you employ this in your game. * @param callback The Function to invoke after the snapshot image is created. @@ -130774,12 +129406,12 @@ declare namespace Phaser { /** * Takes a snapshot of the given pixel from this Dynamic Texture. - * + * * The snapshot is taken immediately, but the results are returned via the given callback. - * + * * To capture the whole Dynamic Texture see the `snapshot` method. * To capture a portion of this Dynamic Texture see the `snapshotArea` method. - * + * * Unlike the two other snapshot methods, this one will send your callback a `Color` object * containing the color data for the requested pixel. It doesn't need to create an internal * Canvas or Image object, so is a lot faster to execute, using less memory than the other snapshot methods. @@ -130830,7 +129462,7 @@ declare namespace Phaser { */ class Frame { /** - * + * * @param texture The Texture this Frame is a part of. * @param name The name of this Frame. The name is unique within the Texture. * @param sourceIndex The index of the TextureSource that this Frame is a part of. @@ -130999,7 +129631,7 @@ declare namespace Phaser { /** * Sets the width, height, x and y of this Frame. - * + * * This is called automatically by the constructor * and should rarely be changed on-the-fly. * @param width The width of the frame before being trimmed. @@ -131024,9 +129656,9 @@ declare namespace Phaser { /** * Sets the scale9 center rectangle values. - * + * * Scale9 is a feature of Texture Packer, allowing you to define a nine-slice scaling grid. - * + * * This is set automatically by the JSONArray and JSONHash parsers. * @param x The left coordinate of the center scale9 rectangle. * @param y The top coordinate of the center scale9 rectangle. @@ -131067,7 +129699,7 @@ declare namespace Phaser { /** * Directly sets the canvas and WebGL UV data for this frame. - * + * * Use this if you need to override the values that are generated automatically * when the Frame is created. * @param width Width of this frame for the Canvas data. @@ -131154,18 +129786,18 @@ declare namespace Phaser { * The Frames represent the different areas of the Texture. For example a texture atlas * may have many Frames, one for each element within the atlas. Where-as a single image would have * just one frame, that encompasses the whole image. - * + * * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. * This frame represents the entirety of the source image. - * + * * Textures are managed by the global TextureManager. This is a singleton class that is * responsible for creating and delivering Textures and their corresponding Frames to Game Objects. - * + * * Sprites and other Game Objects get the texture data they need from the TextureManager. */ class Texture { /** - * + * * @param manager A reference to the Texture Manager this Texture belongs to. * @param key The unique string-based key of this Texture. * @param source An array of sources that are used to create the texture. Usually Images, but can also be a Canvas. @@ -131214,7 +129846,7 @@ declare namespace Phaser { /** * The total number of Frames in this Texture, including the `__BASE` frame. - * + * * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. */ @@ -131231,9 +129863,9 @@ declare namespace Phaser { /** * Adds a new Frame to this Texture. - * + * * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. - * + * * The name given must be unique within this Texture. If it already exists, this method will return `null`. * @param name The name of this Frame. The name is unique within the Texture. * @param sourceIndex The index of the TextureSource that this Frame is a part of. @@ -131247,7 +129879,7 @@ declare namespace Phaser { /** * Removes the given Frame from this Texture. The Frame is destroyed immediately. - * + * * Any Game Objects using this Frame should stop using it _before_ you remove it, * as it does not happen automatically. * @param name The key of the Frame to remove. @@ -131264,7 +129896,7 @@ declare namespace Phaser { /** * Gets a Frame from this Texture based on either the key or the index of the Frame. - * + * * In a Texture Atlas Frames are typically referenced by a key. * In a Sprite Sheet Frames are referenced by an index. * Passing no value for the name returns the base texture. @@ -131294,7 +129926,7 @@ declare namespace Phaser { /** * Based on the given Texture Source Index, this method will get all of the Frames using * that source and then work out the bounds that they encompass, returning them in an object. - * + * * This is useful if this Texture is, for example, a sprite sheet within an Atlas, and you * need to know the total bounds of the sprite sheet. * @param sourceIndex The index of the TextureSource to get the Frame bounds from. Default 0. @@ -131304,7 +129936,7 @@ declare namespace Phaser { /** * Returns an array with all of the names of the Frames in this Texture. - * + * * Useful if you want to randomly assign a Frame to a Game Object, as you can * pick a random element from the returned array. * @param includeBase Include the `__BASE` Frame in the output array? Default false. @@ -131314,7 +129946,7 @@ declare namespace Phaser { /** * Given a Frame name, return the source image it uses to render with. - * + * * This will return the actual DOM Image or Canvas element. * @param name The string-based name, or integer based index, of the Frame to get from this Texture. * @returns The DOM Image, Canvas Element or Render Texture. @@ -131324,7 +129956,7 @@ declare namespace Phaser { /** * Given a Frame name, return the data source image it uses to render with. * You can use this to get the normal map for an image for example. - * + * * This will return the actual DOM Image. * @param name The string-based name, or integer based index, of the Frame to get from this Texture. * @returns The DOM Image or Canvas Element. @@ -131352,7 +129984,7 @@ declare namespace Phaser { /** * Adds a data source image to this Texture. - * + * * An example of a data source image would be a normal map, where all of the Frames for this Texture * equally apply to the normal map. * @@ -131367,11 +129999,11 @@ declare namespace Phaser { /** * Sets the Filter Mode for this Texture. - * + * * The mode can be either Linear, the default, or Nearest. - * + * * For pixel-art you should use Nearest. - * + * * The mode applies to the entire Texture, not just a specific Frame of it. * @param filterMode The Filter Mode. */ @@ -131414,26 +130046,26 @@ declare namespace Phaser { /** * When Phaser boots it will create an instance of this Texture Manager class. - * + * * It is a global manager that handles all textures in your game. You can access it from within * a Scene via the `this.textures` property. - * + * * Its role is as a manager for all textures that your game uses. It can create, update and remove * textures globally, as well as parse texture data from external files, such as sprite sheets * and texture atlases. - * + * * Sprites and other texture-based Game Objects get their texture data directly from this class. */ class TextureManager extends Phaser.Events.EventEmitter { /** - * + * * @param game The Phaser.Game instance this Texture Manager belongs to. */ constructor(game: Phaser.Game); /** * The Game that the Texture Manager belongs to. - * + * * A game will only ever have one instance of a Texture Manager. */ game: Phaser.Game; @@ -131445,11 +130077,11 @@ declare namespace Phaser { /** * This object contains all Textures that belong to this Texture Manager. - * + * * Textures are identified by string-based keys, which are used as the property * within this object. Therefore, you can access any texture directly from this * object without any iteration. - * + * * You should not typically modify this object directly, but instead use the * methods provided by the Texture Manager to add and remove entries from it. */ @@ -131457,9 +130089,9 @@ declare namespace Phaser { /** * An Image Game Object that belongs to this Texture Manager. - * + * * Used as a drawing stamp within Dynamic Textures. - * + * * This is not part of the display list and doesn't render. * * Prior to v4.0.0, this was of the type `Phaser.GameObjects.Image`. @@ -131499,7 +130131,7 @@ declare namespace Phaser { * Removes a Texture from the Texture Manager and destroys it. This will immediately * clear all references to it from the Texture Manager, and if it has one, destroy its * WebGLTexture. This will emit a `removetexture` event. - * + * * Note: If you have any Game Objects still using this texture they will start throwing * errors the next time they try to render. Make sure that removing the texture is the final * step when clearing down to avoid this. @@ -131517,7 +130149,7 @@ declare namespace Phaser { /** * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. - * + * * It works by creating an `Image` DOM object, then setting the `src` attribute to * the given base64 encoded data. As a result, the process is asynchronous by its nature, * so be sure to listen for the events this method dispatches before using the texture. @@ -131529,9 +130161,9 @@ declare namespace Phaser { /** * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. - * + * * You can also provide the image type and encoder options. - * + * * This will only work with bitmap based texture frames, such as those created from Texture Atlases. * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please * see the WebGL Snapshot function instead. @@ -131554,11 +130186,11 @@ declare namespace Phaser { /** * Takes a WebGLTextureWrapper and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. - * + * * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. - * + * * This is a WebGL only feature. - * + * * Prior to Phaser 3.80.0, this method took a bare `WebGLTexture` * as the `glTexture` parameter. You must now wrap the `WebGLTexture` in a * `WebGLTextureWrapper` instance before passing it to this method. @@ -131570,10 +130202,10 @@ declare namespace Phaser { /** * Adds a Compressed Texture to this Texture Manager. - * + * * The texture should typically have been loaded via the `CompressedTextureFile` loader, * in order to prepare the correct data object this method requires. - * + * * You can optionally also pass atlas data to this method, in which case a texture atlas * will be generated from the given compressed texture, combined with the atlas data. * @param key The unique string-based key of the Texture. @@ -131594,7 +130226,7 @@ declare namespace Phaser { /** * Creates a new Texture using a blank Canvas element of the size given. - * + * * Canvas elements are automatically pooled and calling this method will * extract a free canvas from the CanvasPool, or create one if none are available. * @param key The unique string-based key of the Texture. @@ -131616,19 +130248,19 @@ declare namespace Phaser { /** * Creates a Dynamic Texture instance and adds itself to this Texture Manager. - * + * * A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of * Game Objects directly to it. - * + * * You can take many complex objects and draw them to this one texture, which can then be used as the * base texture for other Game Objects, such as Sprites. Should you then update this texture, all * Game Objects using it will instantly be updated as well, reflecting the changes immediately. - * + * * It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke * expensive GPU uploads on each change. - * + * * See the methods available on the `DynamicTexture` class for more details. - * + * * Optionally, you can also pass a Dynamic Texture instance to this method to have * it added to the Texture Manager. * @param key The string-based key of this Texture. Must be unique within the Texture Manager. Or, a DynamicTexture instance. @@ -131666,12 +130298,12 @@ declare namespace Phaser { /** * Adds a Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a JSON data file, * such as those exported by applications like Texture Packer. - * + * * The frame data of the atlas must be stored in an Array within the JSON. - * + * * This is known as a JSON Array in software such as Texture Packer. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -131685,12 +130317,12 @@ declare namespace Phaser { /** * Adds a Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a JSON data file, * such as those exported by applications like Texture Packer. - * + * * The frame data of the atlas must be stored in an Object within the JSON. - * + * * This is known as a JSON Hash in software such as Texture Packer. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -131724,10 +130356,10 @@ declare namespace Phaser { /** * Adds a Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a data file, * such as those exported by applications like Texture Packer. - * + * * The frame data of the atlas must be stored in an XML file. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -131741,10 +130373,10 @@ declare namespace Phaser { /** * Adds a Unity Texture Atlas to this Texture Manager. - * + * * In Phaser terminology, a Texture Atlas is a combination of an atlas image and a data file, * such as those exported by applications like Texture Packer or Unity. - * + * * The frame data of the atlas must be stored in a Unity YAML file. * * As of Phaser 3.60 you can use this method to add an atlas data set to an existing Phaser Texture. @@ -131758,12 +130390,12 @@ declare namespace Phaser { /** * Adds a Sprite Sheet to this Texture Manager. - * + * * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact * same size and cannot be trimmed or rotated. This is different to a Texture Atlas, created by tools such as * Texture Packer, and more akin with the fixed-frame exports you get from apps like Aseprite or old arcade * games. - * + * * As of Phaser 3.60 you can use this method to add a sprite sheet to an existing Phaser Texture. * @param key The unique string-based key of the Texture. Give an empty string if you provide a Phaser Texture as the 2nd argument. * @param source The source Image element, or a Phaser Texture. @@ -131775,7 +130407,7 @@ declare namespace Phaser { /** * Adds a Sprite Sheet to this Texture Manager, where the Sprite Sheet exists as a Frame within a Texture Atlas. - * + * * In Phaser terminology a Sprite Sheet is a texture containing different frames, but each frame is the exact * same size and cannot be trimmed or rotated. * @param key The unique string-based key of the Texture. @@ -131786,9 +130418,9 @@ declare namespace Phaser { /** * Creates a texture from an array of colour data. - * + * * This is only available in WebGL mode. - * + * * If the dimensions provided are powers of two, the resulting texture * will be automatically set to wrap by the WebGL Renderer. * @param key The unique string-based key of the Texture. @@ -131837,13 +130469,13 @@ declare namespace Phaser { /** * Returns a Texture from the Texture Manager that matches the given key. - * + * * If the key is `undefined` it will return the `__DEFAULT` Texture. - * + * * If the key is an instance of a Texture, it will return the instance. - * + * * If the key is an instance of a Frame, it will return the frames parent Texture instance. - * + * * Finally, if the key is given, but not found, and not a Texture or Frame instance, it will return the `__MISSING` Texture. * @param key The unique string-based key of the Texture, or a Texture, or Frame instance. * @returns The Texture matching the given key. @@ -131868,9 +130500,9 @@ declare namespace Phaser { /** * Parses the 'key' parameter and returns a Texture Frame instance. - * + * * It can accept the following formats: - * + * * 1) A string * 2) An array where the elements are: [ key, [frame] ] * 3) An object with the properties: { key, [frame] } @@ -131896,7 +130528,8 @@ declare namespace Phaser { * @param y The y coordinate of the pixel within the Texture. * @param key The unique string-based key of the Texture. * @param frame The string or index of the Frame. - * @returns A Color object populated with the color values of the requested pixel, or `null` if the coordinates were out of bounds. + * @returns A Color object populated with the color values of the requested pixel, + * or `null` if the coordinates were out of bounds. */ getPixel(x: number, y: number, key: string, frame?: string | number): Phaser.Display.Color | null; @@ -131924,9 +130557,9 @@ declare namespace Phaser { /** * Changes the key being used by a Texture to the new key provided. - * + * * The old key is removed, allowing it to be re-used. - * + * * Game Objects are linked to Textures by a reference to the Texture object, so * all existing references will be retained. * @param currentKey The current string-based key of the Texture you wish to rename. @@ -131983,7 +130616,7 @@ declare namespace Phaser { */ class TextureSource { /** - * + * * @param texture The Texture this TextureSource belongs to. * @param source The source image data. * @param width Optional width of the source image. If not given it's derived from the source itself. @@ -132004,9 +130637,9 @@ declare namespace Phaser { /** * The source of the image data. - * + * * This is either an Image Element, a Canvas Element, a Video Element, a RenderTexture or a WebGLTextureWrapper. - * + * * In Phaser 3.60 and above it can also be a Compressed Texture data object. */ source: Phaser.Types.Textures.TextureSource; @@ -132097,9 +130730,9 @@ declare namespace Phaser { /** * Sets the Filter Mode for this Texture. - * + * * The mode can be either Linear, the default, or Nearest. - * + * * For pixel-art you should use Nearest. * @param filterMode The Filter Mode. */ @@ -132229,7 +130862,7 @@ declare namespace Phaser { * * Listen to this event from within a Scene using: `this.textures.on('addtexture', listener)`. */ - const ADD: string; + const ADD: 'addtexture'; /** * The Texture Add Key Event. @@ -132248,7 +130881,7 @@ declare namespace Phaser { * * Listen to this event from within a Scene using: `this.textures.on('onerror', listener)`. */ - const ERROR: string; + const ERROR: 'onerror'; /** * The Texture Load Event. @@ -132260,7 +130893,7 @@ declare namespace Phaser { * * This event is dispatched after the [ADD]{@linkcode Phaser.Textures.Events#event:ADD} event. */ - const LOAD: string; + const LOAD: 'onload'; /** * This internal event signifies that the Texture Manager is now ready and the Game can continue booting. @@ -132269,7 +130902,7 @@ declare namespace Phaser { * async events before it's fully ready to carry on. When those complete the Texture Manager emits this event via the Game * instance, which tells the Game to carry on booting. */ - const READY: string; + const READY: 'ready'; /** * The Texture Remove Event. @@ -132281,7 +130914,7 @@ declare namespace Phaser { * If you have any Game Objects still using the removed texture, they will start throwing * errors the next time they try to render. Be sure to clear all use of the texture in this event handler. */ - const REMOVE: string; + const REMOVE: 'removetexture'; /** * The Texture Remove Key Event. @@ -133292,7 +131925,8 @@ declare namespace Phaser { * GID this set will use here. Default 0. * @param tileOffset Tile texture drawing offset. * If not specified, it will default to {0, 0} Default {x: 0, y: 0}. - * @returns Returns the Tileset object that was created or updated, or null if it failed. + * @returns Returns the Tileset object that was created or updated, or null if it + * failed. */ addTilesetImage(tilesetName: string, key?: string, tileWidth?: number, tileHeight?: number, tileMargin?: number, tileSpacing?: number, gid?: number, tileOffset?: object): Phaser.Tilemaps.Tileset | null; @@ -139201,7 +137835,8 @@ declare namespace Phaser { * Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index. * Returns null if tile index is not contained in this Tileset. * @param tileIndex The unique id of the tile across all tilesets in the map. - * @returns Object in the form { x, y } representing the top-left UV coordinate within the Tileset image. + * @returns Object in the form { x, y } representing the top-left UV coordinate + * within the Tileset image. */ getTileTextureCoordinates(tileIndex: number): object | null; @@ -140611,7 +139246,8 @@ declare namespace Phaser { * @param insertNull Controls how empty tiles (those with an index of -1) are stored in * the LayerData. If `true`, empty tile positions are stored as `null`. If `false`, a Tile object * with an index of -1 is created for each empty position instead. - * @returns - An array of LayerData objects, one for each entry in json.layer. + * @returns - An array of LayerData objects, one for each entry in + * json.layer. */ function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; @@ -140780,7 +139416,8 @@ declare namespace Phaser { * @param json The Tiled JSON object. * @param insertNull Controls how empty tiles, tiles with an index of -1, in the map * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). - * @returns - An array of LayerData objects, one for each entry in json.layers with the type 'tilelayer'. + * @returns - An array of LayerData objects, one for each entry in + * json.layers with the type 'tilelayer'. */ function ParseTileLayers(json: object, insertNull: boolean): Phaser.Tilemaps.LayerData[]; @@ -140856,7 +139493,7 @@ declare namespace Phaser { */ class Clock { /** - * + * * @param scene The Scene which owns this Clock. */ constructor(scene: Phaser.Scene); @@ -140873,28 +139510,28 @@ declare namespace Phaser { /** * The current time of the Clock, in milliseconds. - * + * * If accessed externally, this is equivalent to the `time` parameter normally passed to a Scene's `update` method. */ now: number; /** * The time the Clock (and Scene) started, in milliseconds. - * + * * This can be compared to the `time` parameter passed to a Scene's `update` method. */ startTime: number; /** * The scale of the Clock's time delta. - * + * * The time delta is the time elapsed between two consecutive frames and influences the speed of time for this Clock and anything which uses it, such as its Timer Events. Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. A value of 0 freezes time and is effectively equivalent to pausing the Clock. */ timeScale: number; /** * Whether the Clock is paused (`true`) or active (`false`). - * + * * When paused, the Clock will not update any of its Timer Events, thus freezing time. */ paused: boolean; @@ -140904,11 +139541,11 @@ declare namespace Phaser { * * You can pass in either a `TimerEventConfig` object, from which a new `TimerEvent` will * be created, or you can pass in a `TimerEvent` instance. - * + * * If passing an instance please make sure that this instance hasn't been used before. * If it has ever entered a 'completed' state then it will no longer be suitable to * run again. - * + * * Also, if the `TimerEvent` instance is being used by _another_ Clock (in another Scene) * it will still be updated by that Clock as well, so be careful when using this feature. * @param config The configuration for the Timer Event, or an existing Timer Event object. @@ -140918,7 +139555,7 @@ declare namespace Phaser { /** * Creates a Timer Event and adds it to the Clock at the start of the frame. - * + * * This is a shortcut for {@link #addEvent} which can be shorter and is compatible with the syntax of the GreenSock Animation Platform (GSAP). * @param delay The delay of the function call, in milliseconds. * @param callback The function to call after the delay expires. @@ -140936,7 +139573,7 @@ declare namespace Phaser { /** * Removes the given Timer Event, or an array of Timer Events, from this Clock. - * + * * The events are removed from all internal lists (active, pending and removal), * freeing the event up to be re-used. * @param events The Timer Event, or an array of Timer Events, to remove from this Clock. @@ -140966,27 +139603,27 @@ declare namespace Phaser { /** * A Timeline is a way to schedule events to happen at specific times in the future. - * + * * You can think of it as an event sequencer for your game, allowing you to schedule the * running of callbacks, events and other actions at specific times in the future. - * + * * A Timeline is a Scene level system, meaning you can have as many Timelines as you like, each * belonging to a different Scene. You can also have multiple Timelines running at the same time. - * + * * If the Scene is paused, the Timeline will also pause. If the Scene is destroyed, the Timeline * will be automatically destroyed. However, you can control the Timeline directly, pausing, * resuming and stopping it at any time. - * + * * Create an instance of a Timeline via the Game Object Factory: - * + * * ```js * const timeline = this.add.timeline(); * ``` - * + * * The Timeline always starts paused. You must call `play` on it to start it running. - * + * * You can also pass in a configuration object on creation, or an array of them: - * + * * ```js * const timeline = this.add.timeline({ * at: 1000, @@ -140994,12 +139631,12 @@ declare namespace Phaser { * this.add.sprite(400, 300, 'logo'); * } * }); - * + * * timeline.play(); * ``` - * + * * In this example we sequence a few different events: - * + * * ```js * const timeline = this.add.timeline([ * { @@ -141025,22 +139662,22 @@ declare namespace Phaser { * } * } * ]); - * + * * timeline.play(); * ``` - * + * * The Timeline can also be looped with the repeat method: * * ```js * timeline.repeat().play(); * ``` - * + * * There are lots of options available to you via the configuration object. See the * {@link Phaser.Types.Time.TimelineEventConfig} typedef for more details. */ class Timeline extends Phaser.Events.EventEmitter { /** - * + * * @param scene The Scene which owns this Timeline. * @param config The configuration object for this Timeline Event, or an array of them. */ @@ -141058,17 +139695,17 @@ declare namespace Phaser { /** * The elapsed time counter. - * + * * Treat this as read-only. */ elapsed: number; /** * The Timeline's delta time scale. - * + * * Values higher than 1 increase the speed of time, while values smaller than 1 decrease it. * A value of 0 freezes time and is effectively equivalent to pausing the Timeline. - * + * * This doesn't affect the delta time scale of any Tweens created by the Timeline. * You will have to set the `timeScale` of each Tween or the Tween Manager if you want them to match. */ @@ -141078,10 +139715,10 @@ declare namespace Phaser { * Whether the Timeline is paused (`true`) or active (`false`). * * When paused, the Timeline will not run any of its actions. - * + * * By default a Timeline is always paused and should be started by * calling the `Timeline.play` method. - * + * * You can use the `Timeline.pause` and `Timeline.resume` methods to control * this value in a chainable way. */ @@ -141089,12 +139726,12 @@ declare namespace Phaser { /** * Whether the Timeline is complete (`true`) or not (`false`). - * + * * A Timeline is considered complete when all of its events have been run. - * + * * If you wish to reset a Timeline after it has completed, you can do so * by calling the `Timeline.reset` method. - * + * * You can also use the `Timeline.stop` method to stop a running Timeline, * at any point, without resetting it. */ @@ -141102,9 +139739,9 @@ declare namespace Phaser { /** * The total number of events that have been run. - * + * * This value is reset to zero if the Timeline is restarted. - * + * * Treat this as read-only. */ totalComplete: number; @@ -141118,7 +139755,7 @@ declare namespace Phaser { /** * The number of times this Timeline has looped. - * + * * This value is incremented each loop if looping is enabled. */ iteration: number; @@ -141137,19 +139774,19 @@ declare namespace Phaser { /** * Called automatically by the Scene update step. - * + * * Iterates through all of the Timeline Events and checks to see if they should be run. * * If they should be run, then the event's callbacks and actions are invoked. * * If the `TimelineEvent.once` property is `true` then the event is removed from the Timeline. - * + * * If the `TimelineEvent.event` property is set then the Timeline emits that event. - * + * * If the `TimelineEvent.run` property is set then the Timeline invokes that method. - * + * * If the `TimelineEvent.loop` property is set then the Timeline invokes that method when repeated. - * + * * If the `TimelineEvent.target` property is set then the Timeline invokes the `run` method on that target. * @param time The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout. * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. @@ -141158,10 +139795,10 @@ declare namespace Phaser { /** * Starts this Timeline running. - * + * * If the Timeline is already running and the `fromStart` parameter is `true`, * then calling this method will reset the Timeline events as incomplete. - * + * * If you wish to resume a paused Timeline, then use the `Timeline.resume` method instead. * @param fromStart Reset this Timeline back to the start before playing. Default true. * @returns This Timeline instance. @@ -141170,9 +139807,9 @@ declare namespace Phaser { /** * Pauses this Timeline. - * + * * To resume it again, call the `Timeline.resume` method or set the `Timeline.paused` property to `false`. - * + * * If the Timeline is paused while processing the current game step, then it * will carry on with all events that are due to run during that step and pause * from the next game step. @@ -141184,7 +139821,7 @@ declare namespace Phaser { /** * Repeats this Timeline. - * + * * If the value for `amount` is positive, the Timeline will repeat that many additional times. * For example a value of 1 will actually run this Timeline twice. * @@ -141199,7 +139836,7 @@ declare namespace Phaser { /** * Resumes this Timeline from a paused state. - * + * * The Timeline will carry on from where it left off. * * If you need to reset the Timeline to the start, then call the `Timeline.reset` method.undefined @@ -141209,7 +139846,7 @@ declare namespace Phaser { /** * Stops this Timeline. - * + * * This will set the `paused` and `complete` properties to `true`. * * If you wish to reset the Timeline to the start, then call the `Timeline.reset` method.undefined @@ -141219,12 +139856,12 @@ declare namespace Phaser { /** * Resets this Timeline back to the start. - * + * * This will set the elapsed time to zero and set all events to be incomplete. - * + * * If the Timeline had any events that were set to `once` that have already * been removed, they will **not** be present again after calling this method. - * + * * If the Timeline isn't currently running (i.e. it's paused or complete) then * calling this method resets those states, the same as calling `Timeline.play(true)`. * @@ -141236,9 +139873,9 @@ declare namespace Phaser { /** * Adds one or more events to this Timeline. - * + * * You can pass in a single configuration object, or an array of them: - * + * * ```js * const timeline = this.add.timeline({ * at: 1000, @@ -141271,14 +139908,14 @@ declare namespace Phaser { /** * Returns a number between 0 and 1 representing the progress of this Timeline. - * + * * A value of 0 means the Timeline has just started, 0.5 means it's half way through, * and 1 means it's complete. * * If the Timeline has no events, or all events have been removed, this will return `NaN`. * * If the Timeline is paused, this will return the progress value at the time it was paused. - * + * * Note that the value returned is based on the number of events that have been completed, * not the 'duration' of the events (as this is unknown to the Timeline).undefined * @returns A number between 0 and 1 representing the progress of this Timeline. @@ -141287,11 +139924,11 @@ declare namespace Phaser { /** * Destroys this Timeline. - * + * * This will remove all events from the Timeline and stop it from processing. - * + * * Any Tweens that were currently running as a result of this Timeline will be stopped. - * + * * This method is called automatically when the Scene shuts down, but you may * also call it directly should you need to destroy the Timeline earlier. */ @@ -141301,12 +139938,12 @@ declare namespace Phaser { /** * A Timer Event represents a delayed function call. It's managed by a Scene's {@link Clock} and will call its function after a set amount of time has passed. The Timer Event can optionally repeat - i.e. call its function multiple times before finishing, or loop indefinitely. - * + * * Because it's managed by a Clock, a Timer Event is based on game time, will be affected by its Clock's time scale, and will pause if its Clock pauses. */ class TimerEvent { /** - * + * * @param config The configuration for the Timer Event, including its delay and callback. */ constructor(config: Phaser.Types.Time.TimerEventConfig); @@ -141358,7 +139995,7 @@ declare namespace Phaser { /** * The time in milliseconds which has elapsed since the Timer Event's creation. - * + * * This value is local for the Timer Event and is relative to its Clock. As such, it's influenced by the Clock's time scale and paused state, the Timer Event's initial {@link #startAt} property, and the Timer Event's {@link #timeScale} and {@link #paused} state. */ elapsed: number; @@ -141370,7 +140007,7 @@ declare namespace Phaser { /** * Whether the Timer Event's function has been called. - * + * * When the Timer Event fires, this property will be set to `true` before the callback function is invoked and will be reset immediately afterward if the Timer Event should repeat. The value of this property does not directly influence whether the Timer Event will be removed from its Clock, but can prevent it from firing. */ hasDispatched: boolean; @@ -141446,7 +140083,7 @@ declare namespace Phaser { /** * Destroys all object references in the Timer Event, i.e. its callback, scope, and arguments. - * + * * Normally, this method is only called by the Clock when it shuts down. As such, it doesn't stop the Timer Event. If called manually, the Timer Event will still be updated by the Clock, but it won't do anything when it fires. */ destroy(): void; @@ -141467,7 +140104,7 @@ declare namespace Phaser { * timeline.play(); * ``` */ - const COMPLETE: string; + const COMPLETE: 'complete'; } @@ -142056,7 +140693,7 @@ declare namespace Phaser { /** * Extracts an array of targets from a Tween configuration object. - * + * * The targets will be looked for in a `targets` property. If it's a function, its return value will be used as the result. * @param config The Tween configuration object containing the `targets` property to extract. * @returns An array of targets (may contain only one element), or `null` if no targets were specified. @@ -142065,20 +140702,20 @@ declare namespace Phaser { /** * Returns `getActive`, `getStart` and `getEnd` functions for a TweenData based on a target property and end value. - * + * * `getActive` if not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * `getEnd` is invoked once any start delays have expired and returns what the value should tween to. * `getStart` is invoked when the tween reaches the end and needs to either repeat or yoyo, it returns the value to go back to. - * + * * If the end value is a number, it will be treated as an absolute value and the property will be tweened to it. * A string can be provided to specify a relative end value which consists of an operation * (`+=` to add to the current value, `-=` to subtract from the current value, `*=` to multiply the current * value, or `/=` to divide the current value) followed by its operand. - * + * * A function can be provided to allow greater control over the end value; it will receive the target * object being tweened, the name of the property being tweened, and the current value of the property * as its arguments and must return a value. - * + * * If both the starting and the ending values need to be controlled, an object with `getStart` and `getEnd` * callbacks, which will receive the same arguments, can be provided instead. If an object with a `value` * property is provided, the property will be used as the effective value under the same rules described here. @@ -142106,14 +140743,14 @@ declare namespace Phaser { /** * Creates a Stagger function to be used by a Tween property. - * + * * The stagger function will allow you to stagger changes to the value of the property across all targets of the tween. - * + * * This is only worth using if the tween has multiple targets. - * + * * The following will stagger the delay by 100ms across all targets of the tween, causing them to scale down to 0.2 * over the duration specified: - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -142123,10 +140760,10 @@ declare namespace Phaser { * delay: this.tweens.stagger(100) * }); * ``` - * + * * The following will stagger the delay by 500ms across all targets of the tween using a 10 x 6 grid, staggering * from the center out, using a cubic ease. - * + * * ```javascript * this.tweens.add({ * targets: [ ... ], @@ -142191,15 +140828,15 @@ declare namespace Phaser { namespace Events { /** * The Tween Active Event. - * + * * This event is dispatched by a Tween when it becomes active within the Tween Manager. - * + * * An 'active' Tween is one that is now progressing, although it may not yet be updating * any target properties, due to settings such as `delay`. If you need an event for when * the Tween starts actually updating its first property, see `TWEEN_START`. - * + * * Listen to it from a Tween instance using `Tween.on('active', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.create({ * targets: image, @@ -142210,24 +140847,24 @@ declare namespace Phaser { * tween.on('active', listener); * this.tweens.existing(tween); * ``` - * + * * Note that this event is usually dispatched already by the time you call `this.tweens.add()`, and is * meant for use with `tweens.create()` and/or `tweens.existing()`. */ - const TWEEN_ACTIVE: string; + const TWEEN_ACTIVE: 'active'; /** * The Tween Complete Event. - * + * * This event is dispatched by a Tween when it completes playback entirely, factoring in repeats and loops. - * + * * If the Tween has been set to loop or repeat infinitely, this event will not be dispatched * unless the `Tween.stop` method is called. - * + * * If a Tween has a `completeDelay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('complete', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142238,22 +140875,22 @@ declare namespace Phaser { * tween.on('complete', listener); * ``` */ - const TWEEN_COMPLETE: string; + const TWEEN_COMPLETE: 'complete'; /** * The Tween Loop Event. - * + * * This event is dispatched by a Tween when it loops. - * + * * This event will only be dispatched if the Tween has a loop count set. - * + * * If a Tween has a `loopDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('loop', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142265,15 +140902,15 @@ declare namespace Phaser { * tween.on('loop', listener); * ``` */ - const TWEEN_LOOP: string; + const TWEEN_LOOP: 'loop'; /** * The Tween Pause Event. - * + * * This event is dispatched by a Tween when it is paused. - * + * * Listen to it from a Tween instance using `Tween.on('pause', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142286,22 +140923,22 @@ declare namespace Phaser { * tween.pause(); * ``` */ - const TWEEN_PAUSE: string; + const TWEEN_PAUSE: 'pause'; /** * The Tween Repeat Event. - * + * * This event is dispatched by a Tween when one of the properties it is tweening repeats. - * + * * This event will only be dispatched if the Tween has a property with a repeat count set. - * + * * If a Tween has a `repeatDelay` set, this event will fire after that delay expires. - * + * * The difference between `loop` and `repeat` is that `repeat` is a property setting, * where-as `loop` applies to the entire Tween. - * + * * Listen to it from a Tween instance using `Tween.on('repeat', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142313,15 +140950,15 @@ declare namespace Phaser { * tween.on('repeat', listener); * ``` */ - const TWEEN_REPEAT: string; + const TWEEN_REPEAT: 'repeat'; /** * The Tween Resume Event. - * + * * This event is dispatched by a Tween when it is resumed from a paused state. - * + * * Listen to it from a Tween instance using `Tween.on('resume', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142334,19 +140971,19 @@ declare namespace Phaser { * tween.resume(); * ``` */ - const TWEEN_RESUME: string; + const TWEEN_RESUME: 'resume'; /** * The Tween Start Event. - * + * * This event is dispatched by a Tween when it starts tweening its first property. - * + * * A Tween will only emit this event once, as it can only start once. - * + * * If a Tween has a `delay` set, this event will fire after that delay expires. - * + * * Listen to it from a Tween instance using `Tween.on('start', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142357,15 +140994,15 @@ declare namespace Phaser { * tween.on('start', listener); * ``` */ - const TWEEN_START: string; + const TWEEN_START: 'start'; /** * The Tween Stop Event. - * + * * This event is dispatched by a Tween when it is stopped. - * + * * Listen to it from a Tween instance using `Tween.on('stop', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142376,19 +141013,19 @@ declare namespace Phaser { * tween.on('stop', listener); * ``` */ - const TWEEN_STOP: string; + const TWEEN_STOP: 'stop'; /** * The Tween Update Event. - * + * * This event is dispatched by a Tween every time it updates _any_ of the properties it is tweening. - * + * * A Tween that is changing 3 properties of a target will emit this event 3 times per change, once per property. - * + * * **Note:** This is a very high frequency event and may be dispatched multiple times, every single frame. - * + * * Listen to it from a Tween instance using `Tween.on('update', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142399,23 +141036,23 @@ declare namespace Phaser { * tween.on('update', listener); * ``` */ - const TWEEN_UPDATE: string; + const TWEEN_UPDATE: 'update'; /** * The Tween Yoyo Event. - * + * * This event is dispatched by a Tween whenever a property it is tweening yoyos. - * + * * This event will only be dispatched if the Tween has a property with `yoyo` set. - * + * * If the Tween has a `hold` value, this event is dispatched when the hold expires. - * + * * This event is dispatched for every property, and for every target, that yoyos. * For example, if a Tween was updating 2 properties and had 10 targets, this event * would be dispatched 20 times (twice per target). So be careful how you use it! - * + * * Listen to it from a Tween instance using `Tween.on('yoyo', listener)`, i.e.: - * + * * ```javascript * var tween = this.tweens.add({ * targets: image, @@ -142427,20 +141064,20 @@ declare namespace Phaser { * tween.on('yoyo', listener); * ``` */ - const TWEEN_YOYO: string; + const TWEEN_YOYO: 'yoyo'; } /** * As the name implies, this is the base Tween class that both the Tween and TweenChain * inherit from. It contains shared properties and methods common to both types of Tween. - * + * * Typically you would never instantiate this class directly, although you could certainly * use it to create your own variation of Tweens from. */ class BaseTween extends Phaser.Events.EventEmitter { /** - * + * * @param parent A reference to the Tween Manager, or Tween Chain, that owns this Tween. */ constructor(parent: Phaser.Tweens.TweenManager | Phaser.Tweens.TweenChain); @@ -142453,7 +141090,7 @@ declare namespace Phaser { /** * The main data array. For a Tween, this contains all of the `TweenData` objects, each * containing a unique property and target that is being tweened. - * + * * For a TweenChain, this contains an array of `Tween` instances, which are being played * through in sequence. */ @@ -142466,7 +141103,7 @@ declare namespace Phaser { /** * The time in milliseconds before the 'onStart' event fires. - * + * * For a Tween, this is the shortest `delay` value across all of the TweenDatas it owns. * For a TweenChain, it is whatever delay value was given in the configuration. */ @@ -142474,37 +141111,37 @@ declare namespace Phaser { /** * Has this Tween started playback yet? - * + * * This boolean is toggled when the Tween leaves the 'start delayed' state and begins running. */ readonly hasStarted: boolean; /** * Scales the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. - * + * * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * + * * This value is multiplied by the `TweenManager.timeScale`. */ timeScale: number; /** * The number of times this Tween will loop. - * + * * Can be -1 for an infinite loop, zero for none, or a positive integer. - * + * * Typically this is set in the configuration object, but can also be set directly * as long as this Tween is paused and hasn't started playback. - * + * * When enabled it will play through ALL Tweens again. - * + * * Use TweenData.repeat to loop a single element. */ loop: number; /** * The time in milliseconds before the Tween loops. - * + * * Only used if `loop` is > 0. */ loopDelay: number; @@ -142516,7 +141153,7 @@ declare namespace Phaser { /** * The time in milliseconds before the 'onComplete' event fires. - * + * * This never fires if `loop = -1` as it never completes because it has been * set to loop forever. */ @@ -142534,20 +141171,20 @@ declare namespace Phaser { /** * Is the Tween currently paused? - * + * * A paused Tween needs to be started with the `play` method, or resumed with the `resume` method. - * + * * This property can be toggled at runtime if required. */ paused: boolean; /** * An object containing the different Tween callback functions. - * + * * You can either set these in the Tween config, or by calling the `Tween.setCallback` method. - * + * * The types available are: - * + * * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. @@ -142555,9 +141192,9 @@ declare namespace Phaser { * `onStop` - Invoked only if the `Tween.stop` method is called. * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. - * + * * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. - * + * * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. * `onUpdate` - When a TweenData updates a property on a source target during playback. @@ -142566,7 +141203,7 @@ declare namespace Phaser { /** * The scope (or context) in which all of the callbacks are invoked. - * + * * This defaults to be this Tween, but you can override this property * to set it to whatever object you require. */ @@ -142576,10 +141213,10 @@ declare namespace Phaser { * Will this Tween persist after playback? A Tween that persists will _not_ be destroyed by the * Tween Manager, or when calling `Tween.stop`, and can be re-played as required. You can either * set this property when creating the tween in the tween config, or set it _prior_ to playback. - * + * * However, it's up to you to ensure you destroy persistent tweens when you are finished with them, * or they will retain references you may no longer require and waste memory. - * + * * By default, `Tweens` are set to _not_ persist, so they are automatically cleaned-up by * the Tween Manager. */ @@ -142588,9 +141225,9 @@ declare namespace Phaser { /** * Sets the value of the time scale applied to this Tween. A value of 1 runs in real-time. * A value of 0.5 runs 50% slower, and so on. - * + * * The value isn't used when calculating total duration of the tween, it's a run-time delta adjustment only. - * + * * This value is multiplied by the `TweenManager.timeScale`. * @param value The time scale value to set. * @returns This Tween instance. @@ -142650,10 +141287,10 @@ declare namespace Phaser { /** * Flags the Tween as being complete, whatever stage of progress it is at. - * + * * If an `onComplete` callback has been defined it will automatically invoke it, unless a `delay` * argument is provided, in which case the Tween will delay for that period of time before calling the callback. - * + * * If you don't need a delay or don't have an `onComplete` callback then call `Tween.stop` instead. * @param delay The time to wait before invoking the complete callback. If zero it will fire immediately. Default 0. * @returns This Tween instance. @@ -142662,10 +141299,10 @@ declare namespace Phaser { /** * Flags the Tween as being complete only once the current loop has finished. - * + * * This is a useful way to stop an infinitely looping tween once a complete cycle is over, * rather than abruptly. - * + * * If you don't have a loop then call `Tween.stop` instead. * @param loops The number of loops that should finish before this tween completes. Zero means complete just the current loop. Default 0. * @returns This Tween instance. @@ -142675,7 +141312,7 @@ declare namespace Phaser { /** * Immediately removes this Tween from the TweenManager and all of its internal arrays, * no matter what stage it is at. Then sets the tween state to `REMOVED`. - * + * * You should dispose of your reference to this tween after calling this method, to * free it from memory. If you no longer require it, call `Tween.destroy()` on it.undefined * @returns This Tween instance. @@ -142684,13 +141321,13 @@ declare namespace Phaser { /** * Stops the Tween immediately, whatever stage of progress it is at. - * + * * If not a part of a Tween Chain it is also flagged for removal by the Tween Manager. - * + * * If an `onStop` callback has been defined it will automatically invoke it. - * + * * The Tween will be removed during the next game frame, but should be considered 'destroyed' from this point on. - * + * * Typically, you cannot play a Tween that has been stopped. If you just wish to pause the tween, not destroy it, * then call the `pause` method instead and use `resume` to continue playback. If you wish to restart the Tween, * use the `restart` or `seek` methods.undefined @@ -142721,11 +141358,11 @@ declare namespace Phaser { /** * Sets an event based callback to be invoked during playback. - * + * * Calling this method will replace a previously set callback for the given type, if any exists. - * + * * The types available are: - * + * * `onActive` - When the Tween is first created it moves to an 'active' state when added to the Tween Manager. 'Active' does not mean 'playing'. * `onStart` - When the Tween starts playing after a delayed or paused state. This will happen at the same time as `onActive` if the tween has no delay and isn't paused. * `onLoop` - When a Tween loops, if it has been set to do so. This happens _after_ the `loopDelay` expires, if set. @@ -142733,9 +141370,9 @@ declare namespace Phaser { * `onStop` - Invoked only if the `Tween.stop` method is called. * `onPause` - Invoked only if the `Tween.pause` method is called. Not invoked if the Tween Manager is paused. * `onResume` - Invoked only if the `Tween.resume` method is called. Not invoked if the Tween Manager is resumed. - * + * * The following types are also available and are invoked on a `TweenData` level - that is per-object, per-property, being tweened. - * + * * `onYoyo` - When a TweenData starts a yoyo. This happens _after_ the `hold` delay expires, if set. * `onRepeat` - When a TweenData repeats playback. This happens _after_ the `repeatDelay` expires, if set. * `onUpdate` - When a TweenData updates a property on a source target during playback. @@ -142858,13 +141495,13 @@ declare namespace Phaser { * BaseTweenData is the class that the TweenData and TweenFrameData classes * extend from. You should not typically instantiate this class directly, but instead * use it to form your own tween data classes from, should you require it. - * + * * Prior to Phaser 3.60 the TweenData was just an object, but was refactored to a class, * to make it responsible for its own state and updating. */ class BaseTweenData { /** - * + * * @param tween The tween this TweenData instance belongs to. * @param targetIndex The target index within the Tween targets array. * @param delay Function that returns the time in milliseconds before tween will start. @@ -142903,7 +141540,7 @@ declare namespace Phaser { /** * The time, in milliseconds, before this tween will start playing. - * + * * This value is generated by the `getDelay` function. */ delay: number; @@ -142926,11 +141563,11 @@ declare namespace Phaser { /** * The number of times this tween will repeat. - * + * * The tween will always run once regardless of this value, * so a repeat value of '1' will play the tween twice: I.e. the original * play-through and then it repeats that once (1). - * + * * If this value is set to -1 this tween will repeat forever. */ repeat: number; @@ -143096,14 +141733,14 @@ declare namespace Phaser { /** * Internal method that resets this Tween Data entirely, including the progress and elapsed values. - * + * * Called automatically by the parent Tween. Should not be called directly. */ reset(): void; /** * Internal method that handles repeating or yoyo'ing this TweenData. - * + * * Called automatically by `setStateFromStart` and `setStateFromEnd`. * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. * @param setStart Set the TweenData start values? @@ -143896,14 +142533,14 @@ declare namespace Phaser { namespace Array { /** * Adds the given item, or array of items, to the array. - * + * * Each item must be unique within the array. * * The array is modified in-place. The added item, or array of added items, is returned. Returns `null` if no items were added (e.g. the array is already at the limit, or all items already exist in the array). * * You can optionally specify a limit to the maximum size of the array. If the quantity of items being * added will take the array length over this limit, it will stop adding once the limit is reached. - * + * * You can optionally specify a callback to be invoked for each item successfully added to the array. * @param array The array to be added to. * @param item The item, or array of items, to add to the array. Each item must be unique within the array. @@ -143916,16 +142553,16 @@ declare namespace Phaser { /** * Adds the given item, or array of items, to the array starting at the index specified. - * + * * Each item must be unique within the array. - * + * * Existing elements in the array are shifted up. * * The array is modified in-place. The inserted item, or array of inserted items, is returned. Returns `null` if no items were added (e.g. the array is full, or all items were already present). * * You can optionally specify a limit to the maximum size of the array. If the quantity of items being * added will take the array length over this limit, it will stop adding once the limit is reached. - * + * * You can optionally specify a callback to be invoked for each item successfully added to the array. * @param array The array to be added to. * @param item The item, or array of items, to add to the array. @@ -144004,7 +142641,7 @@ declare namespace Phaser { /** * Returns all elements in the array. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. * * For example: `GetAll('visible', true)` would return only elements that have their visible property set to `true`. @@ -144023,14 +142660,14 @@ declare namespace Phaser { /** * Returns the first element in the array. - * + * * You can optionally specify a matching criteria using the `property` and `value` arguments. * * For example: `GetFirst('visible', true)` would return the first element that had its `visible` property set to `true`. * * Optionally you can specify a start and end index. For example if the array had 100 elements, * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements. - * + * * You can also specify a negative `startIndex`, such as `-1`, which would start the search at the end of the array * * You can also specify a negative `startIndex`, such as `-1`, which would start the search at the end of the array @@ -144107,16 +142744,16 @@ declare namespace Phaser { /** * Create an array representing the range of numbers (usually integers), between, and inclusive of, * the given `start` and `end` arguments. For example: - * + * * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` - * + * * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. - * + * * You can optionally provide a prefix and / or suffix string. If given the array will contain * strings, not integers. For example: - * + * * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` * @param start The minimum value the array starts with. @@ -144144,12 +142781,12 @@ declare namespace Phaser { /** * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm. - * + * * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right]; * The k-th element will have the (k - left + 1)th smallest value in [left, right]. - * + * * The array is modified in-place. - * + * * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner) * @param arr The array to rearrange in-place. * @param k The k-th element index. @@ -144161,31 +142798,31 @@ declare namespace Phaser { /** * Creates an array populated with a range of values, based on the given arguments and configuration object. - * + * * Range ([a,b,c], [1,2,3]) = * a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2,3], qty = 3) = * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3 - * + * * Range ([a,b,c], [1,2,3], repeat x1) = * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3 - * + * * Range ([a,b], [1,2], repeat -1 = endless, max = 14) = * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements) - * + * * Range ([a], [1,2,3,4,5], random = true) = * a4, a1, a5, a2, a3 - * + * * Range ([a, b], [1,2,3], random = true) = * b3, a2, a1, b1, a3, b2 - * + * * Range ([a, b, c], [1,2,3], randomB = true) = * a3, a1, a2, b2, b3, b1, c1, c3, c2 - * + * * Range ([a], [1,2,3,4,5], yoyo = true) = * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1 - * + * * Range ([a, b], [1,2,3], yoyo = true) = * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1 * @param a The first array of range elements. @@ -144197,9 +142834,9 @@ declare namespace Phaser { /** * Removes the given item, or array of items, from the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for each item successfully removed from the array. * @param array The array to be modified. * @param item The item, or array of items, to be removed from the array. @@ -144211,9 +142848,9 @@ declare namespace Phaser { /** * Removes the item from the given position in the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array. * @param array The array to be modified. * @param index The array index to remove the item from. The index must be in bounds or it will throw an error. @@ -144227,7 +142864,7 @@ declare namespace Phaser { * Removes all items within the given index range from the array. * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for the item/s successfully removed from the array. * @param array The array to be modified. * @param startIndex The start index to remove from. @@ -144318,7 +142955,7 @@ declare namespace Phaser { /** * Shuffles the contents of the given array using the Fisher-Yates implementation. - * + * * The original array is modified directly and returned. * @param array The array to shuffle. This array is modified in place. * @returns The shuffled array. @@ -144328,7 +142965,7 @@ declare namespace Phaser { /** * Takes the given array and runs a numeric sort on it, ignoring any non-digits that * may be in the entries. - * + * * You should only run this on arrays containing strings. * @param array The input array of strings. * @returns The sorted input array. @@ -144346,9 +142983,9 @@ declare namespace Phaser { /** * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. - * + * * This is an implementation of merge sort, without recursion. - * + * * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable * @param array The input array to be sorted. * @param compare The comparison function. @@ -144606,9 +143243,9 @@ declare namespace Phaser { namespace Base64 { /** * Converts an ArrayBuffer into a base64 string. - * + * * The resulting string can optionally be a data uri if the `mediaType` argument is provided. - * + * * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs for more details. * @param arrayBuffer The Array Buffer to encode. * @param mediaType An optional media type, i.e. `audio/ogg` or `image/jpeg`. If included the resulting string will be a data URI. @@ -144683,7 +143320,7 @@ declare namespace Phaser { * { * x: { randInt: [min, max] } * } - * + * * Random float between min and max: * { * x: { randFloat: [min, max] } @@ -144720,11 +143357,11 @@ declare namespace Phaser { /** * Retrieves a value from an object, or an alternative object, falling to a back-up default value if not found. - * + * * The key is a string, which can be split based on the use of the period character. - * + * * For example: - * + * * ```javascript * const source = { * lives: 3, @@ -144734,12 +143371,12 @@ declare namespace Phaser { * } * } * } - * + * * const lives = GetValue(source, 'lives', 1); * const width = GetValue(source, 'render.screen.width', 800); * const height = GetValue(source, 'render.screen.height', 600); * ``` - * + * * In the code above, `lives` will be 3 because it's defined at the top level of `source`. * The `width` value will be 1024 because it can be found inside the `render.screen` object. * The `height` value will be 600, the default value, because it is missing from the `render.screen` object. @@ -144821,9 +143458,9 @@ declare namespace Phaser { /** * Sets a value in an object, allowing for dot notation to control the depth of the property. - * + * * For example: - * + * * ```javascript * var data = { * world: { @@ -144833,9 +143470,9 @@ declare namespace Phaser { * } * } * }; - * + * * SetValue(data, 'world.position.y', 300); - * + * * console.log(data.world.position.y); // 300 * ``` * @param source The object to set the value in. @@ -144851,7 +143488,7 @@ declare namespace Phaser { /** * Takes a string and replaces instances of markers with values in the given array. * The markers take the form of `%1`, `%2`, etc. I.e.: - * + * * `Format("The %1 is worth %2 gold", [ 'Sword', 500 ])` * @param string The string containing the replacement markers. * @param values An array containing values that will replace the markers. If no value exists an empty string is inserted instead. @@ -144862,21 +143499,21 @@ declare namespace Phaser { /** * Takes the given string and pads it out, to the length required, using the character * specified. For example if you need a string to be 6 characters long, you can call: - * + * * `pad('bob', 6, '-', 2)` - * + * * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right. - * + * * You can also use it to pad numbers (they are always returned as strings): - * + * * `pad(512, 6, '0', 1)` - * + * * Would return: `000512` with the string padded to the left. - * + * * If you don't specify a direction it'll pad to both sides: - * + * * `pad('c64', 7, '*')` - * + * * Would return: `**c64**` * @param str The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. * @param len The total length of the resulting padded string. Default 0. @@ -144888,7 +143525,7 @@ declare namespace Phaser { /** * Takes a string and removes the character at the given index. - * + * * The index is zero based. * @param string The string to be worked on. * @param index The index of the character to be removed. This value is zero-based. @@ -144906,7 +143543,7 @@ declare namespace Phaser { /** * Creates and returns an RFC4122 version 4 compliant UUID. - * + * * The string is in the form: `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where each `x` is replaced with a random * hexadecimal digit from 0 to f, and `y` is replaced with a random hexadecimal digit from 8 to b.undefined * @returns The UUID string. @@ -145010,3 +143647,4 @@ declare module 'phaser' { export = Phaser; } +