@number10/phaserjsx 0.1.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/LICENSE +667 -0
- package/README.md +238 -0
- package/dist/TransformOriginView-BYPbRH8N.cjs +17045 -0
- package/dist/TransformOriginView-BYPbRH8N.cjs.map +1 -0
- package/dist/TransformOriginView-CO-tJCmV.js +17046 -0
- package/dist/TransformOriginView-CO-tJCmV.js.map +1 -0
- package/dist/animation/animated-signal.d.ts +35 -0
- package/dist/animation/animated-signal.d.ts.map +1 -0
- package/dist/animation/index.d.ts +7 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/spring-physics.d.ts +120 -0
- package/dist/animation/spring-physics.d.ts.map +1 -0
- package/dist/animation/useSpring.d.ts +54 -0
- package/dist/animation/useSpring.d.ts.map +1 -0
- package/dist/colors/color-presets.d.ts +89 -0
- package/dist/colors/color-presets.d.ts.map +1 -0
- package/dist/colors/color-theme-helpers.d.ts +65 -0
- package/dist/colors/color-theme-helpers.d.ts.map +1 -0
- package/dist/colors/color-types.d.ts +100 -0
- package/dist/colors/color-types.d.ts.map +1 -0
- package/dist/colors/color-utils.d.ts +171 -0
- package/dist/colors/color-utils.d.ts.map +1 -0
- package/dist/colors/index.d.ts +17 -0
- package/dist/colors/index.d.ts.map +1 -0
- package/dist/colors/preset-manager.d.ts +35 -0
- package/dist/colors/preset-manager.d.ts.map +1 -0
- package/dist/colors/use-color-mode.d.ts +22 -0
- package/dist/colors/use-color-mode.d.ts.map +1 -0
- package/dist/colors/use-colors.d.ts +40 -0
- package/dist/colors/use-colors.d.ts.map +1 -0
- package/dist/components/appliers/applyBackground.d.ts +13 -0
- package/dist/components/appliers/applyBackground.d.ts.map +1 -0
- package/dist/components/appliers/applyGestures.d.ts +12 -0
- package/dist/components/appliers/applyGestures.d.ts.map +1 -0
- package/dist/components/appliers/applyGraphics.d.ts +10 -0
- package/dist/components/appliers/applyGraphics.d.ts.map +1 -0
- package/dist/components/appliers/applyGraphicsLayout.d.ts +10 -0
- package/dist/components/appliers/applyGraphicsLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyImage.d.ts +10 -0
- package/dist/components/appliers/applyImage.d.ts.map +1 -0
- package/dist/components/appliers/applyImageLayout.d.ts +15 -0
- package/dist/components/appliers/applyImageLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyLayout.d.ts +15 -0
- package/dist/components/appliers/applyLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyNineSlice.d.ts +11 -0
- package/dist/components/appliers/applyNineSlice.d.ts.map +1 -0
- package/dist/components/appliers/applyNineSliceLayout.d.ts +15 -0
- package/dist/components/appliers/applyNineSliceLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyPhaser.d.ts +22 -0
- package/dist/components/appliers/applyPhaser.d.ts.map +1 -0
- package/dist/components/appliers/applySprite.d.ts +10 -0
- package/dist/components/appliers/applySprite.d.ts.map +1 -0
- package/dist/components/appliers/applySpriteLayout.d.ts +14 -0
- package/dist/components/appliers/applySpriteLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyText.d.ts +25 -0
- package/dist/components/appliers/applyText.d.ts.map +1 -0
- package/dist/components/appliers/applyTextLayout.d.ts +15 -0
- package/dist/components/appliers/applyTextLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyTooltip.d.ts +12 -0
- package/dist/components/appliers/applyTooltip.d.ts.map +1 -0
- package/dist/components/appliers/applyTransform.d.ts +21 -0
- package/dist/components/appliers/applyTransform.d.ts.map +1 -0
- package/dist/components/creators/createBackground.d.ts +15 -0
- package/dist/components/creators/createBackground.d.ts.map +1 -0
- package/dist/components/creators/createGestures.d.ts +11 -0
- package/dist/components/creators/createGestures.d.ts.map +1 -0
- package/dist/components/creators/createGraphicsLayout.d.ts +9 -0
- package/dist/components/creators/createGraphicsLayout.d.ts.map +1 -0
- package/dist/components/creators/createImageLayout.d.ts +14 -0
- package/dist/components/creators/createImageLayout.d.ts.map +1 -0
- package/dist/components/creators/createLayout.d.ts +15 -0
- package/dist/components/creators/createLayout.d.ts.map +1 -0
- package/dist/components/creators/createNineSliceLayout.d.ts +14 -0
- package/dist/components/creators/createNineSliceLayout.d.ts.map +1 -0
- package/dist/components/creators/createPhaser.d.ts +14 -0
- package/dist/components/creators/createPhaser.d.ts.map +1 -0
- package/dist/components/creators/createSpriteLayout.d.ts +15 -0
- package/dist/components/creators/createSpriteLayout.d.ts.map +1 -0
- package/dist/components/creators/createTextLayout.d.ts +14 -0
- package/dist/components/creators/createTextLayout.d.ts.map +1 -0
- package/dist/components/creators/createTransform.d.ts +11 -0
- package/dist/components/creators/createTransform.d.ts.map +1 -0
- package/dist/components/custom/Accordion.d.ts +34 -0
- package/dist/components/custom/Accordion.d.ts.map +1 -0
- package/dist/components/custom/AlertDialog.d.ts +63 -0
- package/dist/components/custom/AlertDialog.d.ts.map +1 -0
- package/dist/components/custom/Button.d.ts +44 -0
- package/dist/components/custom/Button.d.ts.map +1 -0
- package/dist/components/custom/CharText/CharText.d.ts +8 -0
- package/dist/components/custom/CharText/CharText.d.ts.map +1 -0
- package/dist/components/custom/CharText/index.d.ts +3 -0
- package/dist/components/custom/CharText/index.d.ts.map +1 -0
- package/dist/components/custom/CharText/types.d.ts +117 -0
- package/dist/components/custom/CharText/types.d.ts.map +1 -0
- package/dist/components/custom/CharText/utils.d.ts +34 -0
- package/dist/components/custom/CharText/utils.d.ts.map +1 -0
- package/dist/components/custom/CharTextInput.d.ts +62 -0
- package/dist/components/custom/CharTextInput.d.ts.map +1 -0
- package/dist/components/custom/Dialog.d.ts +60 -0
- package/dist/components/custom/Dialog.d.ts.map +1 -0
- package/dist/components/custom/Divider.d.ts +21 -0
- package/dist/components/custom/Divider.d.ts.map +1 -0
- package/dist/components/custom/Dropdown.d.ts +91 -0
- package/dist/components/custom/Dropdown.d.ts.map +1 -0
- package/dist/components/custom/Icon.d.ts +75 -0
- package/dist/components/custom/Icon.d.ts.map +1 -0
- package/dist/components/custom/Image.d.ts +50 -0
- package/dist/components/custom/Image.d.ts.map +1 -0
- package/dist/components/custom/Modal.d.ts +37 -0
- package/dist/components/custom/Modal.d.ts.map +1 -0
- package/dist/components/custom/NineSlice.d.ts +81 -0
- package/dist/components/custom/NineSlice.d.ts.map +1 -0
- package/dist/components/custom/NineSliceButton.d.ts +128 -0
- package/dist/components/custom/NineSliceButton.d.ts.map +1 -0
- package/dist/components/custom/Portal.d.ts +43 -0
- package/dist/components/custom/Portal.d.ts.map +1 -0
- package/dist/components/custom/Portal.test.d.ts +2 -0
- package/dist/components/custom/Portal.test.d.ts.map +1 -0
- package/dist/components/custom/RadioButton.d.ts +20 -0
- package/dist/components/custom/RadioButton.d.ts.map +1 -0
- package/dist/components/custom/RadioGroup.d.ts +33 -0
- package/dist/components/custom/RadioGroup.d.ts.map +1 -0
- package/dist/components/custom/RefOriginView.d.ts +45 -0
- package/dist/components/custom/RefOriginView.d.ts.map +1 -0
- package/dist/components/custom/ScrollSlider.d.ts +36 -0
- package/dist/components/custom/ScrollSlider.d.ts.map +1 -0
- package/dist/components/custom/ScrollView.d.ts +48 -0
- package/dist/components/custom/ScrollView.d.ts.map +1 -0
- package/dist/components/custom/Sidebar.d.ts +50 -0
- package/dist/components/custom/Sidebar.d.ts.map +1 -0
- package/dist/components/custom/Slider.d.ts +131 -0
- package/dist/components/custom/Slider.d.ts.map +1 -0
- package/dist/components/custom/Text.d.ts +26 -0
- package/dist/components/custom/Text.d.ts.map +1 -0
- package/dist/components/custom/Toggle.d.ts +51 -0
- package/dist/components/custom/Toggle.d.ts.map +1 -0
- package/dist/components/custom/TransformOriginView.d.ts +34 -0
- package/dist/components/custom/TransformOriginView.d.ts.map +1 -0
- package/dist/components/custom/View.d.ts +33 -0
- package/dist/components/custom/View.d.ts.map +1 -0
- package/dist/components/custom/WrapText.d.ts +60 -0
- package/dist/components/custom/WrapText.d.ts.map +1 -0
- package/dist/components/custom/index.cjs +32 -0
- package/dist/components/custom/index.cjs.map +1 -0
- package/dist/components/custom/index.d.ts +29 -0
- package/dist/components/custom/index.d.ts.map +1 -0
- package/dist/components/custom/index.js +32 -0
- package/dist/components/custom/index.js.map +1 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/internal/SceneWrapper.d.ts +20 -0
- package/dist/components/internal/SceneWrapper.d.ts.map +1 -0
- package/dist/components/primitives/graphics.d.ts +40 -0
- package/dist/components/primitives/graphics.d.ts.map +1 -0
- package/dist/components/primitives/image.d.ts +45 -0
- package/dist/components/primitives/image.d.ts.map +1 -0
- package/dist/components/primitives/nineslice.d.ts +111 -0
- package/dist/components/primitives/nineslice.d.ts.map +1 -0
- package/dist/components/primitives/sprite.d.ts +58 -0
- package/dist/components/primitives/sprite.d.ts.map +1 -0
- package/dist/components/primitives/text.d.ts +26 -0
- package/dist/components/primitives/text.d.ts.map +1 -0
- package/dist/components/primitives/tilesprite.d.ts +47 -0
- package/dist/components/primitives/tilesprite.d.ts.map +1 -0
- package/dist/components/primitives/view.d.ts +23 -0
- package/dist/components/primitives/view.d.ts.map +1 -0
- package/dist/core-props.d.ts +605 -0
- package/dist/core-props.d.ts.map +1 -0
- package/dist/core-types.d.ts +59 -0
- package/dist/core-types.d.ts.map +1 -0
- package/dist/design-tokens/design-token-presets.d.ts +26 -0
- package/dist/design-tokens/design-token-presets.d.ts.map +1 -0
- package/dist/design-tokens/design-token-types.d.ts +109 -0
- package/dist/design-tokens/design-token-types.d.ts.map +1 -0
- package/dist/design-tokens/index.d.ts +8 -0
- package/dist/design-tokens/index.d.ts.map +1 -0
- package/dist/design-tokens/use-theme-tokens.d.ts +28 -0
- package/dist/design-tokens/use-theme-tokens.d.ts.map +1 -0
- package/dist/dev-config.d.ts +238 -0
- package/dist/dev-config.d.ts.map +1 -0
- package/dist/effects/effect-registry.d.ts +54 -0
- package/dist/effects/effect-registry.d.ts.map +1 -0
- package/dist/effects/index.d.ts +56 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/use-effect.d.ts +172 -0
- package/dist/effects/use-effect.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/index.d.ts +7 -0
- package/dist/fx/convenience-hooks/index.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-blur.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-blur.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-glow.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-glow.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-shadow.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-shadow.d.ts.map +1 -0
- package/dist/fx/fx-creators/blur.d.ts +37 -0
- package/dist/fx/fx-creators/blur.d.ts.map +1 -0
- package/dist/fx/fx-creators/color-matrix.d.ts +31 -0
- package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -0
- package/dist/fx/fx-creators/glow.d.ts +36 -0
- package/dist/fx/fx-creators/glow.d.ts.map +1 -0
- package/dist/fx/fx-creators/index.d.ts +10 -0
- package/dist/fx/fx-creators/index.d.ts.map +1 -0
- package/dist/fx/fx-creators/pixelate.d.ts +24 -0
- package/dist/fx/fx-creators/pixelate.d.ts.map +1 -0
- package/dist/fx/fx-creators/shadow.d.ts +43 -0
- package/dist/fx/fx-creators/shadow.d.ts.map +1 -0
- package/dist/fx/fx-creators/vignette.d.ts +33 -0
- package/dist/fx/fx-creators/vignette.d.ts.map +1 -0
- package/dist/fx/fx-registry.d.ts +59 -0
- package/dist/fx/fx-registry.d.ts.map +1 -0
- package/dist/fx/index.d.ts +51 -0
- package/dist/fx/index.d.ts.map +1 -0
- package/dist/fx/use-fx.d.ts +53 -0
- package/dist/fx/use-fx.d.ts.map +1 -0
- package/dist/gestures/gesture-manager.d.ts +149 -0
- package/dist/gestures/gesture-manager.d.ts.map +1 -0
- package/dist/gestures/gesture-types.d.ts +229 -0
- package/dist/gestures/gesture-types.d.ts.map +1 -0
- package/dist/hooks-svg.d.ts +104 -0
- package/dist/hooks-svg.d.ts.map +1 -0
- package/dist/hooks.d.ts +135 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/host.d.ts +74 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/index.cjs +584 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +582 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-dev-runtime.cjs +10 -0
- package/dist/jsx-dev-runtime.cjs.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +5 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +11 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.cjs +43 -0
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime.d.ts +25 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +43 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-types.d.ts +33 -0
- package/dist/jsx-types.d.ts.map +1 -0
- package/dist/layout/appliers/background-applier.d.ts +16 -0
- package/dist/layout/appliers/background-applier.d.ts.map +1 -0
- package/dist/layout/appliers/container-applier.d.ts +9 -0
- package/dist/layout/appliers/container-applier.d.ts.map +1 -0
- package/dist/layout/appliers/position-applier.d.ts +8 -0
- package/dist/layout/appliers/position-applier.d.ts.map +1 -0
- package/dist/layout/index.d.ts +22 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/layout-engine-test-utils.d.ts +19 -0
- package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
- package/dist/layout/layout-engine.d.ts +98 -0
- package/dist/layout/layout-engine.d.ts.map +1 -0
- package/dist/layout/strategies/base-strategy.d.ts +59 -0
- package/dist/layout/strategies/base-strategy.d.ts.map +1 -0
- package/dist/layout/strategies/column-layout.d.ts +38 -0
- package/dist/layout/strategies/column-layout.d.ts.map +1 -0
- package/dist/layout/strategies/row-layout.d.ts +38 -0
- package/dist/layout/strategies/row-layout.d.ts.map +1 -0
- package/dist/layout/strategies/stack-layout.d.ts +30 -0
- package/dist/layout/strategies/stack-layout.d.ts.map +1 -0
- package/dist/layout/types.d.ts +137 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/utils/child-utils.d.ts +74 -0
- package/dist/layout/utils/child-utils.d.ts.map +1 -0
- package/dist/layout/utils/dimension-calculator.d.ts +59 -0
- package/dist/layout/utils/dimension-calculator.d.ts.map +1 -0
- package/dist/layout/utils/flex-distributor.d.ts +18 -0
- package/dist/layout/utils/flex-distributor.d.ts.map +1 -0
- package/dist/layout/utils/size-resolver.d.ts +84 -0
- package/dist/layout/utils/size-resolver.d.ts.map +1 -0
- package/dist/layout/utils/spacing-calculator.d.ts +27 -0
- package/dist/layout/utils/spacing-calculator.d.ts.map +1 -0
- package/dist/memo.d.ts +29 -0
- package/dist/memo.d.ts.map +1 -0
- package/dist/portal/index.d.ts +6 -0
- package/dist/portal/index.d.ts.map +1 -0
- package/dist/portal/portal-registry.d.ts +97 -0
- package/dist/portal/portal-registry.d.ts.map +1 -0
- package/dist/portal/portal-types.d.ts +20 -0
- package/dist/portal/portal-types.d.ts.map +1 -0
- package/dist/render-context.d.ts +118 -0
- package/dist/render-context.d.ts.map +1 -0
- package/dist/scripts/generate-icon-loaders.d.ts +2 -0
- package/dist/scripts/generate-icon-loaders.d.ts.map +1 -0
- package/dist/scripts/generate-icon-loaders.js +195 -0
- package/dist/scripts/generate-icon-types.d.ts +2 -0
- package/dist/scripts/generate-icon-types.d.ts.map +1 -0
- package/dist/scripts/generate-icon-types.js +124 -0
- package/dist/scripts/generate-icons.d.ts +37 -0
- package/dist/scripts/generate-icons.d.ts.map +1 -0
- package/dist/scripts/generate-icons.js +494 -0
- package/dist/scripts/icon-generator-config.d.ts +87 -0
- package/dist/scripts/icon-generator-config.d.ts.map +1 -0
- package/dist/scripts/icon-generator-config.js +6 -0
- package/dist/theme-base.d.ts +116 -0
- package/dist/theme-base.d.ts.map +1 -0
- package/dist/theme-custom.d.ts +262 -0
- package/dist/theme-custom.d.ts.map +1 -0
- package/dist/theme-defaults.d.ts +6 -0
- package/dist/theme-defaults.d.ts.map +1 -0
- package/dist/theme.d.ts +132 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/tooltip/tooltip-types.d.ts +57 -0
- package/dist/tooltip/tooltip-types.d.ts.map +1 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/KeyboardInputManager.d.ts +48 -0
- package/dist/utils/KeyboardInputManager.d.ts.map +1 -0
- package/dist/utils/dom-input-manager.d.ts +109 -0
- package/dist/utils/dom-input-manager.d.ts.map +1 -0
- package/dist/utils/svg-texture.d.ts +30 -0
- package/dist/utils/svg-texture.d.ts.map +1 -0
- package/dist/utils/texture-registry.d.ts +49 -0
- package/dist/utils/texture-registry.d.ts.map +1 -0
- package/dist/vdom.d.ts +60 -0
- package/dist/vdom.d.ts.map +1 -0
- package/dist/viewport-context.d.ts +39 -0
- package/dist/viewport-context.d.ts.map +1 -0
- package/dist/vite-plugin-icons.d.ts +29 -0
- package/dist/vite-plugin-icons.d.ts.map +1 -0
- package/dist/vite-plugin-icons.js +95 -0
- package/package.json +117 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ref object type
|
|
3
|
+
*/
|
|
4
|
+
type RefObject<T> = {
|
|
5
|
+
current: T;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Effect configuration
|
|
9
|
+
*/
|
|
10
|
+
export interface EffectConfig {
|
|
11
|
+
magnitude?: number;
|
|
12
|
+
time?: number;
|
|
13
|
+
intensity?: number;
|
|
14
|
+
duration?: number;
|
|
15
|
+
direction?: 'left' | 'right' | 'up' | 'down';
|
|
16
|
+
angle?: number;
|
|
17
|
+
onComplete?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Effect callback function
|
|
21
|
+
* @param obj - The Phaser game object to apply effect to
|
|
22
|
+
* @param config - Effect configuration
|
|
23
|
+
*/
|
|
24
|
+
export type EffectFn = (obj: Phaser.GameObjects.Container, config: EffectConfig) => void;
|
|
25
|
+
/**
|
|
26
|
+
* This is a no-op effect function
|
|
27
|
+
*/
|
|
28
|
+
export declare const createNoneEffect: EffectFn;
|
|
29
|
+
/**
|
|
30
|
+
* Create a shake effect
|
|
31
|
+
* @param obj - Game object to shake
|
|
32
|
+
* @param config - Effect config (magnitude, time)
|
|
33
|
+
*/
|
|
34
|
+
export declare const createShakeEffect: EffectFn;
|
|
35
|
+
/**
|
|
36
|
+
* Create a pulse effect (scale animation)
|
|
37
|
+
* @param obj - Game object to pulse
|
|
38
|
+
* @param config - Effect config (intensity, time)
|
|
39
|
+
*/
|
|
40
|
+
export declare const createPulseEffect: EffectFn;
|
|
41
|
+
/**
|
|
42
|
+
* Create a fade effect
|
|
43
|
+
* @param obj - Game object to fade
|
|
44
|
+
* @param config - Effect config (time, duration)
|
|
45
|
+
*/
|
|
46
|
+
export declare const createFadeEffect: EffectFn;
|
|
47
|
+
/**
|
|
48
|
+
* Create a fade-in effect (alpha from 0 to original)
|
|
49
|
+
* @param obj - Game object to fade in
|
|
50
|
+
* @param config - Effect config (time)
|
|
51
|
+
*/
|
|
52
|
+
export declare const createFadeInEffect: EffectFn;
|
|
53
|
+
/**
|
|
54
|
+
* Create a fade-out effect (alpha from original to 0)
|
|
55
|
+
* @param obj - Game object to fade out
|
|
56
|
+
* @param config - Effect config (time)
|
|
57
|
+
*/
|
|
58
|
+
export declare const createFadeOutEffect: EffectFn;
|
|
59
|
+
/**
|
|
60
|
+
* Create a bounce effect (elastic bounce feedback)
|
|
61
|
+
* @param obj - Game object to bounce
|
|
62
|
+
* @param config - Effect config (intensity, time)
|
|
63
|
+
*/
|
|
64
|
+
export declare const createBounceEffect: EffectFn;
|
|
65
|
+
/**
|
|
66
|
+
* Create a flash effect (quick scale pulse for visibility)
|
|
67
|
+
* @param obj - Game object to flash
|
|
68
|
+
* @param config - Effect config (time, intensity)
|
|
69
|
+
*/
|
|
70
|
+
export declare const createFlashEffect: EffectFn;
|
|
71
|
+
/**
|
|
72
|
+
* Create a wobble effect (rotation-based shake)
|
|
73
|
+
* @param obj - Game object to wobble
|
|
74
|
+
* @param config - Effect config (magnitude, time)
|
|
75
|
+
*/
|
|
76
|
+
export declare const createWobbleEffect: EffectFn;
|
|
77
|
+
/**
|
|
78
|
+
* Create a jello effect (squash & stretch)
|
|
79
|
+
* @param obj - Game object for jello effect
|
|
80
|
+
* @param config - Effect config (intensity, time)
|
|
81
|
+
*/
|
|
82
|
+
export declare const createJelloEffect: EffectFn;
|
|
83
|
+
/**
|
|
84
|
+
* Create a press effect (scale down + bounce back, like button press)
|
|
85
|
+
* @param obj - Game object to press
|
|
86
|
+
* @param config - Effect config (intensity, time)
|
|
87
|
+
*/
|
|
88
|
+
export declare const createPressEffect: EffectFn;
|
|
89
|
+
/**
|
|
90
|
+
* Create a tada effect (attention grabber with scale + rotation)
|
|
91
|
+
* @param obj - Game object for tada effect
|
|
92
|
+
* @param config - Effect config (intensity, time)
|
|
93
|
+
*/
|
|
94
|
+
export declare const createTadaEffect: EffectFn;
|
|
95
|
+
/**
|
|
96
|
+
* Create a swing effect (pendulum animation)
|
|
97
|
+
* @param obj - Game object to swing
|
|
98
|
+
* @param config - Effect config (magnitude, time)
|
|
99
|
+
*/
|
|
100
|
+
export declare const createSwingEffect: EffectFn;
|
|
101
|
+
/**
|
|
102
|
+
* Create a wiggle effect (gentle horizontal shake)
|
|
103
|
+
* @param obj - Game object to wiggle
|
|
104
|
+
* @param config - Effect config (magnitude, time)
|
|
105
|
+
*/
|
|
106
|
+
export declare const createWiggleEffect: EffectFn;
|
|
107
|
+
/**
|
|
108
|
+
* Create a slide-in effect
|
|
109
|
+
* @param obj - Game object to slide in
|
|
110
|
+
* @param config - Effect config (direction, time)
|
|
111
|
+
*/
|
|
112
|
+
export declare const createSlideInEffect: EffectFn;
|
|
113
|
+
/**
|
|
114
|
+
* Create a slide-out effect
|
|
115
|
+
* @param obj - Game object to slide out
|
|
116
|
+
* @param config - Effect config (direction, time)
|
|
117
|
+
*/
|
|
118
|
+
export declare const createSlideOutEffect: EffectFn;
|
|
119
|
+
/**
|
|
120
|
+
* Create a zoom-in effect (scale from 0 to 1)
|
|
121
|
+
* @param obj - Game object to zoom in
|
|
122
|
+
* @param config - Effect config (time)
|
|
123
|
+
*/
|
|
124
|
+
export declare const createZoomInEffect: EffectFn;
|
|
125
|
+
/**
|
|
126
|
+
* Create a zoom-out effect (scale from 1 to 0)
|
|
127
|
+
* @param obj - Game object to zoom out
|
|
128
|
+
* @param config - Effect config (time)
|
|
129
|
+
*/
|
|
130
|
+
export declare const createZoomOutEffect: EffectFn;
|
|
131
|
+
/**
|
|
132
|
+
* Create a flip-in effect (3D flip from edge)
|
|
133
|
+
* @param obj - Game object to flip in
|
|
134
|
+
* @param config - Effect config (time)
|
|
135
|
+
*/
|
|
136
|
+
export declare const createFlipInEffect: EffectFn;
|
|
137
|
+
/**
|
|
138
|
+
* Create a flip-out effect (3D flip to edge)
|
|
139
|
+
* @param obj - Game object to flip out
|
|
140
|
+
* @param config - Effect config (time)
|
|
141
|
+
*/
|
|
142
|
+
export declare const createFlipOutEffect: EffectFn;
|
|
143
|
+
/**
|
|
144
|
+
* Create a float effect (gentle up/down motion, for idle items)
|
|
145
|
+
* @param obj - Game object to float
|
|
146
|
+
* @param config - Effect config (magnitude, time)
|
|
147
|
+
*/
|
|
148
|
+
export declare const createFloatEffect: EffectFn;
|
|
149
|
+
/**
|
|
150
|
+
* Create a breathe effect (slow pulsing for idle/important objects)
|
|
151
|
+
* @param obj - Game object to breathe
|
|
152
|
+
* @param config - Effect config (intensity, time)
|
|
153
|
+
*/
|
|
154
|
+
export declare const createBreatheEffect: EffectFn;
|
|
155
|
+
/**
|
|
156
|
+
* Create a spin effect (continuous rotation)
|
|
157
|
+
* @param obj - Game object to spin
|
|
158
|
+
* @param config - Effect config (time for one full rotation)
|
|
159
|
+
*/
|
|
160
|
+
export declare const createSpinEffect: EffectFn;
|
|
161
|
+
/**
|
|
162
|
+
* Hook for applying effects to game objects
|
|
163
|
+
* Handles cleanup of tweens on unmount
|
|
164
|
+
* @param ref - RefObject pointing to a Phaser game object
|
|
165
|
+
* @returns Function to trigger effects
|
|
166
|
+
*/
|
|
167
|
+
export declare function useGameObjectEffect(ref: RefObject<Phaser.GameObjects.Container | null>): {
|
|
168
|
+
applyEffect: (effect: EffectFn, config?: EffectConfig) => void;
|
|
169
|
+
stopEffects: () => void;
|
|
170
|
+
};
|
|
171
|
+
export {};
|
|
172
|
+
//# sourceMappingURL=use-effect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-effect.d.ts","sourceRoot":"","sources":["../../src/effects/use-effect.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,KAAK,SAAS,CAAC,CAAC,IAAI;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAA;AAElC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAA;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB;AA4JD;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;AAExF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAE9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA8B/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA2B/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAqB9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAqBhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAiBjC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAwBhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA0B/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAsBhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA6C/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QA2B/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QA6B9B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAsB/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAsBhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,QA2CjC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAyClC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QA0BhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAsBjC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAwBhC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAqBjC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAkC/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAmCjC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QA6B9B,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC;0BAQxD,QAAQ,WAAU,YAAY;;EAiE5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fx/convenience-hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BlurFXConfig } from '../fx-creators/blur';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for automatic blur FX
|
|
4
|
+
* @param ref - GameObject ref
|
|
5
|
+
* @param config - Blur config (updates reactively)
|
|
6
|
+
* @returns FX controls
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const ref = useRef(null)
|
|
11
|
+
* useBlur(ref, { strength: 8, steps: 4 })
|
|
12
|
+
*
|
|
13
|
+
* return <View ref={ref}>Content</View>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function useBlur(ref: {
|
|
17
|
+
current: any;
|
|
18
|
+
}, config?: BlurFXConfig): {
|
|
19
|
+
clearFX: () => void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=use-blur.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-blur.d.ts","sourceRoot":"","sources":["../../../src/fx/convenience-hooks/use-blur.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGrE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAErB,GAAG,EAAE;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,EACrB,MAAM,GAAE,YAAiB,GACxB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAgBzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GlowFXConfig } from '../fx-creators/glow';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for automatic glow FX
|
|
4
|
+
* @param ref - GameObject ref
|
|
5
|
+
* @param config - Glow config (updates reactively)
|
|
6
|
+
* @returns FX controls
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const ref = useRef(null)
|
|
11
|
+
* useGlow(ref, { color: 0xff6600, outerStrength: 6, innerStrength: 2 })
|
|
12
|
+
*
|
|
13
|
+
* return <View ref={ref}>Content</View>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function useGlow(ref: {
|
|
17
|
+
current: any;
|
|
18
|
+
}, config?: GlowFXConfig): {
|
|
19
|
+
clearFX: () => void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=use-glow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-glow.d.ts","sourceRoot":"","sources":["../../../src/fx/convenience-hooks/use-glow.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAGrE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAErB,GAAG,EAAE;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,EACrB,MAAM,GAAE,YAAiB,GACxB;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAgBzB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ShadowFXConfig } from '../fx-creators/shadow';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for automatic shadow FX
|
|
4
|
+
* @param ref - GameObject ref
|
|
5
|
+
* @param config - Shadow config (updates reactively)
|
|
6
|
+
* @returns FX controls
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const ref = useRef(null)
|
|
11
|
+
* useShadow(ref, { x: 4, y: 4, decay: 0.1 })
|
|
12
|
+
*
|
|
13
|
+
* return <View ref={ref}>Content</View>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function useShadow(ref: {
|
|
17
|
+
current: any;
|
|
18
|
+
}, config?: ShadowFXConfig): {
|
|
19
|
+
clearFX: () => void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=use-shadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-shadow.d.ts","sourceRoot":"","sources":["../../../src/fx/convenience-hooks/use-shadow.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAG3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAEvB,GAAG,EAAE;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,EACrB,MAAM,GAAE,cAAmB,GAC1B;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAgBzB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FXConfig, FXCreatorFn } from '../use-fx';
|
|
2
|
+
/**
|
|
3
|
+
* Blur FX configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface BlurFXConfig extends FXConfig {
|
|
6
|
+
/** The quality of the blur effect. Can be either 0 for Low Quality, 1 for Medium Quality or 2 for High Quality */
|
|
7
|
+
quality?: number;
|
|
8
|
+
/** The horizontal offset of the blur effect */
|
|
9
|
+
x?: number;
|
|
10
|
+
/** The vertical offset of the blur effect */
|
|
11
|
+
y?: number;
|
|
12
|
+
/** The strength of the blur effect */
|
|
13
|
+
strength?: number;
|
|
14
|
+
/** The color of the blur, as a hex value */
|
|
15
|
+
color?: number;
|
|
16
|
+
/** The number of steps to run the blur effect for. This value should always be an integer */
|
|
17
|
+
steps?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create blur FX
|
|
21
|
+
* @param obj - GameObject
|
|
22
|
+
* @param config - Blur configuration
|
|
23
|
+
* @param type - 'post' or 'pre' FX
|
|
24
|
+
* @returns Blur controller
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* applyFX(createBlurFX, {
|
|
29
|
+
* quality: 1,
|
|
30
|
+
* x: 4,
|
|
31
|
+
* y: 4,
|
|
32
|
+
* strength: 2
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const createBlurFX: FXCreatorFn<BlurFXConfig>;
|
|
37
|
+
//# sourceMappingURL=blur.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/fx/fx-creators/blur.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEtD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,kHAAkH;IAClH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,6CAA6C;IAC7C,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,YAAY,CAalD,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FXConfig, FXCreatorFn } from '../use-fx';
|
|
2
|
+
/**
|
|
3
|
+
* Color Matrix effect types
|
|
4
|
+
*/
|
|
5
|
+
export type ColorMatrixEffect = 'grayscale' | 'sepia' | 'negative' | 'blackWhite' | 'brown' | 'kodachrome' | 'technicolor' | 'polaroid';
|
|
6
|
+
/**
|
|
7
|
+
* Color Matrix FX configuration
|
|
8
|
+
*/
|
|
9
|
+
export interface ColorMatrixFXConfig extends FXConfig {
|
|
10
|
+
/** Effect type */
|
|
11
|
+
effect?: ColorMatrixEffect;
|
|
12
|
+
/** Effect amount (0-1, for effects that support it like grayscale) */
|
|
13
|
+
amount?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create color matrix FX
|
|
17
|
+
* @param obj - GameObject
|
|
18
|
+
* @param config - Color matrix configuration
|
|
19
|
+
* @param type - 'post' or 'pre' FX
|
|
20
|
+
* @returns Color matrix controller
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* applyFX(createColorMatrixFX, {
|
|
25
|
+
* effect: 'grayscale',
|
|
26
|
+
* amount: 1
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const createColorMatrixFX: FXCreatorFn<ColorMatrixFXConfig>;
|
|
31
|
+
//# sourceMappingURL=color-matrix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-matrix.d.ts","sourceRoot":"","sources":["../../../src/fx/fx-creators/color-matrix.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,OAAO,GACP,UAAU,GACV,YAAY,GACZ,OAAO,GACP,YAAY,GACZ,aAAa,GACb,UAAU,CAAA;AAEd;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,QAAQ;IACnD,kBAAkB;IAClB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,mBAAmB,CA4ChE,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FXConfig, FXCreatorFn } from '../use-fx';
|
|
2
|
+
/**
|
|
3
|
+
* Glow FX configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface GlowFXConfig extends FXConfig {
|
|
6
|
+
/** Glow color (hex number) */
|
|
7
|
+
color?: number;
|
|
8
|
+
/** The strength of the glow outward from the edge */
|
|
9
|
+
outerStrength?: number;
|
|
10
|
+
/** The strength of the glow inward from the edge */
|
|
11
|
+
innerStrength?: number;
|
|
12
|
+
/** If true, only the glow is drawn, not the texture itself */
|
|
13
|
+
knockout?: boolean;
|
|
14
|
+
/** Sets the quality of this Glow effect (PostFX only, cannot be changed post-creation) */
|
|
15
|
+
quality?: number;
|
|
16
|
+
/** Sets the distance of this Glow effect (PostFX only, cannot be changed post-creation) */
|
|
17
|
+
distance?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create glow FX
|
|
21
|
+
* @param obj - GameObject
|
|
22
|
+
* @param config - Glow configuration
|
|
23
|
+
* @param type - 'post' or 'pre' FX
|
|
24
|
+
* @returns Glow controller
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* applyFX(createGlowFX, {
|
|
29
|
+
* color: 0xff6600,
|
|
30
|
+
* outerStrength: 6,
|
|
31
|
+
* innerStrength: 2
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const createGlowFX: FXCreatorFn<GlowFXConfig>;
|
|
36
|
+
//# sourceMappingURL=glow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glow.d.ts","sourceRoot":"","sources":["../../../src/fx/fx-creators/glow.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEtD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,YAAY,CAoBlD,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FX Creators - Individual effect creator functions
|
|
3
|
+
*/
|
|
4
|
+
export { createBlurFX, type BlurFXConfig } from './blur';
|
|
5
|
+
export { createColorMatrixFX, type ColorMatrixEffect, type ColorMatrixFXConfig, } from './color-matrix';
|
|
6
|
+
export { createGlowFX, type GlowFXConfig } from './glow';
|
|
7
|
+
export { createPixelateFX, type PixelateFXConfig } from './pixelate';
|
|
8
|
+
export { createShadowFX, type ShadowFXConfig } from './shadow';
|
|
9
|
+
export { createVignetteFX, type VignetteFXConfig } from './vignette';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fx/fx-creators/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FXConfig, FXCreatorFn } from '../use-fx';
|
|
2
|
+
/**
|
|
3
|
+
* Pixelate FX configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface PixelateFXConfig extends FXConfig {
|
|
6
|
+
/** The amount of pixelation to apply */
|
|
7
|
+
amount?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Create pixelate FX
|
|
11
|
+
* @param obj - GameObject
|
|
12
|
+
* @param config - Pixelate configuration
|
|
13
|
+
* @param type - 'post' or 'pre' FX
|
|
14
|
+
* @returns Pixelate controller
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* applyFX(createPixelateFX, {
|
|
19
|
+
* amount: 8
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const createPixelateFX: FXCreatorFn<PixelateFXConfig>;
|
|
24
|
+
//# sourceMappingURL=pixelate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixelate.d.ts","sourceRoot":"","sources":["../../../src/fx/fx-creators/pixelate.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEtD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,CAa1D,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FXConfig, FXCreatorFn } from '../use-fx';
|
|
2
|
+
/**
|
|
3
|
+
* Shadow FX configuration
|
|
4
|
+
* Maps to Phaser's addShadow(x, y, decay, power, color, samples, intensity)
|
|
5
|
+
*/
|
|
6
|
+
export interface ShadowFXConfig extends FXConfig {
|
|
7
|
+
/** Horizontal offset of the shadow effect (default: 0) */
|
|
8
|
+
x?: number;
|
|
9
|
+
/** Vertical offset of the shadow effect (default: 0) */
|
|
10
|
+
y?: number;
|
|
11
|
+
/** Amount of decay for shadow effect (default: 0.1) */
|
|
12
|
+
decay?: number;
|
|
13
|
+
/** Power of the shadow effect (default: 1) */
|
|
14
|
+
power?: number;
|
|
15
|
+
/** Color of the shadow (default: 0x000000) */
|
|
16
|
+
color?: number;
|
|
17
|
+
/** Number of samples (1-12, higher = better quality, default: 6) */
|
|
18
|
+
samples?: number;
|
|
19
|
+
/** Intensity of the shadow effect (default: 1) */
|
|
20
|
+
intensity?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create shadow FX
|
|
24
|
+
* @param obj - GameObject
|
|
25
|
+
* @param config - Shadow configuration
|
|
26
|
+
* @param type - 'post' or 'pre' FX
|
|
27
|
+
* @returns Shadow controller
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* applyFX(createShadowFX, {
|
|
32
|
+
* x: 0,
|
|
33
|
+
* y: 0,
|
|
34
|
+
* decay: 0.1,
|
|
35
|
+
* power: 1,
|
|
36
|
+
* color: 0x000000,
|
|
37
|
+
* samples: 6,
|
|
38
|
+
* intensity: 1
|
|
39
|
+
* })
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare const createShadowFX: FXCreatorFn<ShadowFXConfig>;
|
|
43
|
+
//# sourceMappingURL=shadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/fx/fx-creators/shadow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEtD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,0DAA0D;IAC1D,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,wDAAwD;IACxD,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,cAAc,CAqBtD,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FXConfig, FXCreatorFn } from '../use-fx';
|
|
2
|
+
/**
|
|
3
|
+
* Vignette FX configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface VignetteFXConfig extends FXConfig {
|
|
6
|
+
/** The horizontal offset of the vignette effect. This value is normalized to the range 0 to 1 */
|
|
7
|
+
x?: number;
|
|
8
|
+
/** The vertical offset of the vignette effect. This value is normalized to the range 0 to 1 */
|
|
9
|
+
y?: number;
|
|
10
|
+
/** The radius of the vignette effect. This value is normalized to the range 0 to 1 */
|
|
11
|
+
radius?: number;
|
|
12
|
+
/** The strength of the vignette effect */
|
|
13
|
+
strength?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create vignette FX
|
|
17
|
+
* @param obj - GameObject
|
|
18
|
+
* @param config - Vignette configuration
|
|
19
|
+
* @param type - 'post' or 'pre' FX
|
|
20
|
+
* @returns Vignette controller
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* applyFX(createVignetteFX, {
|
|
25
|
+
* x: 0.5,
|
|
26
|
+
* y: 0.5,
|
|
27
|
+
* radius: 0.5,
|
|
28
|
+
* strength: 0.7
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const createVignetteFX: FXCreatorFn<VignetteFXConfig>;
|
|
33
|
+
//# sourceMappingURL=vignette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vignette.d.ts","sourceRoot":"","sources":["../../../src/fx/fx-creators/vignette.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEtD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,iGAAiG;IACjG,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,+FAA+F;IAC/F,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,CAa1D,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BlurFXConfig, ColorMatrixFXConfig, GlowFXConfig, PixelateFXConfig, ShadowFXConfig, VignetteFXConfig } from './fx-creators';
|
|
2
|
+
import { FXConfig, FXCreatorFn } from './use-fx';
|
|
3
|
+
/**
|
|
4
|
+
* Built-in FX names
|
|
5
|
+
*/
|
|
6
|
+
export type BuiltInFXName = 'shadow' | 'glow' | 'blur' | 'pixelate' | 'vignette' | 'grayscale' | 'sepia' | 'negative' | 'blackWhite' | 'brown' | 'kodachrome' | 'technicolor' | 'polaroid';
|
|
7
|
+
/**
|
|
8
|
+
* Extension point for custom FX (declaration merging)
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* declare module '@number10/phaserjsx/fx' {
|
|
12
|
+
* interface FXNameExtensions {
|
|
13
|
+
* myCustomFX: 'myCustomFX'
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface FXNameExtensions {
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* All available FX names (built-in + extensions)
|
|
22
|
+
*/
|
|
23
|
+
export type FXName = BuiltInFXName | (keyof FXNameExtensions extends never ? never : keyof FXNameExtensions);
|
|
24
|
+
/**
|
|
25
|
+
* FX definition with name and config
|
|
26
|
+
*/
|
|
27
|
+
export interface FXDefinition {
|
|
28
|
+
name: FXName;
|
|
29
|
+
config?: FXConfig;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* FX Registry mapping names to creator functions
|
|
33
|
+
*/
|
|
34
|
+
export declare const FX_REGISTRY: Record<BuiltInFXName, FXCreatorFn>;
|
|
35
|
+
/**
|
|
36
|
+
* Default FX (none)
|
|
37
|
+
*/
|
|
38
|
+
export declare const DEFAULT_FX: FXName;
|
|
39
|
+
/**
|
|
40
|
+
* Resolve FX by name or function
|
|
41
|
+
* @param fxOrName - FX name string or creator function
|
|
42
|
+
* @returns FX creator function or null
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveFX(fxOrName: FXName | FXCreatorFn): FXCreatorFn | null;
|
|
45
|
+
/**
|
|
46
|
+
* Apply FX by name (helper function)
|
|
47
|
+
* @param applyFXFn - applyFX function from useFX hook
|
|
48
|
+
* @param fxName - FX name
|
|
49
|
+
* @param config - FX config
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* const { applyFX } = useFX(ref)
|
|
54
|
+
* applyFXByName(applyFX, 'shadow', { offsetX: 4, offsetY: 4, blur: 8 })
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function applyFXByName(applyFXFn: ReturnType<typeof import('./use-fx').useFX>['applyFX'], fxName: FXName, config?: FXConfig): void;
|
|
58
|
+
export type { BlurFXConfig, ColorMatrixFXConfig, GlowFXConfig, PixelateFXConfig, ShadowFXConfig, VignetteFXConfig, };
|
|
59
|
+
//# sourceMappingURL=fx-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fx-registry.d.ts","sourceRoot":"","sources":["../../src/fx/fx-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,YAAY,GACZ,OAAO,GACP,YAAY,GACZ,aAAa,GACb,UAAU,CAAA;AAEd;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,gBAAgB;CAAG;AAEpC;;GAEG;AACH,MAAM,MAAM,MAAM,GACd,aAAa,GACb,CAAC,MAAM,gBAAgB,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,gBAAgB,CAAC,CAAA;AAE3E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,QAAQ,CAAA;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,aAAa,EAAE,WAAW,CAoB1D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,MAAoB,CAAA;AAE7C;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,IAAI,CAK5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,UAAU,CAAC,cAAc,UAAU,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,EACjE,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,QAAa,QAQtB;AAGD,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FX System for PhaserJSX
|
|
3
|
+
* GPU-accelerated Phaser PostFX/PreFX pipeline effects
|
|
4
|
+
*
|
|
5
|
+
* @example Basic usage:
|
|
6
|
+
* ```tsx
|
|
7
|
+
* import { useFX, createShadowFX } from '@number10/phaserjsx/fx'
|
|
8
|
+
*
|
|
9
|
+
* function MyComponent() {
|
|
10
|
+
* const ref = useRef(null)
|
|
11
|
+
* const { applyFX } = useFX(ref)
|
|
12
|
+
*
|
|
13
|
+
* const handleHover = () => {
|
|
14
|
+
* applyFX(createShadowFX, { offsetX: 4, offsetY: 4, blur: 8 })
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* return <Image ref={ref} onHoverStart={handleHover} />
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example Convenience hooks:
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { useShadow } from '@number10/phaserjsx/fx'
|
|
24
|
+
*
|
|
25
|
+
* function MyComponent() {
|
|
26
|
+
* const ref = useRef(null)
|
|
27
|
+
* useShadow(ref, { offsetX: 4, offsetY: 4, blur: 8 })
|
|
28
|
+
*
|
|
29
|
+
* return <View ref={ref}>Content</View>
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example Registry-based FX:
|
|
34
|
+
* ```tsx
|
|
35
|
+
* import { useFX, applyFXByName } from '@number10/phaserjsx/fx'
|
|
36
|
+
*
|
|
37
|
+
* function MyComponent() {
|
|
38
|
+
* const ref = useRef(null)
|
|
39
|
+
* const { applyFX } = useFX(ref)
|
|
40
|
+
*
|
|
41
|
+
* const handleClick = () => {
|
|
42
|
+
* applyFXByName(applyFX, 'glow', { color: 0xff6600, distance: 10 })
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export { useFX, type FXCapableGameObject, type FXConfig, type FXCreatorFn, type FXType, } from './use-fx';
|
|
48
|
+
export { DEFAULT_FX, FX_REGISTRY, applyFXByName, resolveFX, type BuiltInFXName, type FXDefinition, type FXName, type FXNameExtensions, } from './fx-registry';
|
|
49
|
+
export { createBlurFX, createColorMatrixFX, createGlowFX, createPixelateFX, createShadowFX, createVignetteFX, type BlurFXConfig, type ColorMatrixEffect, type ColorMatrixFXConfig, type GlowFXConfig, type PixelateFXConfig, type ShadowFXConfig, type VignetteFXConfig, } from './fx-creators';
|
|
50
|
+
export { useBlur, useGlow, useShadow } from './convenience-hooks';
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EACL,KAAK,EACL,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,MAAM,GACZ,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,UAAU,EACV,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAA;AAGtB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA"}
|