@vpmedia/phaser 1.102.0 → 1.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21129 -0
- package/dist/index.js.map +1 -0
- package/{types → dist}/phaser/core/animation.d.ts +80 -76
- package/dist/phaser/core/animation.d.ts.map +1 -0
- package/{types → dist}/phaser/core/animation_manager.d.ts +46 -55
- package/dist/phaser/core/animation_manager.d.ts.map +1 -0
- package/dist/phaser/core/animation_parser.d.ts +21 -0
- package/dist/phaser/core/animation_parser.d.ts.map +1 -0
- package/{types → dist}/phaser/core/array_set.d.ts +13 -13
- package/dist/phaser/core/array_set.d.ts.map +1 -0
- package/{types → dist}/phaser/core/cache.d.ts +86 -91
- package/dist/phaser/core/cache.d.ts.map +1 -0
- package/dist/phaser/core/const.d.ts +262 -0
- package/dist/phaser/core/const.d.ts.map +1 -0
- package/dist/phaser/core/device.d.ts +31 -0
- package/dist/phaser/core/device.d.ts.map +1 -0
- package/dist/phaser/core/device_util.d.ts +65 -0
- package/dist/phaser/core/device_util.d.ts.map +1 -0
- package/dist/phaser/core/dom.d.ts +75 -0
- package/dist/phaser/core/dom.d.ts.map +1 -0
- package/dist/phaser/core/error_code.d.ts +9 -0
- package/dist/phaser/core/error_code.d.ts.map +1 -0
- package/{types → dist}/phaser/core/event_manager.d.ts +33 -35
- package/dist/phaser/core/event_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/core/factory.d.ts +10 -15
- package/dist/phaser/core/factory.d.ts.map +1 -0
- package/{types → dist}/phaser/core/frame.d.ts +7 -28
- package/dist/phaser/core/frame.d.ts.map +1 -0
- package/{types → dist}/phaser/core/frame_data.d.ts +14 -15
- package/dist/phaser/core/frame_data.d.ts.map +1 -0
- package/dist/phaser/core/frame_util.d.ts +15 -0
- package/dist/phaser/core/frame_util.d.ts.map +1 -0
- package/{types → dist}/phaser/core/game.d.ts +63 -74
- package/dist/phaser/core/game.d.ts.map +1 -0
- package/{types → dist}/phaser/core/input.d.ts +68 -76
- package/dist/phaser/core/input.d.ts.map +1 -0
- package/{types → dist}/phaser/core/input_handler.d.ts +73 -93
- package/dist/phaser/core/input_handler.d.ts.map +1 -0
- package/dist/phaser/core/input_mouse.d.ts +61 -0
- package/dist/phaser/core/input_mouse.d.ts.map +1 -0
- package/dist/phaser/core/input_mspointer.d.ts +67 -0
- package/dist/phaser/core/input_mspointer.d.ts.map +1 -0
- package/dist/phaser/core/input_pointer.d.ts +150 -0
- package/dist/phaser/core/input_pointer.d.ts.map +1 -0
- package/{types → dist}/phaser/core/input_touch.d.ts +24 -25
- package/dist/phaser/core/input_touch.d.ts.map +1 -0
- package/{types → dist}/phaser/core/loader.d.ts +67 -78
- package/dist/phaser/core/loader.d.ts.map +1 -0
- package/dist/phaser/core/loader_parser.d.ts +35 -0
- package/dist/phaser/core/loader_parser.d.ts.map +1 -0
- package/{types → dist}/phaser/core/raf.d.ts +5 -5
- package/dist/phaser/core/raf.d.ts.map +1 -0
- package/{types → dist}/phaser/core/scale_manager.d.ts +96 -124
- package/dist/phaser/core/scale_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/core/scene.d.ts +7 -3
- package/dist/phaser/core/scene.d.ts.map +1 -0
- package/{types → dist}/phaser/core/scene_manager.d.ts +25 -27
- package/dist/phaser/core/scene_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/core/signal.d.ts +21 -17
- package/dist/phaser/core/signal.d.ts.map +1 -0
- package/{types → dist}/phaser/core/signal_binding.d.ts +15 -15
- package/dist/phaser/core/signal_binding.d.ts.map +1 -0
- package/{types → dist}/phaser/core/sound.d.ts +115 -75
- package/dist/phaser/core/sound.d.ts.map +1 -0
- package/{types → dist}/phaser/core/sound_manager.d.ts +37 -43
- package/dist/phaser/core/sound_manager.d.ts.map +1 -0
- package/dist/phaser/core/sound_sprite.d.ts +33 -0
- package/dist/phaser/core/sound_sprite.d.ts.map +1 -0
- package/{types → dist}/phaser/core/stage.d.ts +33 -17
- package/dist/phaser/core/stage.d.ts.map +1 -0
- package/{types → dist}/phaser/core/time.d.ts +39 -64
- package/dist/phaser/core/time.d.ts.map +1 -0
- package/{types → dist}/phaser/core/timer.d.ts +34 -54
- package/dist/phaser/core/timer.d.ts.map +1 -0
- package/{types → dist}/phaser/core/timer_event.d.ts +11 -11
- package/dist/phaser/core/timer_event.d.ts.map +1 -0
- package/{types → dist}/phaser/core/tween.d.ts +54 -49
- package/dist/phaser/core/tween.d.ts.map +1 -0
- package/{types → dist}/phaser/core/tween_data.d.ts +33 -35
- package/dist/phaser/core/tween_data.d.ts.map +1 -0
- package/dist/phaser/core/tween_easing.d.ts +187 -0
- package/dist/phaser/core/tween_easing.d.ts.map +1 -0
- package/{types → dist}/phaser/core/tween_manager.d.ts +13 -18
- package/dist/phaser/core/tween_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/core/world.d.ts +3 -3
- package/dist/phaser/core/world.d.ts.map +1 -0
- package/{types → dist}/phaser/display/bitmap_text.d.ts +65 -71
- package/dist/phaser/display/bitmap_text.d.ts.map +1 -0
- package/{types → dist}/phaser/display/button.d.ts +53 -37
- package/dist/phaser/display/button.d.ts.map +1 -0
- package/{types → dist}/phaser/display/canvas/buffer.d.ts +7 -7
- package/dist/phaser/display/canvas/buffer.d.ts.map +1 -0
- package/dist/phaser/display/canvas/graphics.d.ts +18 -0
- package/dist/phaser/display/canvas/graphics.d.ts.map +1 -0
- package/dist/phaser/display/canvas/masker.d.ts +12 -0
- package/dist/phaser/display/canvas/masker.d.ts.map +1 -0
- package/dist/phaser/display/canvas/pool.d.ts +40 -0
- package/dist/phaser/display/canvas/pool.d.ts.map +1 -0
- package/{types → dist}/phaser/display/canvas/renderer.d.ts +19 -28
- package/dist/phaser/display/canvas/renderer.d.ts.map +1 -0
- package/dist/phaser/display/canvas/tinter.d.ts +41 -0
- package/dist/phaser/display/canvas/tinter.d.ts.map +1 -0
- package/dist/phaser/display/canvas/util.d.ts +70 -0
- package/dist/phaser/display/canvas/util.d.ts.map +1 -0
- package/{types → dist}/phaser/display/display_object.d.ts +90 -95
- package/dist/phaser/display/display_object.d.ts.map +1 -0
- package/{types → dist}/phaser/display/graphics.d.ts +77 -65
- package/dist/phaser/display/graphics.d.ts.map +1 -0
- package/{types → dist}/phaser/display/graphics_data.d.ts +12 -12
- package/dist/phaser/display/graphics_data.d.ts.map +1 -0
- package/dist/phaser/display/graphics_data_util.d.ts +8 -0
- package/dist/phaser/display/graphics_data_util.d.ts.map +1 -0
- package/{types → dist}/phaser/display/group.d.ts +50 -40
- package/dist/phaser/display/group.d.ts.map +1 -0
- package/{types → dist}/phaser/display/image.d.ts +89 -50
- package/dist/phaser/display/image.d.ts.map +1 -0
- package/dist/phaser/display/sprite_batch.d.ts +9 -0
- package/dist/phaser/display/sprite_batch.d.ts.map +1 -0
- package/dist/phaser/display/sprite_util.d.ts +35 -0
- package/dist/phaser/display/sprite_util.d.ts.map +1 -0
- package/{types → dist}/phaser/display/text.d.ts +176 -181
- package/dist/phaser/display/text.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/abstract_filter.d.ts +8 -8
- package/dist/phaser/display/webgl/abstract_filter.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/base_texture.d.ts +15 -15
- package/dist/phaser/display/webgl/base_texture.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/blend_manager.d.ts +9 -5
- package/dist/phaser/display/webgl/blend_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/earcut.d.ts +28 -27
- package/dist/phaser/display/webgl/earcut.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/earcut_node.d.ts +11 -11
- package/dist/phaser/display/webgl/earcut_node.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/fast_sprite_batch.d.ts +21 -28
- package/dist/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/filter_manager.d.ts +9 -7
- package/dist/phaser/display/webgl/filter_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/filter_texture.d.ts +7 -9
- package/dist/phaser/display/webgl/filter_texture.d.ts.map +1 -0
- package/dist/phaser/display/webgl/graphics.d.ts +78 -0
- package/dist/phaser/display/webgl/graphics.d.ts.map +1 -0
- package/dist/phaser/display/webgl/graphics_data.d.ts +25 -0
- package/dist/phaser/display/webgl/graphics_data.d.ts.map +1 -0
- package/dist/phaser/display/webgl/mask_manager.d.ts +13 -0
- package/dist/phaser/display/webgl/mask_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/render_texture.d.ts +15 -13
- package/dist/phaser/display/webgl/render_texture.d.ts.map +1 -0
- package/dist/phaser/display/webgl/renderer.d.ts +68 -0
- package/dist/phaser/display/webgl/renderer.d.ts.map +1 -0
- package/dist/phaser/display/webgl/shader/complex.d.ts +21 -0
- package/dist/phaser/display/webgl/shader/complex.d.ts.map +1 -0
- package/dist/phaser/display/webgl/shader/fast.d.ts +22 -0
- package/dist/phaser/display/webgl/shader/fast.d.ts.map +1 -0
- package/dist/phaser/display/webgl/shader/normal.d.ts +39 -0
- package/dist/phaser/display/webgl/shader/normal.d.ts.map +1 -0
- package/dist/phaser/display/webgl/shader/primitive.d.ts +21 -0
- package/dist/phaser/display/webgl/shader/primitive.d.ts.map +1 -0
- package/dist/phaser/display/webgl/shader/strip.d.ts +21 -0
- package/dist/phaser/display/webgl/shader/strip.d.ts.map +1 -0
- package/dist/phaser/display/webgl/shader_manager.d.ts +37 -0
- package/dist/phaser/display/webgl/shader_manager.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/sprite_batch.d.ts +24 -31
- package/dist/phaser/display/webgl/sprite_batch.d.ts.map +1 -0
- package/{types → dist}/phaser/display/webgl/stencil_manager.d.ts +12 -9
- package/dist/phaser/display/webgl/stencil_manager.d.ts.map +1 -0
- package/dist/phaser/display/webgl/texture.d.ts +56 -0
- package/dist/phaser/display/webgl/texture.d.ts.map +1 -0
- package/dist/phaser/display/webgl/texture_util.d.ts +17 -0
- package/dist/phaser/display/webgl/texture_util.d.ts.map +1 -0
- package/dist/phaser/display/webgl/util.d.ts +54 -0
- package/dist/phaser/display/webgl/util.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/circle.d.ts +35 -41
- package/dist/phaser/geom/circle.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/ellipse.d.ts +12 -18
- package/dist/phaser/geom/ellipse.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/line.d.ts +20 -23
- package/dist/phaser/geom/line.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/matrix.d.ts +21 -29
- package/dist/phaser/geom/matrix.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/point.d.ts +30 -33
- package/dist/phaser/geom/point.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/polygon.d.ts +18 -24
- package/dist/phaser/geom/polygon.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/rectangle.d.ts +74 -79
- package/dist/phaser/geom/rectangle.d.ts.map +1 -0
- package/{types → dist}/phaser/geom/rounded_rectangle.d.ts +9 -9
- package/dist/phaser/geom/rounded_rectangle.d.ts.map +1 -0
- package/dist/phaser/geom/util/circle.d.ts +55 -0
- package/dist/phaser/geom/util/circle.d.ts.map +1 -0
- package/dist/phaser/geom/util/ellipse.d.ts +9 -0
- package/dist/phaser/geom/util/ellipse.d.ts.map +1 -0
- package/dist/phaser/geom/util/line.d.ts +42 -0
- package/dist/phaser/geom/util/line.d.ts.map +1 -0
- package/dist/phaser/geom/util/matrix.d.ts +18 -0
- package/dist/phaser/geom/util/matrix.d.ts.map +1 -0
- package/dist/phaser/geom/util/point.d.ts +159 -0
- package/dist/phaser/geom/util/point.d.ts.map +1 -0
- package/dist/phaser/geom/util/polygon.d.ts +8 -0
- package/dist/phaser/geom/util/polygon.d.ts.map +1 -0
- package/dist/phaser/geom/util/rectangle.d.ts +123 -0
- package/dist/phaser/geom/util/rectangle.d.ts.map +1 -0
- package/dist/phaser/geom/util/rounded_rectangle.d.ts +8 -0
- package/dist/phaser/geom/util/rounded_rectangle.d.ts.map +1 -0
- package/dist/phaser/util/math.d.ts +154 -0
- package/dist/phaser/util/math.d.ts.map +1 -0
- package/package.json +26 -12
- package/src/phaser/core/{animation.js → animation.ts} +50 -3
- package/src/phaser/core/{animation_manager.js → animation_manager.ts} +11 -1
- package/src/phaser/core/{array_set.js → array_set.ts} +4 -1
- package/src/phaser/core/{cache.js → cache.ts} +10 -1
- package/src/phaser/core/{device.js → device.ts} +25 -1
- package/src/phaser/core/{dom.js → dom.ts} +7 -0
- package/src/phaser/core/{event_manager.js → event_manager.ts} +18 -1
- package/src/phaser/core/{factory.js → factory.ts} +2 -0
- package/src/phaser/core/{frame.js → frame.ts} +2 -1
- package/src/phaser/core/{frame_data.js → frame_data.ts} +4 -1
- package/src/phaser/core/{frame_util.js → frame_util.ts} +2 -1
- package/src/phaser/core/{game.js → game.ts} +61 -4
- package/src/phaser/core/{input.js → input.ts} +52 -0
- package/src/phaser/core/{input_handler.js → input_handler.ts} +42 -0
- package/src/phaser/core/{input_mouse.js → input_mouse.ts} +24 -0
- package/src/phaser/core/{input_mspointer.js → input_mspointer.ts} +17 -0
- package/src/phaser/core/{input_pointer.js → input_pointer.ts} +45 -0
- package/src/phaser/core/{input_touch.js → input_touch.ts} +18 -0
- package/src/phaser/core/{loader.js → loader.ts} +30 -1
- package/src/phaser/core/{loader_parser.js → loader_parser.ts} +2 -1
- package/src/phaser/core/{raf.js → raf.ts} +3 -0
- package/src/phaser/core/{scale_manager.js → scale_manager.ts} +56 -0
- package/src/phaser/core/{scene.js → scene.ts} +3 -0
- package/src/phaser/core/{scene_manager.js → scene_manager.ts} +16 -0
- package/src/phaser/core/{signal.js → signal.ts} +7 -0
- package/src/phaser/core/{signal_binding.js → signal_binding.ts} +10 -0
- package/src/phaser/core/{sound.js → sound.ts} +100 -6
- package/src/phaser/core/{sound_manager.js → sound_manager.ts} +19 -1
- package/src/phaser/core/{sound_sprite.js → sound_sprite.ts} +8 -1
- package/src/phaser/core/{stage.js → stage.ts} +5 -0
- package/src/phaser/core/{time.js → time.ts} +29 -1
- package/src/phaser/core/{timer.js → timer.ts} +22 -1
- package/src/phaser/core/{timer_event.js → timer_event.ts} +11 -1
- package/src/phaser/core/{tween.js → tween.ts} +49 -2
- package/src/phaser/core/{tween_data.js → tween_data.ts} +26 -1
- package/src/phaser/core/{tween_manager.js → tween_manager.ts} +6 -1
- package/src/phaser/core/{world.js → world.ts} +1 -0
- package/src/phaser/display/{bitmap_text.js → bitmap_text.ts} +14 -0
- package/src/phaser/display/{button.js → button.ts} +29 -0
- package/src/phaser/display/canvas/{buffer.js → buffer.ts} +5 -0
- package/src/phaser/display/canvas/{graphics.js → graphics.ts} +1 -0
- package/src/phaser/display/canvas/{masker.js → masker.ts} +1 -0
- package/src/phaser/display/canvas/{pool.js → pool.ts} +1 -0
- package/src/phaser/display/canvas/{renderer.js → renderer.ts} +14 -0
- package/src/phaser/display/canvas/{tinter.js → tinter.ts} +1 -0
- package/src/phaser/display/{display_object.js → display_object.ts} +92 -31
- package/src/phaser/display/{graphics.js → graphics.ts} +19 -0
- package/src/phaser/display/{graphics_data.js → graphics_data.ts} +11 -0
- package/src/phaser/display/{graphics_data_util.js → graphics_data_util.ts} +1 -0
- package/src/phaser/display/{group.js → group.ts} +29 -0
- package/src/phaser/display/{image.js → image.ts} +45 -6
- package/src/phaser/display/{sprite_batch.js → sprite_batch.ts} +1 -0
- package/src/phaser/display/{sprite_util.js → sprite_util.ts} +1 -0
- package/src/phaser/display/{text.js → text.ts} +1 -0
- package/src/phaser/display/webgl/{abstract_filter.js → abstract_filter.ts} +7 -0
- package/src/phaser/display/webgl/{base_texture.js → base_texture.ts} +13 -0
- package/src/phaser/display/webgl/{blend_manager.js → blend_manager.ts} +3 -0
- package/src/phaser/display/webgl/{earcut.js → earcut.ts} +2 -2
- package/src/phaser/display/webgl/{earcut_node.js → earcut_node.ts} +10 -0
- package/src/phaser/display/webgl/{fast_sprite_batch.js → fast_sprite_batch.ts} +16 -0
- package/src/phaser/display/webgl/{filter_manager.js → filter_manager.ts} +4 -0
- package/src/phaser/display/webgl/{filter_texture.js → filter_texture.ts} +5 -0
- package/src/phaser/display/webgl/{graphics.js → graphics.ts} +1 -0
- package/src/phaser/display/webgl/{graphics_data.js → graphics_data.ts} +10 -0
- package/src/phaser/display/webgl/{mask_manager.js → mask_manager.ts} +1 -0
- package/src/phaser/display/webgl/{render_texture.js → render_texture.ts} +11 -0
- package/src/phaser/display/webgl/{renderer.js → renderer.ts} +18 -0
- package/src/phaser/display/webgl/shader/{complex.js → complex.ts} +6 -0
- package/src/phaser/display/webgl/shader/{fast.js → fast.ts} +7 -0
- package/src/phaser/display/webgl/shader/{normal.js → normal.ts} +11 -0
- package/src/phaser/display/webgl/shader/{primitive.js → primitive.ts} +6 -0
- package/src/phaser/display/webgl/shader/{strip.js → strip.ts} +6 -0
- package/src/phaser/display/webgl/{shader_manager.js → shader_manager.ts} +11 -0
- package/src/phaser/display/webgl/{sprite_batch.js → sprite_batch.ts} +17 -0
- package/src/phaser/display/webgl/{stencil_manager.js → stencil_manager.ts} +4 -0
- package/src/phaser/display/webgl/{texture.js → texture.ts} +21 -0
- package/src/phaser/display/webgl/{texture_util.js → texture_util.ts} +1 -0
- package/src/phaser/geom/{circle.js → circle.ts} +7 -1
- package/src/phaser/geom/{ellipse.js → ellipse.ts} +6 -0
- package/src/phaser/geom/{line.js → line.ts} +4 -0
- package/src/phaser/geom/{matrix.js → matrix.ts} +8 -0
- package/src/phaser/geom/{point.js → point.ts} +5 -1
- package/src/phaser/geom/{polygon.js → polygon.ts} +6 -0
- package/src/phaser/geom/{rectangle.js → rectangle.ts} +10 -4
- package/src/phaser/geom/{rounded_rectangle.js → rounded_rectangle.ts} +7 -0
- package/.vscode/extensions.json +0 -6
- package/.vscode/settings.json +0 -27
- package/AGENTS.md +0 -1
- package/CHANGELOG.md +0 -336
- package/CLAUDE.md +0 -1
- package/SECURITY.md +0 -5
- package/typedefs/global.d.ts +0 -7
- package/types/index.d.ts +0 -38
- package/types/index.d.ts.map +0 -1
- package/types/phaser/core/animation.d.ts.map +0 -1
- package/types/phaser/core/animation_manager.d.ts.map +0 -1
- package/types/phaser/core/animation_parser.d.ts +0 -4
- package/types/phaser/core/animation_parser.d.ts.map +0 -1
- package/types/phaser/core/array_set.d.ts.map +0 -1
- package/types/phaser/core/cache.d.ts.map +0 -1
- package/types/phaser/core/const.d.ts +0 -262
- package/types/phaser/core/const.d.ts.map +0 -1
- package/types/phaser/core/device.d.ts +0 -96
- package/types/phaser/core/device.d.ts.map +0 -1
- package/types/phaser/core/device_util.d.ts +0 -13
- package/types/phaser/core/device_util.d.ts.map +0 -1
- package/types/phaser/core/dom.d.ts +0 -180
- package/types/phaser/core/dom.d.ts.map +0 -1
- package/types/phaser/core/error_code.d.ts +0 -9
- package/types/phaser/core/error_code.d.ts.map +0 -1
- package/types/phaser/core/event_manager.d.ts.map +0 -1
- package/types/phaser/core/factory.d.ts.map +0 -1
- package/types/phaser/core/frame.d.ts.map +0 -1
- package/types/phaser/core/frame_data.d.ts.map +0 -1
- package/types/phaser/core/frame_util.d.ts +0 -5
- package/types/phaser/core/frame_util.d.ts.map +0 -1
- package/types/phaser/core/game.d.ts.map +0 -1
- package/types/phaser/core/input.d.ts.map +0 -1
- package/types/phaser/core/input_handler.d.ts.map +0 -1
- package/types/phaser/core/input_mouse.d.ts +0 -86
- package/types/phaser/core/input_mouse.d.ts.map +0 -1
- package/types/phaser/core/input_mspointer.d.ts +0 -67
- package/types/phaser/core/input_mspointer.d.ts.map +0 -1
- package/types/phaser/core/input_pointer.d.ts +0 -170
- package/types/phaser/core/input_pointer.d.ts.map +0 -1
- package/types/phaser/core/input_touch.d.ts.map +0 -1
- package/types/phaser/core/loader.d.ts.map +0 -1
- package/types/phaser/core/loader_parser.d.ts +0 -5
- package/types/phaser/core/loader_parser.d.ts.map +0 -1
- package/types/phaser/core/raf.d.ts.map +0 -1
- package/types/phaser/core/scale_manager.d.ts.map +0 -1
- package/types/phaser/core/scene.d.ts.map +0 -1
- package/types/phaser/core/scene_manager.d.ts.map +0 -1
- package/types/phaser/core/signal.d.ts.map +0 -1
- package/types/phaser/core/signal_binding.d.ts.map +0 -1
- package/types/phaser/core/sound.d.ts.map +0 -1
- package/types/phaser/core/sound_manager.d.ts.map +0 -1
- package/types/phaser/core/sound_sprite.d.ts +0 -36
- package/types/phaser/core/sound_sprite.d.ts.map +0 -1
- package/types/phaser/core/stage.d.ts.map +0 -1
- package/types/phaser/core/time.d.ts.map +0 -1
- package/types/phaser/core/timer.d.ts.map +0 -1
- package/types/phaser/core/timer_event.d.ts.map +0 -1
- package/types/phaser/core/tween.d.ts.map +0 -1
- package/types/phaser/core/tween_data.d.ts.map +0 -1
- package/types/phaser/core/tween_easing.d.ts +0 -32
- package/types/phaser/core/tween_easing.d.ts.map +0 -1
- package/types/phaser/core/tween_manager.d.ts.map +0 -1
- package/types/phaser/core/world.d.ts.map +0 -1
- package/types/phaser/display/bitmap_text.d.ts.map +0 -1
- package/types/phaser/display/button.d.ts.map +0 -1
- package/types/phaser/display/canvas/buffer.d.ts.map +0 -1
- package/types/phaser/display/canvas/graphics.d.ts +0 -4
- package/types/phaser/display/canvas/graphics.d.ts.map +0 -1
- package/types/phaser/display/canvas/masker.d.ts +0 -3
- package/types/phaser/display/canvas/masker.d.ts.map +0 -1
- package/types/phaser/display/canvas/pool.d.ts +0 -11
- package/types/phaser/display/canvas/pool.d.ts.map +0 -1
- package/types/phaser/display/canvas/renderer.d.ts.map +0 -1
- package/types/phaser/display/canvas/tinter.d.ts +0 -7
- package/types/phaser/display/canvas/tinter.d.ts.map +0 -1
- package/types/phaser/display/canvas/util.d.ts +0 -10
- package/types/phaser/display/canvas/util.d.ts.map +0 -1
- package/types/phaser/display/display_object.d.ts.map +0 -1
- package/types/phaser/display/graphics.d.ts.map +0 -1
- package/types/phaser/display/graphics_data.d.ts.map +0 -1
- package/types/phaser/display/graphics_data_util.d.ts +0 -3
- package/types/phaser/display/graphics_data_util.d.ts.map +0 -1
- package/types/phaser/display/group.d.ts.map +0 -1
- package/types/phaser/display/image.d.ts.map +0 -1
- package/types/phaser/display/sprite_batch.d.ts +0 -4
- package/types/phaser/display/sprite_batch.d.ts.map +0 -1
- package/types/phaser/display/sprite_util.d.ts +0 -6
- package/types/phaser/display/sprite_util.d.ts.map +0 -1
- package/types/phaser/display/text.d.ts.map +0 -1
- package/types/phaser/display/webgl/abstract_filter.d.ts.map +0 -1
- package/types/phaser/display/webgl/base_texture.d.ts.map +0 -1
- package/types/phaser/display/webgl/blend_manager.d.ts.map +0 -1
- package/types/phaser/display/webgl/earcut.d.ts.map +0 -1
- package/types/phaser/display/webgl/earcut_node.d.ts.map +0 -1
- package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +0 -1
- package/types/phaser/display/webgl/filter_manager.d.ts.map +0 -1
- package/types/phaser/display/webgl/filter_texture.d.ts.map +0 -1
- package/types/phaser/display/webgl/graphics.d.ts +0 -16
- package/types/phaser/display/webgl/graphics.d.ts.map +0 -1
- package/types/phaser/display/webgl/graphics_data.d.ts +0 -27
- package/types/phaser/display/webgl/graphics_data.d.ts.map +0 -1
- package/types/phaser/display/webgl/mask_manager.d.ts +0 -3
- package/types/phaser/display/webgl/mask_manager.d.ts.map +0 -1
- package/types/phaser/display/webgl/render_texture.d.ts.map +0 -1
- package/types/phaser/display/webgl/renderer.d.ts +0 -87
- package/types/phaser/display/webgl/renderer.d.ts.map +0 -1
- package/types/phaser/display/webgl/shader/complex.d.ts +0 -33
- package/types/phaser/display/webgl/shader/complex.d.ts.map +0 -1
- package/types/phaser/display/webgl/shader/fast.d.ts +0 -36
- package/types/phaser/display/webgl/shader/fast.d.ts.map +0 -1
- package/types/phaser/display/webgl/shader/normal.d.ts +0 -52
- package/types/phaser/display/webgl/shader/normal.d.ts.map +0 -1
- package/types/phaser/display/webgl/shader/primitive.d.ts +0 -32
- package/types/phaser/display/webgl/shader/primitive.d.ts.map +0 -1
- package/types/phaser/display/webgl/shader/strip.d.ts +0 -33
- package/types/phaser/display/webgl/shader/strip.d.ts.map +0 -1
- package/types/phaser/display/webgl/shader_manager.d.ts +0 -44
- package/types/phaser/display/webgl/shader_manager.d.ts.map +0 -1
- package/types/phaser/display/webgl/sprite_batch.d.ts.map +0 -1
- package/types/phaser/display/webgl/stencil_manager.d.ts.map +0 -1
- package/types/phaser/display/webgl/texture.d.ts +0 -63
- package/types/phaser/display/webgl/texture.d.ts.map +0 -1
- package/types/phaser/display/webgl/texture_util.d.ts +0 -5
- package/types/phaser/display/webgl/texture_util.d.ts.map +0 -1
- package/types/phaser/display/webgl/util.d.ts +0 -15
- package/types/phaser/display/webgl/util.d.ts.map +0 -1
- package/types/phaser/geom/circle.d.ts.map +0 -1
- package/types/phaser/geom/ellipse.d.ts.map +0 -1
- package/types/phaser/geom/line.d.ts.map +0 -1
- package/types/phaser/geom/matrix.d.ts.map +0 -1
- package/types/phaser/geom/point.d.ts.map +0 -1
- package/types/phaser/geom/polygon.d.ts.map +0 -1
- package/types/phaser/geom/rectangle.d.ts.map +0 -1
- package/types/phaser/geom/rounded_rectangle.d.ts.map +0 -1
- package/types/phaser/geom/util/circle.d.ts +0 -10
- package/types/phaser/geom/util/circle.d.ts.map +0 -1
- package/types/phaser/geom/util/ellipse.d.ts +0 -2
- package/types/phaser/geom/util/ellipse.d.ts.map +0 -1
- package/types/phaser/geom/util/line.d.ts +0 -8
- package/types/phaser/geom/util/line.d.ts.map +0 -1
- package/types/phaser/geom/util/matrix.d.ts +0 -5
- package/types/phaser/geom/util/matrix.d.ts.map +0 -1
- package/types/phaser/geom/util/point.d.ts +0 -22
- package/types/phaser/geom/util/point.d.ts.map +0 -1
- package/types/phaser/geom/util/polygon.d.ts +0 -3
- package/types/phaser/geom/util/polygon.d.ts.map +0 -1
- package/types/phaser/geom/util/rectangle.d.ts +0 -19
- package/types/phaser/geom/util/rectangle.d.ts.map +0 -1
- package/types/phaser/geom/util/rounded_rectangle.d.ts +0 -3
- package/types/phaser/geom/util/rounded_rectangle.d.ts.map +0 -1
- package/types/phaser/util/math.d.ts +0 -58
- package/types/phaser/util/math.d.ts.map +0 -1
- /package/src/{index.js → index.ts} +0 -0
- /package/src/phaser/core/{animation_parser.js → animation_parser.ts} +0 -0
- /package/src/phaser/core/{const.js → const.ts} +0 -0
- /package/src/phaser/core/{device_util.js → device_util.ts} +0 -0
- /package/src/phaser/core/{error_code.js → error_code.ts} +0 -0
- /package/src/phaser/core/{signal.test.js → signal.test.ts} +0 -0
- /package/src/phaser/core/{tween_easing.js → tween_easing.ts} +0 -0
- /package/src/phaser/display/canvas/{util.js → util.ts} +0 -0
- /package/src/phaser/display/webgl/{util.js → util.ts} +0 -0
- /package/src/phaser/geom/{circle.test.js → circle.test.ts} +0 -0
- /package/src/phaser/geom/{ellipse.test.js → ellipse.test.ts} +0 -0
- /package/src/phaser/geom/{line.test.js → line.test.ts} +0 -0
- /package/src/phaser/geom/{matrix.test.js → matrix.test.ts} +0 -0
- /package/src/phaser/geom/{point.test.js → point.test.ts} +0 -0
- /package/src/phaser/geom/{rectangle.test.js → rectangle.test.ts} +0 -0
- /package/src/phaser/geom/{rounded_rectangle.test.js → rounded_rectangle.test.ts} +0 -0
- /package/src/phaser/geom/util/{circle.test.js → circle.test.ts} +0 -0
- /package/src/phaser/geom/util/{circle.js → circle.ts} +0 -0
- /package/src/phaser/geom/util/{ellipse.test.js → ellipse.test.ts} +0 -0
- /package/src/phaser/geom/util/{ellipse.js → ellipse.ts} +0 -0
- /package/src/phaser/geom/util/{line.test.js → line.test.ts} +0 -0
- /package/src/phaser/geom/util/{line.js → line.ts} +0 -0
- /package/src/phaser/geom/util/{matrix.test.js → matrix.test.ts} +0 -0
- /package/src/phaser/geom/util/{matrix.js → matrix.ts} +0 -0
- /package/src/phaser/geom/util/{point.test.js → point.test.ts} +0 -0
- /package/src/phaser/geom/util/{point.js → point.ts} +0 -0
- /package/src/phaser/geom/util/{polygon.test.js → polygon.test.ts} +0 -0
- /package/src/phaser/geom/util/{polygon.js → polygon.ts} +0 -0
- /package/src/phaser/geom/util/{rectangle.test.js → rectangle.test.ts} +0 -0
- /package/src/phaser/geom/util/{rectangle.js → rectangle.ts} +0 -0
- /package/src/phaser/geom/util/{rounded_rectangle.test.js → rounded_rectangle.test.ts} +0 -0
- /package/src/phaser/geom/util/{rounded_rectangle.js → rounded_rectangle.ts} +0 -0
- /package/src/phaser/util/{math.test.js → math.test.ts} +0 -0
- /package/src/phaser/util/{math.js → math.ts} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import { BUTTON, POINTER_CONTACT } from '../core/const.js';
|
|
2
3
|
import { InputHandler } from '../core/input_handler.js';
|
|
3
4
|
import { Signal } from '../core/signal.js';
|
|
@@ -10,6 +11,34 @@ const STATE_UP = 'Up';
|
|
|
10
11
|
const STATE_DISABLED = 'Disabled';
|
|
11
12
|
|
|
12
13
|
export class Button extends Image {
|
|
14
|
+
/** @type {string | null} */
|
|
15
|
+
_onOverFrame;
|
|
16
|
+
/** @type {string | null} */
|
|
17
|
+
_onOutFrame;
|
|
18
|
+
/** @type {string | null} */
|
|
19
|
+
_onDownFrame;
|
|
20
|
+
/** @type {string | null} */
|
|
21
|
+
_onUpFrame;
|
|
22
|
+
/** @type {string | null} */
|
|
23
|
+
_onDisabledFrame;
|
|
24
|
+
/** @type {Signal} */
|
|
25
|
+
onInputOver;
|
|
26
|
+
/** @type {Signal} */
|
|
27
|
+
onInputOut;
|
|
28
|
+
/** @type {Signal} */
|
|
29
|
+
onInputDown;
|
|
30
|
+
/** @type {Signal} */
|
|
31
|
+
onInputUp;
|
|
32
|
+
/** @type {boolean} */
|
|
33
|
+
onOverMouseOnly;
|
|
34
|
+
/** @type {number} */
|
|
35
|
+
justReleasedPreventsOver;
|
|
36
|
+
/** @type {boolean} */
|
|
37
|
+
freezeFrames;
|
|
38
|
+
/** @type {boolean} */
|
|
39
|
+
forceOut;
|
|
40
|
+
/** @type {InputHandler} */
|
|
41
|
+
input;
|
|
13
42
|
/**
|
|
14
43
|
* Creates a new Button instance.
|
|
15
44
|
* @param {import('../core/game.js').Game} game - The game instance this button belongs to.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import {
|
|
2
3
|
BLEND_ADD,
|
|
3
4
|
BLEND_COLOR,
|
|
@@ -26,6 +27,19 @@ import { detectCapabilities } from './tinter.js';
|
|
|
26
27
|
import { getSmoothingPrefix } from './util.js';
|
|
27
28
|
|
|
28
29
|
export class CanvasRenderer {
|
|
30
|
+
type;
|
|
31
|
+
resolution;
|
|
32
|
+
clearBeforeRender;
|
|
33
|
+
transparent;
|
|
34
|
+
autoResize;
|
|
35
|
+
contextLost;
|
|
36
|
+
width;
|
|
37
|
+
height;
|
|
38
|
+
view;
|
|
39
|
+
context;
|
|
40
|
+
refresh;
|
|
41
|
+
count;
|
|
42
|
+
renderSession;
|
|
29
43
|
/**
|
|
30
44
|
* Creates a new CanvasRenderer instance.
|
|
31
45
|
* @param {import('../../core/game.js').Game} game - The game instance.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import { Matrix } from '../geom/matrix.js';
|
|
2
3
|
import { Point } from '../geom/point.js';
|
|
3
4
|
import { Rectangle } from '../geom/rectangle.js';
|
|
@@ -6,6 +7,62 @@ import { PI_2 } from '../util/math.js';
|
|
|
6
7
|
import { renderCanvas, renderWebGL } from './sprite_util.js';
|
|
7
8
|
|
|
8
9
|
export class DisplayObject {
|
|
10
|
+
/** @type {boolean} */
|
|
11
|
+
exists = true;
|
|
12
|
+
/** @type {boolean} */
|
|
13
|
+
renderable = false;
|
|
14
|
+
/** @type {boolean} */
|
|
15
|
+
visible = true;
|
|
16
|
+
/** @type {Point} */
|
|
17
|
+
position;
|
|
18
|
+
/** @type {Point} */
|
|
19
|
+
scale;
|
|
20
|
+
/** @type {Point} */
|
|
21
|
+
pivot;
|
|
22
|
+
/** @type {Point} */
|
|
23
|
+
anchor;
|
|
24
|
+
/** @type {number} */
|
|
25
|
+
rotation = 0;
|
|
26
|
+
/** @type {number} */
|
|
27
|
+
alpha = 1;
|
|
28
|
+
/** @type {Rectangle} */
|
|
29
|
+
hitArea = null;
|
|
30
|
+
/** @type {DisplayObject} */
|
|
31
|
+
parent = null;
|
|
32
|
+
/** @type {number} */
|
|
33
|
+
worldAlpha = 1;
|
|
34
|
+
/** @type {Matrix} */
|
|
35
|
+
worldTransform;
|
|
36
|
+
/** @type {Point} */
|
|
37
|
+
worldScale;
|
|
38
|
+
/** @type {Rectangle} */
|
|
39
|
+
filterArea = null;
|
|
40
|
+
/** @type {number} */
|
|
41
|
+
_sr = 0;
|
|
42
|
+
/** @type {number} */
|
|
43
|
+
_cr = 1;
|
|
44
|
+
/** @type {Rectangle} */
|
|
45
|
+
cachedBounds;
|
|
46
|
+
/** @type {Rectangle} */
|
|
47
|
+
currentBounds = null;
|
|
48
|
+
/** @type {import('./graphics.js').Graphics} */
|
|
49
|
+
_mask = null;
|
|
50
|
+
/** @type {object[]} */
|
|
51
|
+
_filters = null;
|
|
52
|
+
/** @type {object} */
|
|
53
|
+
_filterBlock = null;
|
|
54
|
+
/** @type {DisplayObject[]} */
|
|
55
|
+
children;
|
|
56
|
+
/** @type {boolean} */
|
|
57
|
+
ignoreChildInput = false;
|
|
58
|
+
/** @type {string | null} */
|
|
59
|
+
name = null;
|
|
60
|
+
/** @type {object | null} */
|
|
61
|
+
data = null;
|
|
62
|
+
/** @type {import('../core/game.js').Game} */
|
|
63
|
+
game;
|
|
64
|
+
/** @type {number} */
|
|
65
|
+
type;
|
|
9
66
|
/**
|
|
10
67
|
* Creates a new DisplayObject instance.
|
|
11
68
|
* @param {import('../core/game.js').Game} game - The game instance this display object belongs to.
|
|
@@ -37,10 +94,10 @@ export class DisplayObject {
|
|
|
37
94
|
this.worldAlpha = 1;
|
|
38
95
|
/** @type {Matrix} */
|
|
39
96
|
this.worldTransform = new Matrix();
|
|
40
|
-
//
|
|
97
|
+
// This.worldPosition = new Point(0, 0);
|
|
41
98
|
/** @type {Point} */
|
|
42
99
|
this.worldScale = new Point(1, 1);
|
|
43
|
-
//
|
|
100
|
+
// This.worldRotation = 0;
|
|
44
101
|
/** @type {Rectangle} */
|
|
45
102
|
this.filterArea = null;
|
|
46
103
|
/** @type {number} */
|
|
@@ -85,7 +142,7 @@ export class DisplayObject {
|
|
|
85
142
|
this.visible = false;
|
|
86
143
|
// TODO: investigate how to clean up properly object references without breaking delayed tween cleanups.
|
|
87
144
|
/*
|
|
88
|
-
|
|
145
|
+
This.position = null;
|
|
89
146
|
this.scale = null;
|
|
90
147
|
this.pivot = null;
|
|
91
148
|
this.anchor = null;
|
|
@@ -93,7 +150,7 @@ export class DisplayObject {
|
|
|
93
150
|
this.hitArea = null;
|
|
94
151
|
this.parent = null;
|
|
95
152
|
this.worldTransform = null;
|
|
96
|
-
//
|
|
153
|
+
// This.worldPosition = null;
|
|
97
154
|
this.worldScale = null;
|
|
98
155
|
this.filterArea = null;
|
|
99
156
|
this.cachedBounds = null;
|
|
@@ -174,8 +231,8 @@ export class DisplayObject {
|
|
|
174
231
|
throw new Error('The supplied index is out of bounds');
|
|
175
232
|
}
|
|
176
233
|
const currentIndex = this.getChildIndex(child);
|
|
177
|
-
this.children.splice(currentIndex, 1); //
|
|
178
|
-
this.children.splice(index, 0, child); //
|
|
234
|
+
this.children.splice(currentIndex, 1); // Remove from old position
|
|
235
|
+
this.children.splice(index, 0, child); // Add at new position
|
|
179
236
|
}
|
|
180
237
|
|
|
181
238
|
/**
|
|
@@ -269,37 +326,37 @@ export class DisplayObject {
|
|
|
269
326
|
} else if (!this.parent) {
|
|
270
327
|
p = this.game.world;
|
|
271
328
|
}
|
|
272
|
-
//
|
|
329
|
+
// Create some matrix refs for easy access
|
|
273
330
|
const pt = p.worldTransform;
|
|
274
331
|
const wt = this.worldTransform;
|
|
275
|
-
//
|
|
332
|
+
// Temporary matrix variables
|
|
276
333
|
let a;
|
|
277
334
|
let b;
|
|
278
335
|
let c;
|
|
279
336
|
let d;
|
|
280
337
|
let tx;
|
|
281
338
|
let ty;
|
|
282
|
-
//
|
|
339
|
+
// So if rotation is between 0 then we can simplify the multiplication process..
|
|
283
340
|
if (this.rotation % PI_2) {
|
|
284
|
-
//
|
|
341
|
+
// Check to see if the rotation is the same as the previous render. This means we only need to use sin and cos when rotation actually changes
|
|
285
342
|
if (this.rotation !== this.rotationCache) {
|
|
286
343
|
this.rotationCache = this.rotation;
|
|
287
344
|
this._sr = Math.sin(this.rotation);
|
|
288
345
|
this._cr = Math.cos(this.rotation);
|
|
289
346
|
}
|
|
290
|
-
//
|
|
347
|
+
// Get the matrix values of the displayobject based on its transform properties..
|
|
291
348
|
a = this._cr * this.scale.x;
|
|
292
349
|
b = this._sr * this.scale.x;
|
|
293
350
|
c = -this._sr * this.scale.y;
|
|
294
351
|
d = this._cr * this.scale.y;
|
|
295
352
|
tx = this.position.x;
|
|
296
353
|
ty = this.position.y;
|
|
297
|
-
//
|
|
354
|
+
// Check for pivot.. not often used so geared towards that fact!
|
|
298
355
|
if (this.pivot.x || this.pivot.y) {
|
|
299
356
|
tx -= this.pivot.x * a + this.pivot.y * c;
|
|
300
357
|
ty -= this.pivot.x * b + this.pivot.y * d;
|
|
301
358
|
}
|
|
302
|
-
//
|
|
359
|
+
// Concat the parent matrix with the objects transform.
|
|
303
360
|
wt.a = a * pt.a + b * pt.c;
|
|
304
361
|
wt.b = a * pt.b + b * pt.d;
|
|
305
362
|
wt.c = c * pt.a + d * pt.c;
|
|
@@ -307,7 +364,7 @@ export class DisplayObject {
|
|
|
307
364
|
wt.tx = tx * pt.a + ty * pt.c + pt.tx;
|
|
308
365
|
wt.ty = tx * pt.b + ty * pt.d + pt.ty;
|
|
309
366
|
} else {
|
|
310
|
-
//
|
|
367
|
+
// Lets do the fast version as we know there is no rotation..
|
|
311
368
|
a = this.scale.x;
|
|
312
369
|
d = this.scale.y;
|
|
313
370
|
tx = this.position.x - this.pivot.x * a;
|
|
@@ -321,13 +378,13 @@ export class DisplayObject {
|
|
|
321
378
|
}
|
|
322
379
|
// Set the World values
|
|
323
380
|
this.worldAlpha = this.alpha * p.worldAlpha;
|
|
324
|
-
//
|
|
381
|
+
// This.worldPosition.setTo(wt.tx, wt.ty);
|
|
325
382
|
this.worldScale.setTo(
|
|
326
383
|
this.scale.x * Math.sqrt(wt.a * wt.a + wt.c * wt.c),
|
|
327
384
|
this.scale.y * Math.sqrt(wt.b * wt.b + wt.d * wt.d)
|
|
328
385
|
);
|
|
329
386
|
this.worldRotation = Math.atan2(-wt.c, wt.d);
|
|
330
|
-
//
|
|
387
|
+
// Reset the bounds each time this is called!
|
|
331
388
|
this.currentBounds = null;
|
|
332
389
|
// Custom callback?
|
|
333
390
|
if (this.transformCallback) {
|
|
@@ -391,13 +448,13 @@ export class DisplayObject {
|
|
|
391
448
|
const w1 = bounds.width + bounds.x;
|
|
392
449
|
const h0 = bounds.y;
|
|
393
450
|
const h1 = bounds.height + bounds.y;
|
|
394
|
-
const worldTransform = this
|
|
395
|
-
const a = worldTransform
|
|
396
|
-
const b = worldTransform
|
|
397
|
-
const c = worldTransform
|
|
398
|
-
const d = worldTransform
|
|
399
|
-
const tx = worldTransform
|
|
400
|
-
const ty = worldTransform
|
|
451
|
+
const { worldTransform } = this;
|
|
452
|
+
const { a } = worldTransform;
|
|
453
|
+
const { b } = worldTransform;
|
|
454
|
+
const { c } = worldTransform;
|
|
455
|
+
const { d } = worldTransform;
|
|
456
|
+
const { tx } = worldTransform;
|
|
457
|
+
const { ty } = worldTransform;
|
|
401
458
|
const x1 = a * w1 + c * h1 + tx;
|
|
402
459
|
const y1 = d * h1 + b * w1 + ty;
|
|
403
460
|
const x2 = a * w0 + c * h1 + tx;
|
|
@@ -474,7 +531,7 @@ export class DisplayObject {
|
|
|
474
531
|
}
|
|
475
532
|
let i;
|
|
476
533
|
if (this._mask || this._filters) {
|
|
477
|
-
//
|
|
534
|
+
// Push filter first as we need to ensure the stencil buffer is correct for any masking
|
|
478
535
|
if (this._filters) {
|
|
479
536
|
renderSession.spriteBatch.flush();
|
|
480
537
|
renderSession.filterManager.pushFilter(this._filterBlock);
|
|
@@ -488,8 +545,12 @@ export class DisplayObject {
|
|
|
488
545
|
this.children[i].renderWebGL(renderSession);
|
|
489
546
|
}
|
|
490
547
|
renderSession.spriteBatch.stop();
|
|
491
|
-
if (this._mask)
|
|
492
|
-
|
|
548
|
+
if (this._mask) {
|
|
549
|
+
renderSession.maskManager.popMask(this._mask, renderSession);
|
|
550
|
+
}
|
|
551
|
+
if (this._filters) {
|
|
552
|
+
renderSession.filterManager.popFilter();
|
|
553
|
+
}
|
|
493
554
|
renderSession.spriteBatch.start();
|
|
494
555
|
} else {
|
|
495
556
|
for (i = 0; i < this.children.length; i += 1) {
|
|
@@ -521,21 +582,21 @@ export class DisplayObject {
|
|
|
521
582
|
* Called before the update cycle for this display object.
|
|
522
583
|
*/
|
|
523
584
|
preUpdate() {
|
|
524
|
-
//
|
|
585
|
+
// Override
|
|
525
586
|
}
|
|
526
587
|
|
|
527
588
|
/**
|
|
528
589
|
* Called during the update cycle for this display object.
|
|
529
590
|
*/
|
|
530
591
|
update() {
|
|
531
|
-
//
|
|
592
|
+
// Override
|
|
532
593
|
}
|
|
533
594
|
|
|
534
595
|
/**
|
|
535
596
|
* Called after the update cycle for this display object.
|
|
536
597
|
*/
|
|
537
598
|
postUpdate() {
|
|
538
|
-
//
|
|
599
|
+
// Override
|
|
539
600
|
}
|
|
540
601
|
|
|
541
602
|
/**
|
|
@@ -620,7 +681,7 @@ export class DisplayObject {
|
|
|
620
681
|
* @param {number} value - The new width in pixels.
|
|
621
682
|
*/
|
|
622
683
|
set width(value) {
|
|
623
|
-
const width = this.getLocalBounds()
|
|
684
|
+
const { width } = this.getLocalBounds();
|
|
624
685
|
if (width !== 0) {
|
|
625
686
|
this.scale.x = value / width;
|
|
626
687
|
} else {
|
|
@@ -642,7 +703,7 @@ export class DisplayObject {
|
|
|
642
703
|
* @param {number} value - The new height in pixels.
|
|
643
704
|
*/
|
|
644
705
|
set height(value) {
|
|
645
|
-
const height = this.getLocalBounds()
|
|
706
|
+
const { height } = this.getLocalBounds();
|
|
646
707
|
if (height !== 0) {
|
|
647
708
|
this.scale.y = value / height;
|
|
648
709
|
} else {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import {
|
|
2
3
|
BLEND_NORMAL,
|
|
3
4
|
GEOM_CIRCLE,
|
|
@@ -25,6 +26,24 @@ import { renderGraphics as renderWebGLGraphics } from './webgl/graphics.js';
|
|
|
25
26
|
import { textureFromCanvas } from './webgl/texture_util.js';
|
|
26
27
|
|
|
27
28
|
export class Graphics extends DisplayObject {
|
|
29
|
+
type;
|
|
30
|
+
renderable;
|
|
31
|
+
fillAlpha;
|
|
32
|
+
lineWidth;
|
|
33
|
+
lineColor;
|
|
34
|
+
graphicsData;
|
|
35
|
+
tint;
|
|
36
|
+
blendMode;
|
|
37
|
+
currentPath;
|
|
38
|
+
_webGL;
|
|
39
|
+
isMask;
|
|
40
|
+
boundsPadding;
|
|
41
|
+
_localBounds;
|
|
42
|
+
dirty;
|
|
43
|
+
_boundsDirty;
|
|
44
|
+
_cacheAsBitmap;
|
|
45
|
+
webGLDirty;
|
|
46
|
+
cachedSpriteDirty;
|
|
28
47
|
/**
|
|
29
48
|
* Creates a new Graphics object.
|
|
30
49
|
* @param {import('../core/game.js').Game} game - The game instance.
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import { clone } from './graphics_data_util.js';
|
|
2
3
|
|
|
3
4
|
export class GraphicsData {
|
|
5
|
+
lineWidth;
|
|
6
|
+
lineColor;
|
|
7
|
+
lineAlpha;
|
|
8
|
+
_lineTint;
|
|
9
|
+
fillColor;
|
|
10
|
+
fillAlpha;
|
|
11
|
+
_fillTint;
|
|
12
|
+
fill;
|
|
13
|
+
shape;
|
|
14
|
+
type;
|
|
4
15
|
/**
|
|
5
16
|
* Creates a new GraphicsData object.
|
|
6
17
|
* @param {number} lineWidth - The line width.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import { GROUP } from '../core/const.js';
|
|
2
3
|
import { Signal } from '../core/signal.js';
|
|
3
4
|
import { DisplayObject } from './display_object.js';
|
|
@@ -7,6 +8,34 @@ export const SORT_ASCENDING = -1;
|
|
|
7
8
|
export const SORT_DESCENDING = 1;
|
|
8
9
|
|
|
9
10
|
export class Group extends DisplayObject {
|
|
11
|
+
/** @type {number} */
|
|
12
|
+
z;
|
|
13
|
+
/** @type {boolean} */
|
|
14
|
+
ignoreDestroy;
|
|
15
|
+
/** @type {boolean} */
|
|
16
|
+
pendingDestroy;
|
|
17
|
+
/** @type {Function} */
|
|
18
|
+
classType;
|
|
19
|
+
/** @type {DisplayObject | null} */
|
|
20
|
+
cursor;
|
|
21
|
+
/** @type {boolean} */
|
|
22
|
+
inputEnableChildren;
|
|
23
|
+
/** @type {Signal} */
|
|
24
|
+
onChildInputDown;
|
|
25
|
+
/** @type {Signal} */
|
|
26
|
+
onChildInputUp;
|
|
27
|
+
/** @type {Signal} */
|
|
28
|
+
onChildInputOver;
|
|
29
|
+
/** @type {Signal} */
|
|
30
|
+
onChildInputOut;
|
|
31
|
+
/** @type {Signal} */
|
|
32
|
+
onDestroy;
|
|
33
|
+
/** @type {number} */
|
|
34
|
+
cursorIndex;
|
|
35
|
+
/** @type {string} */
|
|
36
|
+
_sortProperty;
|
|
37
|
+
/** @type {object[] | null} */
|
|
38
|
+
filters;
|
|
10
39
|
/**
|
|
11
40
|
* Creates a new Group object.
|
|
12
41
|
* @param {import('../core/game.js').Game} game - The game instance this group belongs to.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import { AnimationManager } from '../core/animation_manager.js';
|
|
2
3
|
import { BLEND_NORMAL, IMAGE, PENDING_ATLAS, SCALE_NEAREST } from '../core/const.js';
|
|
3
4
|
import { EventManager } from '../core/event_manager.js';
|
|
@@ -8,6 +9,44 @@ import { getBounds, getLocalBounds, renderCanvas, renderWebGL, setTexture } from
|
|
|
8
9
|
import { Texture } from './webgl/texture.js';
|
|
9
10
|
|
|
10
11
|
export class Image extends DisplayObject {
|
|
12
|
+
/** @type {string | number | Texture} */
|
|
13
|
+
key;
|
|
14
|
+
/** @type {Texture} */
|
|
15
|
+
texture;
|
|
16
|
+
/** @type {number} */
|
|
17
|
+
_width;
|
|
18
|
+
/** @type {number} */
|
|
19
|
+
_height;
|
|
20
|
+
/** @type {number} */
|
|
21
|
+
tint;
|
|
22
|
+
/** @type {number} */
|
|
23
|
+
cachedTint;
|
|
24
|
+
/** @type {Texture | null} */
|
|
25
|
+
tilingTexture;
|
|
26
|
+
/** @type {Texture | null} */
|
|
27
|
+
tintedTexture;
|
|
28
|
+
/** @type {number} */
|
|
29
|
+
blendMode;
|
|
30
|
+
/** @type {object | null} */
|
|
31
|
+
shader;
|
|
32
|
+
/** @type {import('../core/frame.js').Frame | null} */
|
|
33
|
+
_frame;
|
|
34
|
+
/** @type {boolean} */
|
|
35
|
+
pendingDestroy;
|
|
36
|
+
/** @type {EventManager} */
|
|
37
|
+
events;
|
|
38
|
+
/** @type {AnimationManager} */
|
|
39
|
+
animations;
|
|
40
|
+
/** @type {boolean} */
|
|
41
|
+
customRender;
|
|
42
|
+
/** @type {Rectangle | null} */
|
|
43
|
+
cropRect;
|
|
44
|
+
/** @type {Rectangle | null} */
|
|
45
|
+
_crop;
|
|
46
|
+
/** @type {boolean} */
|
|
47
|
+
refreshTexture;
|
|
48
|
+
/** @type {number} */
|
|
49
|
+
renderOrderID;
|
|
11
50
|
/**
|
|
12
51
|
* Creates a new Image instance.
|
|
13
52
|
* @param {import('../core/game.js').Game} game - The game instance this image belongs to.
|
|
@@ -32,7 +71,7 @@ export class Image extends DisplayObject {
|
|
|
32
71
|
/** @type {number} */
|
|
33
72
|
this._height = 0;
|
|
34
73
|
/** @type {number} */
|
|
35
|
-
this.tint =
|
|
74
|
+
this.tint = 0xff_ff_ff;
|
|
36
75
|
/** @type {number} */
|
|
37
76
|
this.cachedTint = -1;
|
|
38
77
|
/** @type {Texture | null} */
|
|
@@ -45,7 +84,7 @@ export class Image extends DisplayObject {
|
|
|
45
84
|
this._frame = null;
|
|
46
85
|
/** @type {boolean} */
|
|
47
86
|
this.pendingDestroy = false;
|
|
48
|
-
/*
|
|
87
|
+
/* If (this.texture.baseTexture.hasLoaded) {
|
|
49
88
|
this.onTextureUpdate();
|
|
50
89
|
} */
|
|
51
90
|
this.position.setTo(x, y);
|
|
@@ -64,7 +103,7 @@ export class Image extends DisplayObject {
|
|
|
64
103
|
this.key = null;
|
|
65
104
|
this.data = null;
|
|
66
105
|
this.texture = null;
|
|
67
|
-
this.tint =
|
|
106
|
+
this.tint = 0xff_ff_ff;
|
|
68
107
|
this.cachedTint = -1;
|
|
69
108
|
this.tintedTexture = null;
|
|
70
109
|
this.shader = null;
|
|
@@ -112,7 +151,7 @@ export class Image extends DisplayObject {
|
|
|
112
151
|
* @param {string | number | null | undefined} frame - The frame identifier (name or index) to use.
|
|
113
152
|
* @param {boolean} stopAnimation - Whether to stop the animation when changing textures.
|
|
114
153
|
*/
|
|
115
|
-
loadTexture(key, frame = 0, stopAnimation = true) {
|
|
154
|
+
loadTexture(key, frame: string | number | null = 0, stopAnimation = true) {
|
|
116
155
|
if (key === PENDING_ATLAS) {
|
|
117
156
|
key = frame;
|
|
118
157
|
frame = 0;
|
|
@@ -124,7 +163,7 @@ export class Image extends DisplayObject {
|
|
|
124
163
|
}
|
|
125
164
|
this.key = key;
|
|
126
165
|
this.customRender = false;
|
|
127
|
-
const cache = this.game
|
|
166
|
+
const { cache } = this.game;
|
|
128
167
|
const smoothed = !this.texture.baseTexture.scaleMode;
|
|
129
168
|
let setFrame = true;
|
|
130
169
|
if (key instanceof Texture) {
|
|
@@ -341,7 +380,7 @@ export class Image extends DisplayObject {
|
|
|
341
380
|
* Called when the texture of this image is updated.
|
|
342
381
|
*/
|
|
343
382
|
onTextureUpdate() {
|
|
344
|
-
//
|
|
383
|
+
// So if _width is 0 then width was not set..
|
|
345
384
|
if (this._width) {
|
|
346
385
|
this.scale.x = this._width / this.texture.frame.width;
|
|
347
386
|
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import { removeByCanvas } from '../canvas/pool.js';
|
|
2
3
|
|
|
3
4
|
export class BaseTexture {
|
|
5
|
+
resolution;
|
|
6
|
+
width;
|
|
7
|
+
height;
|
|
8
|
+
scaleMode;
|
|
9
|
+
hasLoaded;
|
|
10
|
+
source;
|
|
11
|
+
premultipliedAlpha;
|
|
12
|
+
_glTextures;
|
|
13
|
+
mipmap;
|
|
14
|
+
skipRender;
|
|
15
|
+
_powerOf2;
|
|
16
|
+
_dirty;
|
|
4
17
|
/**
|
|
5
18
|
* Updates the base texture with a new source.
|
|
6
19
|
* @param {HTMLCanvasElement} source - The new canvas element to use as the texture source.
|
|
@@ -415,7 +415,7 @@ export function linkedList(data, start, end, dim, clockwise) {
|
|
|
415
415
|
* @param {object} end - The ending point in the data structure.
|
|
416
416
|
* @returns {object} The calculated bounding box with min and max coordinates.
|
|
417
417
|
*/
|
|
418
|
-
export function filterPoints(start, end) {
|
|
418
|
+
export function filterPoints(start, end?) {
|
|
419
419
|
if (!start) return start;
|
|
420
420
|
if (!end) end = start;
|
|
421
421
|
let p = start;
|
|
@@ -599,7 +599,7 @@ export function splitEarcut(start, triangles, dim, minX, minY, size) {
|
|
|
599
599
|
* @param {number} size - The size of the bounding box.
|
|
600
600
|
* @param {object} pass - The pass information for triangulation.
|
|
601
601
|
*/
|
|
602
|
-
export function earcutLinked(ear, triangles, dim, minX
|
|
602
|
+
export function earcutLinked(ear, triangles, dim, minX?, minY?, size?, pass?) {
|
|
603
603
|
if (!ear) return;
|
|
604
604
|
// interlink polygon nodes in z-order
|
|
605
605
|
if (!pass && size) indexCurve(ear, minX, minY, size);
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
export class Node {
|
|
2
|
+
i: number;
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
prev: Node | null;
|
|
6
|
+
next: Node | null;
|
|
7
|
+
z: number | null;
|
|
8
|
+
prevZ: Node | null;
|
|
9
|
+
nextZ: Node | null;
|
|
10
|
+
steiner: boolean;
|
|
11
|
+
|
|
2
12
|
/**
|
|
3
13
|
* Creates a new Node instance.
|
|
4
14
|
* @param {number} i - The vertice index in coordinates array.
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
export class FastSpriteBatch {
|
|
3
|
+
vertSize;
|
|
4
|
+
maxSize;
|
|
5
|
+
size;
|
|
6
|
+
vertices;
|
|
7
|
+
indices;
|
|
8
|
+
vertexBuffer;
|
|
9
|
+
indexBuffer;
|
|
10
|
+
lastIndexCount;
|
|
11
|
+
drawing;
|
|
12
|
+
currentBatchSize;
|
|
13
|
+
currentBaseTexture;
|
|
14
|
+
currentBlendMode;
|
|
15
|
+
renderSession;
|
|
16
|
+
shader;
|
|
17
|
+
matrix;
|
|
2
18
|
/**
|
|
3
19
|
* Creates a new FastSpriteBatch instance.
|
|
4
20
|
* @param {WebGLRenderingContext & { id: number }} gl - The WebGL rendering context.
|