safex-webgl 1.0.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/.prettierrc +6 -0
- package/@types/index.d.ts +36 -0
- package/README.md +152 -0
- package/bun.lock +353 -0
- package/dist/actions/Action.d.ts +27 -0
- package/dist/actions/Action.d.ts.map +1 -0
- package/dist/actions/Action.js +62 -0
- package/dist/actions/Action.js.map +1 -0
- package/dist/actions/ActionBezier.d.ts +121 -0
- package/dist/actions/ActionBezier.d.ts.map +1 -0
- package/dist/actions/ActionBezier.js +221 -0
- package/dist/actions/ActionBezier.js.map +1 -0
- package/dist/actions/ActionBlink.d.ts +62 -0
- package/dist/actions/ActionBlink.d.ts.map +1 -0
- package/dist/actions/ActionBlink.js +96 -0
- package/dist/actions/ActionBlink.js.map +1 -0
- package/dist/actions/ActionCatmullRom.d.ts +242 -0
- package/dist/actions/ActionCatmullRom.d.ts.map +1 -0
- package/dist/actions/ActionCatmullRom.js +436 -0
- package/dist/actions/ActionCatmullRom.js.map +1 -0
- package/dist/actions/ActionFade.d.ts +126 -0
- package/dist/actions/ActionFade.d.ts.map +1 -0
- package/dist/actions/ActionFade.js +190 -0
- package/dist/actions/ActionFade.js.map +1 -0
- package/dist/actions/ActionInstant.d.ts +237 -0
- package/dist/actions/ActionInstant.d.ts.map +1 -0
- package/dist/actions/ActionInstant.js +386 -0
- package/dist/actions/ActionInstant.js.map +1 -0
- package/dist/actions/ActionInterval.d.ts +132 -0
- package/dist/actions/ActionInterval.d.ts.map +1 -0
- package/dist/actions/ActionInterval.js +254 -0
- package/dist/actions/ActionInterval.js.map +1 -0
- package/dist/actions/ActionJump.d.ts +146 -0
- package/dist/actions/ActionJump.d.ts.map +1 -0
- package/dist/actions/ActionJump.js +239 -0
- package/dist/actions/ActionJump.js.map +1 -0
- package/dist/actions/ActionMove.d.ts +73 -0
- package/dist/actions/ActionMove.d.ts.map +1 -0
- package/dist/actions/ActionMove.js +164 -0
- package/dist/actions/ActionMove.js.map +1 -0
- package/dist/actions/ActionRotate.d.ts +137 -0
- package/dist/actions/ActionRotate.d.ts.map +1 -0
- package/dist/actions/ActionRotate.js +214 -0
- package/dist/actions/ActionRotate.js.map +1 -0
- package/dist/actions/ActionScale.d.ts +110 -0
- package/dist/actions/ActionScale.d.ts.map +1 -0
- package/dist/actions/ActionScale.js +157 -0
- package/dist/actions/ActionScale.js.map +1 -0
- package/dist/actions/ActionSkew.d.ts +120 -0
- package/dist/actions/ActionSkew.d.ts.map +1 -0
- package/dist/actions/ActionSkew.js +185 -0
- package/dist/actions/ActionSkew.js.map +1 -0
- package/dist/actions/ActionTint.d.ts +132 -0
- package/dist/actions/ActionTint.d.ts.map +1 -0
- package/dist/actions/ActionTint.js +193 -0
- package/dist/actions/ActionTint.js.map +1 -0
- package/dist/actions/Animate.d.ts +77 -0
- package/dist/actions/Animate.d.ts.map +1 -0
- package/dist/actions/Animate.js +177 -0
- package/dist/actions/Animate.js.map +1 -0
- package/dist/actions/DelayTime.d.ts +95 -0
- package/dist/actions/DelayTime.d.ts.map +1 -0
- package/dist/actions/DelayTime.js +145 -0
- package/dist/actions/DelayTime.js.map +1 -0
- package/dist/actions/FiniteTimeAction.d.ts +11 -0
- package/dist/actions/FiniteTimeAction.d.ts.map +1 -0
- package/dist/actions/FiniteTimeAction.js +24 -0
- package/dist/actions/FiniteTimeAction.js.map +1 -0
- package/dist/actions/Follow.d.ts +23 -0
- package/dist/actions/Follow.d.ts.map +1 -0
- package/dist/actions/Follow.js +98 -0
- package/dist/actions/Follow.js.map +1 -0
- package/dist/actions/Repeat.d.ts +151 -0
- package/dist/actions/Repeat.d.ts.map +1 -0
- package/dist/actions/Repeat.js +276 -0
- package/dist/actions/Repeat.js.map +1 -0
- package/dist/actions/Sequence.d.ts +77 -0
- package/dist/actions/Sequence.d.ts.map +1 -0
- package/dist/actions/Sequence.js +190 -0
- package/dist/actions/Sequence.js.map +1 -0
- package/dist/actions/Spawn.d.ts +63 -0
- package/dist/actions/Spawn.d.ts.map +1 -0
- package/dist/actions/Spawn.js +146 -0
- package/dist/actions/Spawn.js.map +1 -0
- package/dist/actions/Speed.d.ts +19 -0
- package/dist/actions/Speed.d.ts.map +1 -0
- package/dist/actions/Speed.js +57 -0
- package/dist/actions/Speed.js.map +1 -0
- package/dist/actions/TargetedAction.d.ts +67 -0
- package/dist/actions/TargetedAction.d.ts.map +1 -0
- package/dist/actions/TargetedAction.js +99 -0
- package/dist/actions/TargetedAction.js.map +1 -0
- package/dist/actions/easing/ActionEase.d.ts +133 -0
- package/dist/actions/easing/ActionEase.d.ts.map +1 -0
- package/dist/actions/easing/ActionEase.js +184 -0
- package/dist/actions/easing/ActionEase.js.map +1 -0
- package/dist/actions/easing/Back.d.ts +174 -0
- package/dist/actions/easing/Back.d.ts.map +1 -0
- package/dist/actions/easing/Back.js +227 -0
- package/dist/actions/easing/Back.js.map +1 -0
- package/dist/actions/easing/Bezier.d.ts +94 -0
- package/dist/actions/easing/Bezier.d.ts.map +1 -0
- package/dist/actions/easing/Bezier.js +124 -0
- package/dist/actions/easing/Bezier.js.map +1 -0
- package/dist/actions/easing/Bounce.d.ts +203 -0
- package/dist/actions/easing/Bounce.d.ts.map +1 -0
- package/dist/actions/easing/Bounce.js +288 -0
- package/dist/actions/easing/Bounce.js.map +1 -0
- package/dist/actions/easing/Circle.d.ts +177 -0
- package/dist/actions/easing/Circle.d.ts.map +1 -0
- package/dist/actions/easing/Circle.js +220 -0
- package/dist/actions/easing/Circle.js.map +1 -0
- package/dist/actions/easing/Cubic.d.ts +165 -0
- package/dist/actions/easing/Cubic.d.ts.map +1 -0
- package/dist/actions/easing/Cubic.js +209 -0
- package/dist/actions/easing/Cubic.js.map +1 -0
- package/dist/actions/easing/Elastic.d.ts +269 -0
- package/dist/actions/easing/Elastic.d.ts.map +1 -0
- package/dist/actions/easing/Elastic.js +358 -0
- package/dist/actions/easing/Elastic.js.map +1 -0
- package/dist/actions/easing/Exponential.d.ts +181 -0
- package/dist/actions/easing/Exponential.d.ts.map +1 -0
- package/dist/actions/easing/Exponential.js +214 -0
- package/dist/actions/easing/Exponential.js.map +1 -0
- package/dist/actions/easing/InOut.d.ts +191 -0
- package/dist/actions/easing/InOut.d.ts.map +1 -0
- package/dist/actions/easing/InOut.js +254 -0
- package/dist/actions/easing/InOut.js.map +1 -0
- package/dist/actions/easing/Quartic.d.ts +232 -0
- package/dist/actions/easing/Quartic.d.ts.map +1 -0
- package/dist/actions/easing/Quartic.js +313 -0
- package/dist/actions/easing/Quartic.js.map +1 -0
- package/dist/actions/easing/Quintic.d.ts +168 -0
- package/dist/actions/easing/Quintic.d.ts.map +1 -0
- package/dist/actions/easing/Quintic.js +212 -0
- package/dist/actions/easing/Quintic.js.map +1 -0
- package/dist/actions/easing/Sine.d.ts +176 -0
- package/dist/actions/easing/Sine.d.ts.map +1 -0
- package/dist/actions/easing/Sine.js +206 -0
- package/dist/actions/easing/Sine.js.map +1 -0
- package/dist/actions/index.d.ts +16 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +16 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/audio/Audio.d.ts +47 -0
- package/dist/audio/Audio.d.ts.map +1 -0
- package/dist/audio/Audio.js +255 -0
- package/dist/audio/Audio.js.map +1 -0
- package/dist/audio/engine.d.ts +171 -0
- package/dist/audio/engine.d.ts.map +1 -0
- package/dist/audio/engine.js +556 -0
- package/dist/audio/engine.js.map +1 -0
- package/dist/audio/index.d.ts +3 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +3 -0
- package/dist/audio/index.js.map +1 -0
- package/dist/boot.d.ts +80 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +468 -0
- package/dist/boot.js.map +1 -0
- package/dist/clipping-nodes/ClippingNode.d.ts +114 -0
- package/dist/clipping-nodes/ClippingNode.d.ts.map +1 -0
- package/dist/clipping-nodes/ClippingNode.js +177 -0
- package/dist/clipping-nodes/ClippingNode.js.map +1 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.d.ts +25 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.js +157 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.js.map +1 -0
- package/dist/core/ActionManager.d.ts +56 -0
- package/dist/core/ActionManager.d.ts.map +1 -0
- package/dist/core/ActionManager.js +253 -0
- package/dist/core/ActionManager.js.map +1 -0
- package/dist/core/Configuration.d.ts +108 -0
- package/dist/core/Configuration.d.ts.map +1 -0
- package/dist/core/Configuration.js +232 -0
- package/dist/core/Configuration.js.map +1 -0
- package/dist/core/Director.d.ts +130 -0
- package/dist/core/Director.d.ts.map +1 -0
- package/dist/core/Director.js +580 -0
- package/dist/core/Director.js.map +1 -0
- package/dist/core/DrawingPrimitivesWebGL.d.ts +32 -0
- package/dist/core/DrawingPrimitivesWebGL.d.ts.map +1 -0
- package/dist/core/DrawingPrimitivesWebGL.js +273 -0
- package/dist/core/DrawingPrimitivesWebGL.js.map +1 -0
- package/dist/core/Scheduler.d.ts +110 -0
- package/dist/core/Scheduler.d.ts.map +1 -0
- package/dist/core/Scheduler.js +687 -0
- package/dist/core/Scheduler.js.map +1 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.d.ts +2 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.d.ts.map +1 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.js +37 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.js.map +1 -0
- package/dist/core/base-nodes/CustomRenderCmd.d.ts +9 -0
- package/dist/core/base-nodes/CustomRenderCmd.d.ts.map +1 -0
- package/dist/core/base-nodes/CustomRenderCmd.js +16 -0
- package/dist/core/base-nodes/CustomRenderCmd.js.map +1 -0
- package/dist/core/base-nodes/Node.d.ts +285 -0
- package/dist/core/base-nodes/Node.d.ts.map +1 -0
- package/dist/core/base-nodes/Node.js +1112 -0
- package/dist/core/base-nodes/Node.js.map +1 -0
- package/dist/core/base-nodes/NodeRenderCmd.d.ts +65 -0
- package/dist/core/base-nodes/NodeRenderCmd.d.ts.map +1 -0
- package/dist/core/base-nodes/NodeRenderCmd.js +460 -0
- package/dist/core/base-nodes/NodeRenderCmd.js.map +1 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.d.ts +17 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.js +29 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.js.map +1 -0
- package/dist/core/cocoa/AffineTransform.d.ts +201 -0
- package/dist/core/cocoa/AffineTransform.d.ts.map +1 -0
- package/dist/core/cocoa/AffineTransform.js +260 -0
- package/dist/core/cocoa/AffineTransform.js.map +1 -0
- package/dist/core/cocoa/Geometry.d.ts +176 -0
- package/dist/core/cocoa/Geometry.d.ts.map +1 -0
- package/dist/core/cocoa/Geometry.js +237 -0
- package/dist/core/cocoa/Geometry.js.map +1 -0
- package/dist/core/event-manager/Event.d.ts +57 -0
- package/dist/core/event-manager/Event.d.ts.map +1 -0
- package/dist/core/event-manager/Event.js +69 -0
- package/dist/core/event-manager/Event.js.map +1 -0
- package/dist/core/event-manager/EventCustom.d.ts +22 -0
- package/dist/core/event-manager/EventCustom.d.ts.map +1 -0
- package/dist/core/event-manager/EventCustom.js +31 -0
- package/dist/core/event-manager/EventCustom.js.map +1 -0
- package/dist/core/event-manager/EventExtension.d.ts +33 -0
- package/dist/core/event-manager/EventExtension.d.ts.map +1 -0
- package/dist/core/event-manager/EventExtension.js +80 -0
- package/dist/core/event-manager/EventExtension.js.map +1 -0
- package/dist/core/event-manager/EventFocus.d.ts +17 -0
- package/dist/core/event-manager/EventFocus.d.ts.map +1 -0
- package/dist/core/event-manager/EventFocus.js +21 -0
- package/dist/core/event-manager/EventFocus.js.map +1 -0
- package/dist/core/event-manager/EventHelper.d.ts +8 -0
- package/dist/core/event-manager/EventHelper.d.ts.map +1 -0
- package/dist/core/event-manager/EventHelper.js +92 -0
- package/dist/core/event-manager/EventHelper.js.map +1 -0
- package/dist/core/event-manager/EventListener.d.ts +53 -0
- package/dist/core/event-manager/EventListener.d.ts.map +1 -0
- package/dist/core/event-manager/EventListener.js +95 -0
- package/dist/core/event-manager/EventListener.js.map +1 -0
- package/dist/core/event-manager/EventListenerCustom.d.ts +11 -0
- package/dist/core/event-manager/EventListenerCustom.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerCustom.js +37 -0
- package/dist/core/event-manager/EventListenerCustom.js.map +1 -0
- package/dist/core/event-manager/EventListenerFocus.d.ts +10 -0
- package/dist/core/event-manager/EventListenerFocus.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerFocus.js +28 -0
- package/dist/core/event-manager/EventListenerFocus.js.map +1 -0
- package/dist/core/event-manager/EventListenerMouse.d.ts +13 -0
- package/dist/core/event-manager/EventListenerMouse.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerMouse.js +49 -0
- package/dist/core/event-manager/EventListenerMouse.js.map +1 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.d.ts +12 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.js +28 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.js.map +1 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.d.ts +16 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.js +38 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.js.map +1 -0
- package/dist/core/event-manager/EventListenerVector.d.ts +15 -0
- package/dist/core/event-manager/EventListenerVector.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerVector.js +38 -0
- package/dist/core/event-manager/EventListenerVector.js.map +1 -0
- package/dist/core/event-manager/EventManager.d.ts +140 -0
- package/dist/core/event-manager/EventManager.d.ts.map +1 -0
- package/dist/core/event-manager/EventManager.js +907 -0
- package/dist/core/event-manager/EventManager.js.map +1 -0
- package/dist/core/event-manager/EventMouse.d.ts +173 -0
- package/dist/core/event-manager/EventMouse.d.ts.map +1 -0
- package/dist/core/event-manager/EventMouse.js +200 -0
- package/dist/core/event-manager/EventMouse.js.map +1 -0
- package/dist/core/event-manager/EventTouch.d.ts +24 -0
- package/dist/core/event-manager/EventTouch.d.ts.map +1 -0
- package/dist/core/event-manager/EventTouch.js +33 -0
- package/dist/core/event-manager/EventTouch.js.map +1 -0
- package/dist/core/event-manager/Touch.d.ts +60 -0
- package/dist/core/event-manager/Touch.d.ts.map +1 -0
- package/dist/core/event-manager/Touch.js +94 -0
- package/dist/core/event-manager/Touch.js.map +1 -0
- package/dist/core/event-manager/index.d.ts +6 -0
- package/dist/core/event-manager/index.d.ts.map +1 -0
- package/dist/core/event-manager/index.js +6 -0
- package/dist/core/event-manager/index.js.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/kazmath/gl/mat4stack.d.ts +5 -0
- package/dist/core/kazmath/gl/mat4stack.d.ts.map +1 -0
- package/dist/core/kazmath/gl/mat4stack.js +53 -0
- package/dist/core/kazmath/gl/mat4stack.js.map +1 -0
- package/dist/core/kazmath/gl/matrix.d.ts +21 -0
- package/dist/core/kazmath/gl/matrix.d.ts.map +1 -0
- package/dist/core/kazmath/gl/matrix.js +121 -0
- package/dist/core/kazmath/gl/matrix.js.map +1 -0
- package/dist/core/kazmath/index.d.ts +7 -0
- package/dist/core/kazmath/index.d.ts.map +1 -0
- package/dist/core/kazmath/index.js +7 -0
- package/dist/core/kazmath/index.js.map +1 -0
- package/dist/core/kazmath/mat3.d.ts +45 -0
- package/dist/core/kazmath/mat3.d.ts.map +1 -0
- package/dist/core/kazmath/mat3.js +297 -0
- package/dist/core/kazmath/mat3.js.map +1 -0
- package/dist/core/kazmath/mat4.d.ts +175 -0
- package/dist/core/kazmath/mat4.d.ts.map +1 -0
- package/dist/core/kazmath/mat4.func.d.ts +44 -0
- package/dist/core/kazmath/mat4.func.d.ts.map +1 -0
- package/dist/core/kazmath/mat4.func.js +210 -0
- package/dist/core/kazmath/mat4.func.js.map +1 -0
- package/dist/core/kazmath/mat4.js +671 -0
- package/dist/core/kazmath/mat4.js.map +1 -0
- package/dist/core/kazmath/plane.d.ts +24 -0
- package/dist/core/kazmath/plane.d.ts.map +1 -0
- package/dist/core/kazmath/plane.js +96 -0
- package/dist/core/kazmath/plane.js.map +1 -0
- package/dist/core/kazmath/quaternion.d.ts +135 -0
- package/dist/core/kazmath/quaternion.d.ts.map +1 -0
- package/dist/core/kazmath/quaternion.js +407 -0
- package/dist/core/kazmath/quaternion.js.map +1 -0
- package/dist/core/kazmath/utility.d.ts +8 -0
- package/dist/core/kazmath/utility.d.ts.map +1 -0
- package/dist/core/kazmath/utility.js +14 -0
- package/dist/core/kazmath/utility.js.map +1 -0
- package/dist/core/kazmath/vec3.d.ts +26 -0
- package/dist/core/kazmath/vec3.d.ts.map +1 -0
- package/dist/core/kazmath/vec3.js +170 -0
- package/dist/core/kazmath/vec3.js.map +1 -0
- package/dist/core/kazmath/vec4.d.ts +22 -0
- package/dist/core/kazmath/vec4.d.ts.map +1 -0
- package/dist/core/kazmath/vec4.js +136 -0
- package/dist/core/kazmath/vec4.js.map +1 -0
- package/dist/core/labelttf/LabelTTF.d.ts +310 -0
- package/dist/core/labelttf/LabelTTF.d.ts.map +1 -0
- package/dist/core/labelttf/LabelTTF.js +818 -0
- package/dist/core/labelttf/LabelTTF.js.map +1 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.d.ts +2 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.d.ts.map +1 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.js +27 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.js.map +1 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.d.ts +37 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.js +367 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.js.map +1 -0
- package/dist/core/layers/Layer.d.ts +35 -0
- package/dist/core/layers/Layer.d.ts.map +1 -0
- package/dist/core/layers/Layer.js +93 -0
- package/dist/core/layers/Layer.js.map +1 -0
- package/dist/core/layers/LayerColor.d.ts +61 -0
- package/dist/core/layers/LayerColor.d.ts.map +1 -0
- package/dist/core/layers/LayerColor.js +144 -0
- package/dist/core/layers/LayerColor.js.map +1 -0
- package/dist/core/layers/LayerGradient.d.ts +196 -0
- package/dist/core/layers/LayerGradient.d.ts.map +1 -0
- package/dist/core/layers/LayerGradient.js +482 -0
- package/dist/core/layers/LayerGradient.js.map +1 -0
- package/dist/core/layers/LayerMultiplex.d.ts +47 -0
- package/dist/core/layers/LayerMultiplex.d.ts.map +1 -0
- package/dist/core/layers/LayerMultiplex.js +87 -0
- package/dist/core/layers/LayerMultiplex.js.map +1 -0
- package/dist/core/layers/LayerWebGLRenderCmd.d.ts +26 -0
- package/dist/core/layers/LayerWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/layers/LayerWebGLRenderCmd.js +100 -0
- package/dist/core/layers/LayerWebGLRenderCmd.js.map +1 -0
- package/dist/core/layers/index.d.ts +5 -0
- package/dist/core/layers/index.d.ts.map +1 -0
- package/dist/core/layers/index.js +5 -0
- package/dist/core/layers/index.js.map +1 -0
- package/dist/core/platform/BlendFunc.d.ts +30 -0
- package/dist/core/platform/BlendFunc.d.ts.map +1 -0
- package/dist/core/platform/BlendFunc.js +50 -0
- package/dist/core/platform/BlendFunc.js.map +1 -0
- package/dist/core/platform/Color.d.ts +31 -0
- package/dist/core/platform/Color.d.ts.map +1 -0
- package/dist/core/platform/Color.js +71 -0
- package/dist/core/platform/Color.js.map +1 -0
- package/dist/core/platform/Common.d.ts +157 -0
- package/dist/core/platform/Common.d.ts.map +1 -0
- package/dist/core/platform/Common.js +180 -0
- package/dist/core/platform/Common.js.map +1 -0
- package/dist/core/platform/Config.d.ts +230 -0
- package/dist/core/platform/Config.d.ts.map +1 -0
- package/dist/core/platform/Config.js +231 -0
- package/dist/core/platform/Config.js.map +1 -0
- package/dist/core/platform/Dictionary.d.ts +16 -0
- package/dist/core/platform/Dictionary.d.ts.map +1 -0
- package/dist/core/platform/Dictionary.js +65 -0
- package/dist/core/platform/Dictionary.js.map +1 -0
- package/dist/core/platform/EGLView/ContainerStrategy.d.ts +30 -0
- package/dist/core/platform/EGLView/ContainerStrategy.d.ts.map +1 -0
- package/dist/core/platform/EGLView/ContainerStrategy.js +121 -0
- package/dist/core/platform/EGLView/ContainerStrategy.js.map +1 -0
- package/dist/core/platform/EGLView/ContentStrategy.d.ts +56 -0
- package/dist/core/platform/EGLView/ContentStrategy.d.ts.map +1 -0
- package/dist/core/platform/EGLView/ContentStrategy.js +117 -0
- package/dist/core/platform/EGLView/ContentStrategy.js.map +1 -0
- package/dist/core/platform/EGLView/EGLInstance.d.ts +8 -0
- package/dist/core/platform/EGLView/EGLInstance.d.ts.map +1 -0
- package/dist/core/platform/EGLView/EGLInstance.js +16 -0
- package/dist/core/platform/EGLView/EGLInstance.js.map +1 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.d.ts +99 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.d.ts.map +1 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.js +116 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.js.map +1 -0
- package/dist/core/platform/EGLView.d.ts +204 -0
- package/dist/core/platform/EGLView.d.ts.map +1 -0
- package/dist/core/platform/EGLView.js +669 -0
- package/dist/core/platform/EGLView.js.map +1 -0
- package/dist/core/platform/FontDefinition.d.ts +47 -0
- package/dist/core/platform/FontDefinition.d.ts.map +1 -0
- package/dist/core/platform/FontDefinition.js +59 -0
- package/dist/core/platform/FontDefinition.js.map +1 -0
- package/dist/core/platform/InputManager.d.ts +149 -0
- package/dist/core/platform/InputManager.d.ts.map +1 -0
- package/dist/core/platform/InputManager.js +558 -0
- package/dist/core/platform/InputManager.js.map +1 -0
- package/dist/core/platform/Loaders.d.ts +4 -0
- package/dist/core/platform/Loaders.d.ts.map +1 -0
- package/dist/core/platform/Loaders.js +141 -0
- package/dist/core/platform/Loaders.js.map +1 -0
- package/dist/core/platform/Macro.d.ts +634 -0
- package/dist/core/platform/Macro.d.ts.map +1 -0
- package/dist/core/platform/Macro.js +763 -0
- package/dist/core/platform/Macro.js.map +1 -0
- package/dist/core/platform/SAXParser.d.ts +44 -0
- package/dist/core/platform/SAXParser.d.ts.map +1 -0
- package/dist/core/platform/SAXParser.js +122 -0
- package/dist/core/platform/SAXParser.js.map +1 -0
- package/dist/core/platform/Types.d.ts +188 -0
- package/dist/core/platform/Types.d.ts.map +1 -0
- package/dist/core/platform/Types.js +425 -0
- package/dist/core/platform/Types.js.map +1 -0
- package/dist/core/platform/VisibleRect.d.ts +38 -0
- package/dist/core/platform/VisibleRect.d.ts.map +1 -0
- package/dist/core/platform/VisibleRect.js +66 -0
- package/dist/core/platform/VisibleRect.js.map +1 -0
- package/dist/core/platform/index.d.ts +7 -0
- package/dist/core/platform/index.d.ts.map +1 -0
- package/dist/core/platform/index.js +7 -0
- package/dist/core/platform/index.js.map +1 -0
- package/dist/core/platform/miniFramework.d.ts +28 -0
- package/dist/core/platform/miniFramework.d.ts.map +1 -0
- package/dist/core/platform/miniFramework.js +245 -0
- package/dist/core/platform/miniFramework.js.map +1 -0
- package/dist/core/platform/types/Quad2.d.ts +30 -0
- package/dist/core/platform/types/Quad2.d.ts.map +1 -0
- package/dist/core/platform/types/Quad2.js +62 -0
- package/dist/core/platform/types/Quad2.js.map +1 -0
- package/dist/core/platform/types/Quad3.d.ts +18 -0
- package/dist/core/platform/types/Quad3.d.ts.map +1 -0
- package/dist/core/platform/types/Quad3.js +30 -0
- package/dist/core/platform/types/Quad3.js.map +1 -0
- package/dist/core/platform/types/Tex2F.d.ts +20 -0
- package/dist/core/platform/types/Tex2F.d.ts.map +1 -0
- package/dist/core/platform/types/Tex2F.js +33 -0
- package/dist/core/platform/types/Tex2F.js.map +1 -0
- package/dist/core/platform/types/Vertex2F.d.ts +12 -0
- package/dist/core/platform/types/Vertex2F.d.ts.map +1 -0
- package/dist/core/platform/types/Vertex2F.js +25 -0
- package/dist/core/platform/types/Vertex2F.js.map +1 -0
- package/dist/core/platform/types/Vertex3F.d.ts +14 -0
- package/dist/core/platform/types/Vertex3F.d.ts.map +1 -0
- package/dist/core/platform/types/Vertex3F.js +31 -0
- package/dist/core/platform/types/Vertex3F.js.map +1 -0
- package/dist/core/platform/types/WebGLColor.d.ts +17 -0
- package/dist/core/platform/types/WebGLColor.d.ts.map +1 -0
- package/dist/core/platform/types/WebGLColor.js +40 -0
- package/dist/core/platform/types/WebGLColor.js.map +1 -0
- package/dist/core/renderer/GlobalVertexBuffer.d.ts +19 -0
- package/dist/core/renderer/GlobalVertexBuffer.d.ts.map +1 -0
- package/dist/core/renderer/GlobalVertexBuffer.js +99 -0
- package/dist/core/renderer/GlobalVertexBuffer.js.map +1 -0
- package/dist/core/renderer/RendererWebGL.d.ts +47 -0
- package/dist/core/renderer/RendererWebGL.d.ts.map +1 -0
- package/dist/core/renderer/RendererWebGL.js +389 -0
- package/dist/core/renderer/RendererWebGL.js.map +1 -0
- package/dist/core/scenes/Scene.d.ts +6 -0
- package/dist/core/scenes/Scene.d.ts.map +1 -0
- package/dist/core/scenes/Scene.js +12 -0
- package/dist/core/scenes/Scene.js.map +1 -0
- package/dist/core/sprites/Animation.d.ts +147 -0
- package/dist/core/sprites/Animation.d.ts.map +1 -0
- package/dist/core/sprites/Animation.js +277 -0
- package/dist/core/sprites/Animation.js.map +1 -0
- package/dist/core/sprites/AnimationCache.d.ts +37 -0
- package/dist/core/sprites/AnimationCache.d.ts.map +1 -0
- package/dist/core/sprites/AnimationCache.js +159 -0
- package/dist/core/sprites/AnimationCache.js.map +1 -0
- package/dist/core/sprites/Sprite.d.ts +104 -0
- package/dist/core/sprites/Sprite.d.ts.map +1 -0
- package/dist/core/sprites/Sprite.js +388 -0
- package/dist/core/sprites/Sprite.js.map +1 -0
- package/dist/core/sprites/SpriteBatchNode.d.ts +194 -0
- package/dist/core/sprites/SpriteBatchNode.d.ts.map +1 -0
- package/dist/core/sprites/SpriteBatchNode.js +332 -0
- package/dist/core/sprites/SpriteBatchNode.js.map +1 -0
- package/dist/core/sprites/SpriteFrame.d.ts +47 -0
- package/dist/core/sprites/SpriteFrame.d.ts.map +1 -0
- package/dist/core/sprites/SpriteFrame.js +223 -0
- package/dist/core/sprites/SpriteFrame.js.map +1 -0
- package/dist/core/sprites/SpriteFrameCache.d.ts +102 -0
- package/dist/core/sprites/SpriteFrameCache.d.ts.map +1 -0
- package/dist/core/sprites/SpriteFrameCache.js +333 -0
- package/dist/core/sprites/SpriteFrameCache.js.map +1 -0
- package/dist/core/sprites/SpriteLoadManager.d.ts +8 -0
- package/dist/core/sprites/SpriteLoadManager.d.ts.map +1 -0
- package/dist/core/sprites/SpriteLoadManager.js +37 -0
- package/dist/core/sprites/SpriteLoadManager.js.map +1 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.d.ts +35 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.js +286 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.js.map +1 -0
- package/dist/core/sprites/SpritesPropertyDefine.d.ts +2 -0
- package/dist/core/sprites/SpritesPropertyDefine.d.ts.map +1 -0
- package/dist/core/sprites/SpritesPropertyDefine.js +19 -0
- package/dist/core/sprites/SpritesPropertyDefine.js.map +1 -0
- package/dist/core/support/PointExtension.d.ts +296 -0
- package/dist/core/support/PointExtension.d.ts.map +1 -0
- package/dist/core/support/PointExtension.js +443 -0
- package/dist/core/support/PointExtension.js.map +1 -0
- package/dist/core/support/Vertex.d.ts +24 -0
- package/dist/core/support/Vertex.d.ts.map +1 -0
- package/dist/core/support/Vertex.js +120 -0
- package/dist/core/support/Vertex.js.map +1 -0
- package/dist/core/utils/BinaryLoader.d.ts +9 -0
- package/dist/core/utils/BinaryLoader.d.ts.map +1 -0
- package/dist/core/utils/BinaryLoader.js +116 -0
- package/dist/core/utils/BinaryLoader.js.map +1 -0
- package/dist/core/utils/Profiler.d.ts +13 -0
- package/dist/core/utils/Profiler.d.ts.map +1 -0
- package/dist/core/utils/Profiler.js +140 -0
- package/dist/core/utils/Profiler.js.map +1 -0
- package/dist/helper/AsyncPool.d.ts +22 -0
- package/dist/helper/AsyncPool.d.ts.map +1 -0
- package/dist/helper/AsyncPool.js +101 -0
- package/dist/helper/AsyncPool.js.map +1 -0
- package/dist/helper/Base64.d.ts +29 -0
- package/dist/helper/Base64.d.ts.map +1 -0
- package/dist/helper/Base64.js +71 -0
- package/dist/helper/Base64.js.map +1 -0
- package/dist/helper/Debugger.d.ts +179 -0
- package/dist/helper/Debugger.d.ts.map +1 -0
- package/dist/helper/Debugger.js +250 -0
- package/dist/helper/Debugger.js.map +1 -0
- package/dist/helper/ZipUtils.d.ts +2 -0
- package/dist/helper/ZipUtils.d.ts.map +1 -0
- package/dist/helper/ZipUtils.js +20 -0
- package/dist/helper/ZipUtils.js.map +1 -0
- package/dist/helper/async.d.ts +49 -0
- package/dist/helper/async.d.ts.map +1 -0
- package/dist/helper/async.js +95 -0
- package/dist/helper/async.js.map +1 -0
- package/dist/helper/checkType.d.ts +8 -0
- package/dist/helper/checkType.d.ts.map +1 -0
- package/dist/helper/checkType.js +31 -0
- package/dist/helper/checkType.js.map +1 -0
- package/dist/helper/engine.d.ts +6 -0
- package/dist/helper/engine.d.ts.map +1 -0
- package/dist/helper/engine.js +115 -0
- package/dist/helper/engine.js.map +1 -0
- package/dist/helper/getset.d.ts +2 -0
- package/dist/helper/getset.d.ts.map +1 -0
- package/dist/helper/getset.js +51 -0
- package/dist/helper/getset.js.map +1 -0
- package/dist/helper/global.d.ts +6 -0
- package/dist/helper/global.d.ts.map +1 -0
- package/dist/helper/global.js +6 -0
- package/dist/helper/global.js.map +1 -0
- package/dist/helper/index.d.ts +3 -0
- package/dist/helper/index.d.ts.map +1 -0
- package/dist/helper/index.js +3 -0
- package/dist/helper/index.js.map +1 -0
- package/dist/helper/loader.d.ts +102 -0
- package/dist/helper/loader.d.ts.map +1 -0
- package/dist/helper/loader.js +447 -0
- package/dist/helper/loader.js.map +1 -0
- package/dist/helper/path.d.ts +12 -0
- package/dist/helper/path.d.ts.map +1 -0
- package/dist/helper/path.js +75 -0
- package/dist/helper/path.js.map +1 -0
- package/dist/helper/string.d.ts +2 -0
- package/dist/helper/string.d.ts.map +1 -0
- package/dist/helper/string.js +32 -0
- package/dist/helper/string.js.map +1 -0
- package/dist/helper/sys.d.ts +446 -0
- package/dist/helper/sys.d.ts.map +1 -0
- package/dist/helper/sys.js +691 -0
- package/dist/helper/sys.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/motion-streak/MotionStreak.d.ts +56 -0
- package/dist/motion-streak/MotionStreak.d.ts.map +1 -0
- package/dist/motion-streak/MotionStreak.js +301 -0
- package/dist/motion-streak/MotionStreak.js.map +1 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.d.ts +9 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.d.ts.map +1 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.js +52 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.js.map +1 -0
- package/dist/motion-streak/index.d.ts +2 -0
- package/dist/motion-streak/index.d.ts.map +1 -0
- package/dist/motion-streak/index.js +2 -0
- package/dist/motion-streak/index.js.map +1 -0
- package/dist/particle/PNGReader.d.ts +30 -0
- package/dist/particle/PNGReader.d.ts.map +1 -0
- package/dist/particle/PNGReader.js +304 -0
- package/dist/particle/PNGReader.js.map +1 -0
- package/dist/particle/Particle.d.ts +27 -0
- package/dist/particle/Particle.d.ts.map +1 -0
- package/dist/particle/Particle.js +50 -0
- package/dist/particle/Particle.js.map +1 -0
- package/dist/particle/ParticleBatchNode.d.ts +163 -0
- package/dist/particle/ParticleBatchNode.d.ts.map +1 -0
- package/dist/particle/ParticleBatchNode.js +447 -0
- package/dist/particle/ParticleBatchNode.js.map +1 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.d.ts +8 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.js +33 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.js.map +1 -0
- package/dist/particle/ParticleSystem.d.ts +941 -0
- package/dist/particle/ParticleSystem.d.ts.map +1 -0
- package/dist/particle/ParticleSystem.js +2017 -0
- package/dist/particle/ParticleSystem.js.map +1 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.d.ts +29 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.d.ts.map +1 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.js +346 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.js.map +1 -0
- package/dist/particle/TIFFReader.d.ts +138 -0
- package/dist/particle/TIFFReader.d.ts.map +1 -0
- package/dist/particle/TIFFReader.js +596 -0
- package/dist/particle/TIFFReader.js.map +1 -0
- package/dist/particle/examples/ParticleFire.d.ts +60 -0
- package/dist/particle/examples/ParticleFire.d.ts.map +1 -0
- package/dist/particle/examples/ParticleFire.js +188 -0
- package/dist/particle/examples/ParticleFire.js.map +1 -0
- package/dist/particle/examples/ParticleGalaxy.d.ts +60 -0
- package/dist/particle/examples/ParticleGalaxy.d.ts.map +1 -0
- package/dist/particle/examples/ParticleGalaxy.js +199 -0
- package/dist/particle/examples/ParticleGalaxy.js.map +1 -0
- package/dist/particle/examples/ParticleSmoke.d.ts +60 -0
- package/dist/particle/examples/ParticleSmoke.d.ts.map +1 -0
- package/dist/particle/examples/ParticleSmoke.js +195 -0
- package/dist/particle/examples/ParticleSmoke.js.map +1 -0
- package/dist/particle/examples/ParticleSpiral.d.ts +38 -0
- package/dist/particle/examples/ParticleSpiral.d.ts.map +1 -0
- package/dist/particle/examples/ParticleSpiral.js +130 -0
- package/dist/particle/examples/ParticleSpiral.js.map +1 -0
- package/dist/particle/examples/index.d.ts +5 -0
- package/dist/particle/examples/index.d.ts.map +1 -0
- package/dist/particle/examples/index.js +5 -0
- package/dist/particle/examples/index.js.map +1 -0
- package/dist/particle/index.d.ts +2 -0
- package/dist/particle/index.d.ts.map +1 -0
- package/dist/particle/index.js +2 -0
- package/dist/particle/index.js.map +1 -0
- package/dist/polyfills.d.ts +34 -0
- package/dist/polyfills.d.ts.map +1 -0
- package/dist/polyfills.js +102 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/progress-timer/ActionProgressTimer.d.ts +118 -0
- package/dist/progress-timer/ActionProgressTimer.d.ts.map +1 -0
- package/dist/progress-timer/ActionProgressTimer.js +173 -0
- package/dist/progress-timer/ActionProgressTimer.js.map +1 -0
- package/dist/progress-timer/ProgressTimer.d.ts +143 -0
- package/dist/progress-timer/ProgressTimer.d.ts.map +1 -0
- package/dist/progress-timer/ProgressTimer.js +228 -0
- package/dist/progress-timer/ProgressTimer.js.map +1 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.d.ts +56 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.d.ts.map +1 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.js +445 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.js.map +1 -0
- package/dist/progress-timer/index.d.ts +3 -0
- package/dist/progress-timer/index.d.ts.map +1 -0
- package/dist/progress-timer/index.js +3 -0
- package/dist/progress-timer/index.js.map +1 -0
- package/dist/render-texture/RenderTexture.d.ts +226 -0
- package/dist/render-texture/RenderTexture.d.ts.map +1 -0
- package/dist/render-texture/RenderTexture.js +332 -0
- package/dist/render-texture/RenderTexture.js.map +1 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.d.ts +28 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.d.ts.map +1 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.js +276 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.js.map +1 -0
- package/dist/render-texture/index.d.ts +2 -0
- package/dist/render-texture/index.d.ts.map +1 -0
- package/dist/render-texture/index.js +2 -0
- package/dist/render-texture/index.js.map +1 -0
- package/dist/shaders/GLProgram.d.ts +288 -0
- package/dist/shaders/GLProgram.d.ts.map +1 -0
- package/dist/shaders/GLProgram.js +794 -0
- package/dist/shaders/GLProgram.js.map +1 -0
- package/dist/shaders/GLProgramState.d.ts +58 -0
- package/dist/shaders/GLProgramState.d.ts.map +1 -0
- package/dist/shaders/GLProgramState.js +255 -0
- package/dist/shaders/GLProgramState.js.map +1 -0
- package/dist/shaders/GLStateCache.d.ts +97 -0
- package/dist/shaders/GLStateCache.d.ts.map +1 -0
- package/dist/shaders/GLStateCache.js +255 -0
- package/dist/shaders/GLStateCache.js.map +1 -0
- package/dist/shaders/ShaderCache.d.ts +111 -0
- package/dist/shaders/ShaderCache.d.ts.map +1 -0
- package/dist/shaders/ShaderCache.js +273 -0
- package/dist/shaders/ShaderCache.js.map +1 -0
- package/dist/shaders/Shaders.d.ts +84 -0
- package/dist/shaders/Shaders.d.ts.map +1 -0
- package/dist/shaders/Shaders.js +250 -0
- package/dist/shaders/Shaders.js.map +1 -0
- package/dist/shaders/index.d.ts +5 -0
- package/dist/shaders/index.d.ts.map +1 -0
- package/dist/shaders/index.js +5 -0
- package/dist/shaders/index.js.map +1 -0
- package/dist/shape-nodes/DrawNode.d.ts +61 -0
- package/dist/shape-nodes/DrawNode.d.ts.map +1 -0
- package/dist/shape-nodes/DrawNode.js +597 -0
- package/dist/shape-nodes/DrawNode.js.map +1 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.d.ts +11 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.js +27 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.js.map +1 -0
- package/dist/text-input/IMEDispatcher.d.ts +180 -0
- package/dist/text-input/IMEDispatcher.d.ts.map +1 -0
- package/dist/text-input/IMEDispatcher.js +454 -0
- package/dist/text-input/IMEDispatcher.js.map +1 -0
- package/dist/text-input/TextFieldTTF.d.ts +219 -0
- package/dist/text-input/TextFieldTTF.d.ts.map +1 -0
- package/dist/text-input/TextFieldTTF.js +381 -0
- package/dist/text-input/TextFieldTTF.js.map +1 -0
- package/dist/textures/Texture2D.d.ts +10 -0
- package/dist/textures/Texture2D.d.ts.map +1 -0
- package/dist/textures/Texture2D.js +10 -0
- package/dist/textures/Texture2D.js.map +1 -0
- package/dist/textures/TextureAtlas.d.ts +204 -0
- package/dist/textures/TextureAtlas.d.ts.map +1 -0
- package/dist/textures/TextureAtlas.js +602 -0
- package/dist/textures/TextureAtlas.js.map +1 -0
- package/dist/textures/TextureCache.d.ts +147 -0
- package/dist/textures/TextureCache.d.ts.map +1 -0
- package/dist/textures/TextureCache.js +327 -0
- package/dist/textures/TextureCache.js.map +1 -0
- package/dist/textures/TexturesPropertyDefine.d.ts +2 -0
- package/dist/textures/TexturesPropertyDefine.d.ts.map +1 -0
- package/dist/textures/TexturesPropertyDefine.js +39 -0
- package/dist/textures/TexturesPropertyDefine.js.map +1 -0
- package/dist/textures/TexturesWebGL.d.ts +349 -0
- package/dist/textures/TexturesWebGL.d.ts.map +1 -0
- package/dist/textures/TexturesWebGL.js +765 -0
- package/dist/textures/TexturesWebGL.js.map +1 -0
- package/dist/textures/WebGLTextureCache.d.ts +2 -0
- package/dist/textures/WebGLTextureCache.d.ts.map +1 -0
- package/dist/textures/WebGLTextureCache.js +79 -0
- package/dist/textures/WebGLTextureCache.js.map +1 -0
- package/dist/textures/index.d.ts +3 -0
- package/dist/textures/index.d.ts.map +1 -0
- package/dist/textures/index.js +3 -0
- package/dist/textures/index.js.map +1 -0
- package/dist/tilemap/TGAlib.d.ts +103 -0
- package/dist/tilemap/TGAlib.d.ts.map +1 -0
- package/dist/tilemap/TGAlib.js +338 -0
- package/dist/tilemap/TGAlib.js.map +1 -0
- package/dist/tilemap/TMXLayer.d.ts +225 -0
- package/dist/tilemap/TMXLayer.d.ts.map +1 -0
- package/dist/tilemap/TMXLayer.js +694 -0
- package/dist/tilemap/TMXLayer.js.map +1 -0
- package/dist/tilemap/TMXLayerInfo.d.ts +42 -0
- package/dist/tilemap/TMXLayerInfo.d.ts.map +1 -0
- package/dist/tilemap/TMXLayerInfo.js +57 -0
- package/dist/tilemap/TMXLayerInfo.js.map +1 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.d.ts +17 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.d.ts.map +1 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.js +209 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.js.map +1 -0
- package/dist/tilemap/TMXMapInfo.d.ts +210 -0
- package/dist/tilemap/TMXMapInfo.d.ts.map +1 -0
- package/dist/tilemap/TMXMapInfo.js +614 -0
- package/dist/tilemap/TMXMapInfo.js.map +1 -0
- package/dist/tilemap/TMXObjectGroup.d.ts +70 -0
- package/dist/tilemap/TMXObjectGroup.d.ts.map +1 -0
- package/dist/tilemap/TMXObjectGroup.js +106 -0
- package/dist/tilemap/TMXObjectGroup.js.map +1 -0
- package/dist/tilemap/TMXTiledMap.d.ts +163 -0
- package/dist/tilemap/TMXTiledMap.d.ts.map +1 -0
- package/dist/tilemap/TMXTiledMap.js +347 -0
- package/dist/tilemap/TMXTiledMap.js.map +1 -0
- package/dist/tilemap/TMXTilesetInfo.d.ts +38 -0
- package/dist/tilemap/TMXTilesetInfo.d.ts.map +1 -0
- package/dist/tilemap/TMXTilesetInfo.js +59 -0
- package/dist/tilemap/TMXTilesetInfo.js.map +1 -0
- package/dist/tilemap/TMXXMLParser.d.ts +52 -0
- package/dist/tilemap/TMXXMLParser.d.ts.map +1 -0
- package/dist/tilemap/TMXXMLParser.js +52 -0
- package/dist/tilemap/TMXXMLParser.js.map +1 -0
- package/dist/tilemap/index.d.ts +4 -0
- package/dist/tilemap/index.d.ts.map +1 -0
- package/dist/tilemap/index.js +4 -0
- package/dist/tilemap/index.js.map +1 -0
- package/dist/ui/base/FocusNavigationController.d.ts +12 -0
- package/dist/ui/base/FocusNavigationController.d.ts.map +1 -0
- package/dist/ui/base/FocusNavigationController.js +54 -0
- package/dist/ui/base/FocusNavigationController.js.map +1 -0
- package/dist/ui/base/ProtectedNode.d.ts +66 -0
- package/dist/ui/base/ProtectedNode.d.ts.map +1 -0
- package/dist/ui/base/ProtectedNode.js +248 -0
- package/dist/ui/base/ProtectedNode.js.map +1 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.d.ts +13 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.js +136 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.js.map +1 -0
- package/dist/ui/base/UIHelper.d.ts +48 -0
- package/dist/ui/base/UIHelper.d.ts.map +1 -0
- package/dist/ui/base/UIHelper.js +128 -0
- package/dist/ui/base/UIHelper.js.map +1 -0
- package/dist/ui/base/UIScale9Sprite.d.ts +224 -0
- package/dist/ui/base/UIScale9Sprite.d.ts.map +1 -0
- package/dist/ui/base/UIScale9Sprite.js +825 -0
- package/dist/ui/base/UIScale9Sprite.js.map +1 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.d.ts +15 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.js +119 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.js.map +1 -0
- package/dist/ui/base/UIWidget.d.ts +794 -0
- package/dist/ui/base/UIWidget.d.ts.map +1 -0
- package/dist/ui/base/UIWidget.js +1634 -0
- package/dist/ui/base/UIWidget.js.map +1 -0
- package/dist/ui/base/UIWidgetRenderCmd.d.ts +9 -0
- package/dist/ui/base/UIWidgetRenderCmd.d.ts.map +1 -0
- package/dist/ui/base/UIWidgetRenderCmd.js +41 -0
- package/dist/ui/base/UIWidgetRenderCmd.js.map +1 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout/UILayout.d.ts +486 -0
- package/dist/ui/layout/UILayout.d.ts.map +1 -0
- package/dist/ui/layout/UILayout.js +1430 -0
- package/dist/ui/layout/UILayout.js.map +1 -0
- package/dist/ui/layout/UILayoutParameter.d.ts +344 -0
- package/dist/ui/layout/UILayoutParameter.d.ts.map +1 -0
- package/dist/ui/layout/UILayoutParameter.js +444 -0
- package/dist/ui/layout/UILayoutParameter.js.map +1 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.d.ts +30 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.js +136 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.js.map +1 -0
- package/dist/ui/layout/constant.d.ts +30 -0
- package/dist/ui/layout/constant.d.ts.map +1 -0
- package/dist/ui/layout/constant.js +31 -0
- package/dist/ui/layout/constant.js.map +1 -0
- package/dist/ui/widget/UIButton.d.ts +248 -0
- package/dist/ui/widget/UIButton.d.ts.map +1 -0
- package/dist/ui/widget/UIButton.js +727 -0
- package/dist/ui/widget/UIButton.js.map +1 -0
- package/dist/ui/widget/UIRichText.d.ts +216 -0
- package/dist/ui/widget/UIRichText.d.ts.map +1 -0
- package/dist/ui/widget/UIRichText.js +549 -0
- package/dist/ui/widget/UIRichText.js.map +1 -0
- package/dist/ui/widget/UIScrollView.d.ts +547 -0
- package/dist/ui/widget/UIScrollView.d.ts.map +1 -0
- package/dist/ui/widget/UIScrollView.js +1544 -0
- package/dist/ui/widget/UIScrollView.js.map +1 -0
- package/dist/ui/widget/UIScrollViewBar.d.ts +101 -0
- package/dist/ui/widget/UIScrollViewBar.d.ts.map +1 -0
- package/dist/ui/widget/UIScrollViewBar.js +277 -0
- package/dist/ui/widget/UIScrollViewBar.js.map +1 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.d.ts +10 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.js +42 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.js.map +1 -0
- package/dist/ui/widget/UISlider.d.ts +229 -0
- package/dist/ui/widget/UISlider.d.ts.map +1 -0
- package/dist/ui/widget/UISlider.js +667 -0
- package/dist/ui/widget/UISlider.js.map +1 -0
- package/dist/ui/widget/UIText.d.ts +90 -0
- package/dist/ui/widget/UIText.d.ts.map +1 -0
- package/dist/ui/widget/UIText.js +325 -0
- package/dist/ui/widget/UIText.js.map +1 -0
- package/dist/ui/widget/UITextField.d.ts +282 -0
- package/dist/ui/widget/UITextField.d.ts.map +1 -0
- package/dist/ui/widget/UITextField.js +549 -0
- package/dist/ui/widget/UITextField.js.map +1 -0
- package/dist/ui/widget/UITextFieldRenderer.d.ts +41 -0
- package/dist/ui/widget/UITextFieldRenderer.d.ts.map +1 -0
- package/dist/ui/widget/UITextFieldRenderer.js +150 -0
- package/dist/ui/widget/UITextFieldRenderer.js.map +1 -0
- package/eslint.config.ts +59 -0
- package/index.html +22 -0
- package/package.json +38 -0
- package/res/Button.mp3 +0 -0
- package/res/SmallSun.plist +108 -0
- package/res/Spiral.plist +102 -0
- package/res/base.png +0 -0
- package/res/button.png +0 -0
- package/res/button_plus.png +0 -0
- package/res/ortho-test1.png +0 -0
- package/res/orthogonal-test1.tmx +9 -0
- package/res/orthogonal-test1.tsx +4 -0
- package/res/particle.png +0 -0
- package/res/sliderThumb.png +0 -0
- package/res/sliderTrack.png +0 -0
- package/res/streak.png +0 -0
- package/res/ui.plist +578 -0
- package/res/ui.png +0 -0
- package/res/vite.svg +1 -0
- package/test/ActionScene.ts +15 -0
- package/test/DemoScene.ts +108 -0
- package/test/GraphicsTest.ts +17 -0
- package/test/ParticleScene.ts +24 -0
- package/test/TiledMapScene.ts +14 -0
- package/test/index.ts +28 -0
- package/vite.config.ts +13 -0
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
import { game, renderer } from '../..';
|
|
2
|
+
import { SpriteFrame, spriteFrameCache } from '../../core';
|
|
3
|
+
import { Node } from '../../core/base-nodes/Node';
|
|
4
|
+
import { _Rect, p, Rect, rectEqualToZero, Size, sizeEqualToSize } from '../../core/cocoa/Geometry';
|
|
5
|
+
import { BlendFunc } from '../../core/platform/BlendFunc';
|
|
6
|
+
import { FIX_ARTIFACTS_BY_STRECHING_TEXEL } from '../../core/platform/Config';
|
|
7
|
+
import { BLEND_DST, BLEND_SRC, contentScaleFactor, ONE, rectPointsToPixels, SRC_ALPHA } from '../../core/platform/Macro';
|
|
8
|
+
import { SpriteLoadManager } from '../../core/sprites/SpriteLoadManager';
|
|
9
|
+
import { error, log } from '../../helper/Debugger';
|
|
10
|
+
import { _renderType } from '../../helper/engine';
|
|
11
|
+
import { textureCache } from '../../textures';
|
|
12
|
+
import { Scale9SpriteWebGLRenderCmd } from './UIScale9SpriteWebGLRenderCmd';
|
|
13
|
+
const dataPool = {
|
|
14
|
+
_pool: {},
|
|
15
|
+
_lengths: [],
|
|
16
|
+
put: function (data) {
|
|
17
|
+
const length = data.length;
|
|
18
|
+
if (!this._pool[length]) {
|
|
19
|
+
this._pool[length] = [data];
|
|
20
|
+
this._lengths.push(length);
|
|
21
|
+
this._lengths.sort();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this._pool[length].push(data);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
get: function (length) {
|
|
28
|
+
let id;
|
|
29
|
+
for (let i = 0; i < this._lengths.length; i++) {
|
|
30
|
+
if (this._lengths[i] >= length) {
|
|
31
|
+
id = this._lengths[i];
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (id) {
|
|
36
|
+
return this._pool[id].pop();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
// var FIX_ARTIFACTS_BY_STRECHING_TEXEL = FIX_ARTIFACTS_BY_STRECHING_TEXEL
|
|
44
|
+
const cornerId = [];
|
|
45
|
+
let webgl;
|
|
46
|
+
const simpleQuadGenerator = {
|
|
47
|
+
_rebuildQuads_base: function (sprite, spriteFrame, contentSize, isTrimmedContentSize) {
|
|
48
|
+
//build vertices
|
|
49
|
+
let vertices = sprite._vertices;
|
|
50
|
+
const wt = sprite._renderCmd._worldTransform;
|
|
51
|
+
let l, b, r, t;
|
|
52
|
+
if (isTrimmedContentSize) {
|
|
53
|
+
l = 0;
|
|
54
|
+
b = 0;
|
|
55
|
+
r = contentSize.width;
|
|
56
|
+
t = contentSize.height;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const originalSize = spriteFrame._originalSize;
|
|
60
|
+
const rect = spriteFrame._rect;
|
|
61
|
+
const offset = spriteFrame._offset;
|
|
62
|
+
const scaleX = contentSize.width / originalSize.width;
|
|
63
|
+
const scaleY = contentSize.height / originalSize.height;
|
|
64
|
+
const trimmLeft = offset.x + (originalSize.width - rect.width) / 2;
|
|
65
|
+
const trimmRight = offset.x - (originalSize.width - rect.width) / 2;
|
|
66
|
+
const trimmedBottom = offset.y + (originalSize.height - rect.height) / 2;
|
|
67
|
+
const trimmedTop = offset.y - (originalSize.height - rect.height) / 2;
|
|
68
|
+
l = trimmLeft * scaleX;
|
|
69
|
+
b = trimmedBottom * scaleY;
|
|
70
|
+
r = contentSize.width + trimmRight * scaleX;
|
|
71
|
+
t = contentSize.height + trimmedTop * scaleY;
|
|
72
|
+
}
|
|
73
|
+
if (vertices.length < 8) {
|
|
74
|
+
dataPool.put(vertices);
|
|
75
|
+
vertices = dataPool.get(8) || new Float32Array(8);
|
|
76
|
+
sprite._vertices = vertices;
|
|
77
|
+
}
|
|
78
|
+
// bl, br, tl, tr
|
|
79
|
+
if (webgl) {
|
|
80
|
+
vertices[0] = l * wt.a + b * wt.c + wt.tx;
|
|
81
|
+
vertices[1] = l * wt.b + b * wt.d + wt.ty;
|
|
82
|
+
vertices[2] = r * wt.a + b * wt.c + wt.tx;
|
|
83
|
+
vertices[3] = r * wt.b + b * wt.d + wt.ty;
|
|
84
|
+
vertices[4] = l * wt.a + t * wt.c + wt.tx;
|
|
85
|
+
vertices[5] = l * wt.b + t * wt.d + wt.ty;
|
|
86
|
+
vertices[6] = r * wt.a + t * wt.c + wt.tx;
|
|
87
|
+
vertices[7] = r * wt.b + t * wt.d + wt.ty;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
vertices[0] = l;
|
|
91
|
+
vertices[1] = b;
|
|
92
|
+
vertices[2] = r;
|
|
93
|
+
vertices[3] = b;
|
|
94
|
+
vertices[4] = l;
|
|
95
|
+
vertices[5] = t;
|
|
96
|
+
vertices[6] = r;
|
|
97
|
+
vertices[7] = t;
|
|
98
|
+
}
|
|
99
|
+
cornerId[0] = 0;
|
|
100
|
+
cornerId[1] = 2;
|
|
101
|
+
cornerId[2] = 4;
|
|
102
|
+
cornerId[3] = 6;
|
|
103
|
+
//build uvs
|
|
104
|
+
if (sprite._uvsDirty) {
|
|
105
|
+
this._calculateUVs(sprite, spriteFrame);
|
|
106
|
+
}
|
|
107
|
+
sprite._vertCount = 4;
|
|
108
|
+
},
|
|
109
|
+
_calculateUVs: function (sprite, spriteFrame) {
|
|
110
|
+
let uvs = sprite._uvs;
|
|
111
|
+
const atlasWidth = spriteFrame._texture._pixelsWide;
|
|
112
|
+
const atlasHeight = spriteFrame._texture._pixelsHigh;
|
|
113
|
+
let textureRect = spriteFrame._rect;
|
|
114
|
+
textureRect = rectPointsToPixels(textureRect);
|
|
115
|
+
if (uvs.length < 8) {
|
|
116
|
+
dataPool.put(uvs);
|
|
117
|
+
uvs = dataPool.get(8) || new Float32Array(8);
|
|
118
|
+
sprite._uvs = uvs;
|
|
119
|
+
}
|
|
120
|
+
//uv computation should take spritesheet into account.
|
|
121
|
+
let l, b, r, t;
|
|
122
|
+
const texelCorrect = FIX_ARTIFACTS_BY_STRECHING_TEXEL ? 0.5 : 0;
|
|
123
|
+
if (spriteFrame._rotated) {
|
|
124
|
+
l = (textureRect.x + texelCorrect) / atlasWidth;
|
|
125
|
+
b = (textureRect.y + textureRect.width - texelCorrect) / atlasHeight;
|
|
126
|
+
r = (textureRect.x + textureRect.height - texelCorrect) / atlasWidth;
|
|
127
|
+
t = (textureRect.y + texelCorrect) / atlasHeight;
|
|
128
|
+
uvs[0] = l;
|
|
129
|
+
uvs[1] = t;
|
|
130
|
+
uvs[2] = l;
|
|
131
|
+
uvs[3] = b;
|
|
132
|
+
uvs[4] = r;
|
|
133
|
+
uvs[5] = t;
|
|
134
|
+
uvs[6] = r;
|
|
135
|
+
uvs[7] = b;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
l = (textureRect.x + texelCorrect) / atlasWidth;
|
|
139
|
+
b = (textureRect.y + textureRect.height - texelCorrect) / atlasHeight;
|
|
140
|
+
r = (textureRect.x + textureRect.width - texelCorrect) / atlasWidth;
|
|
141
|
+
t = (textureRect.y + texelCorrect) / atlasHeight;
|
|
142
|
+
uvs[0] = l;
|
|
143
|
+
uvs[1] = b;
|
|
144
|
+
uvs[2] = r;
|
|
145
|
+
uvs[3] = b;
|
|
146
|
+
uvs[4] = l;
|
|
147
|
+
uvs[5] = t;
|
|
148
|
+
uvs[6] = r;
|
|
149
|
+
uvs[7] = t;
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
const scale9QuadGenerator = {
|
|
154
|
+
x: new Array(4),
|
|
155
|
+
y: new Array(4),
|
|
156
|
+
_rebuildQuads_base: function (sprite, spriteFrame, contentSize, insetLeft, insetRight, insetTop, insetBottom) {
|
|
157
|
+
//build vertices
|
|
158
|
+
let vertices = sprite._vertices;
|
|
159
|
+
const wt = sprite._renderCmd._worldTransform;
|
|
160
|
+
// const rect = spriteFrame._rect
|
|
161
|
+
const leftWidth = insetLeft;
|
|
162
|
+
const rightWidth = insetRight;
|
|
163
|
+
// const centerWidth = rect.width - leftWidth - rightWidth
|
|
164
|
+
const topHeight = insetTop;
|
|
165
|
+
const bottomHeight = insetBottom;
|
|
166
|
+
// const centerHeight = rect.height - topHeight - bottomHeight
|
|
167
|
+
const preferSize = contentSize;
|
|
168
|
+
let sizableWidth = preferSize.width - leftWidth - rightWidth;
|
|
169
|
+
let sizableHeight = preferSize.height - topHeight - bottomHeight;
|
|
170
|
+
let xScale = preferSize.width / (leftWidth + rightWidth);
|
|
171
|
+
let yScale = preferSize.height / (topHeight + bottomHeight);
|
|
172
|
+
xScale = xScale > 1 ? 1 : xScale;
|
|
173
|
+
yScale = yScale > 1 ? 1 : yScale;
|
|
174
|
+
sizableWidth = sizableWidth < 0 ? 0 : sizableWidth;
|
|
175
|
+
sizableHeight = sizableHeight < 0 ? 0 : sizableHeight;
|
|
176
|
+
const x = this.x;
|
|
177
|
+
const y = this.y;
|
|
178
|
+
x[0] = 0;
|
|
179
|
+
x[1] = leftWidth * xScale;
|
|
180
|
+
x[2] = x[1] + sizableWidth;
|
|
181
|
+
x[3] = preferSize.width;
|
|
182
|
+
y[0] = 0;
|
|
183
|
+
y[1] = bottomHeight * yScale;
|
|
184
|
+
y[2] = y[1] + sizableHeight;
|
|
185
|
+
y[3] = preferSize.height;
|
|
186
|
+
if (vertices.length < 32) {
|
|
187
|
+
dataPool.put(vertices);
|
|
188
|
+
vertices = dataPool.get(32) || new Float32Array(32);
|
|
189
|
+
sprite._vertices = vertices;
|
|
190
|
+
}
|
|
191
|
+
let offset = 0, row, col;
|
|
192
|
+
if (webgl) {
|
|
193
|
+
for (row = 0; row < 4; row++) {
|
|
194
|
+
for (col = 0; col < 4; col++) {
|
|
195
|
+
vertices[offset] = x[col] * wt.a + y[row] * wt.c + wt.tx;
|
|
196
|
+
vertices[offset + 1] = x[col] * wt.b + y[row] * wt.d + wt.ty;
|
|
197
|
+
offset += 2;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
for (row = 0; row < 4; row++) {
|
|
203
|
+
for (col = 0; col < 4; col++) {
|
|
204
|
+
vertices[offset] = x[col];
|
|
205
|
+
vertices[offset + 1] = y[row];
|
|
206
|
+
offset += 2;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
cornerId[0] = 0;
|
|
211
|
+
cornerId[1] = 6;
|
|
212
|
+
cornerId[2] = 24;
|
|
213
|
+
cornerId[3] = 30;
|
|
214
|
+
//build uvs
|
|
215
|
+
if (sprite._uvsDirty) {
|
|
216
|
+
this._calculateUVs(sprite, spriteFrame, insetLeft, insetRight, insetTop, insetBottom);
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
_calculateUVs: function (sprite, spriteFrame, insetLeft, insetRight, insetTop, insetBottom) {
|
|
220
|
+
let uvs = sprite._uvs;
|
|
221
|
+
let rect = spriteFrame._rect;
|
|
222
|
+
const atlasWidth = spriteFrame._texture._pixelsWide;
|
|
223
|
+
const atlasHeight = spriteFrame._texture._pixelsHigh;
|
|
224
|
+
//caculate texture coordinate
|
|
225
|
+
let textureRect = spriteFrame._rect;
|
|
226
|
+
textureRect = rectPointsToPixels(textureRect);
|
|
227
|
+
rect = rectPointsToPixels(rect);
|
|
228
|
+
const scale = contentScaleFactor();
|
|
229
|
+
const leftWidth = insetLeft * scale;
|
|
230
|
+
const rightWidth = insetRight * scale;
|
|
231
|
+
const centerWidth = rect.width - leftWidth - rightWidth;
|
|
232
|
+
const topHeight = insetTop * scale;
|
|
233
|
+
const bottomHeight = insetBottom * scale;
|
|
234
|
+
const centerHeight = rect.height - topHeight - bottomHeight;
|
|
235
|
+
if (uvs.length < 32) {
|
|
236
|
+
dataPool.put(uvs);
|
|
237
|
+
uvs = dataPool.get(32) || new Float32Array(32);
|
|
238
|
+
sprite._uvs = uvs;
|
|
239
|
+
}
|
|
240
|
+
//uv computation should take spritesheet into account.
|
|
241
|
+
const u = this.x;
|
|
242
|
+
const v = this.y;
|
|
243
|
+
const texelCorrect = FIX_ARTIFACTS_BY_STRECHING_TEXEL ? 0.5 : 0;
|
|
244
|
+
let offset = 0, row, col;
|
|
245
|
+
if (spriteFrame._rotated) {
|
|
246
|
+
u[0] = (textureRect.x + texelCorrect) / atlasWidth;
|
|
247
|
+
u[1] = (bottomHeight + textureRect.x) / atlasWidth;
|
|
248
|
+
u[2] = (bottomHeight + centerHeight + textureRect.x) / atlasWidth;
|
|
249
|
+
u[3] = (textureRect.x + textureRect.height - texelCorrect) / atlasWidth;
|
|
250
|
+
v[3] = (textureRect.y + texelCorrect) / atlasHeight;
|
|
251
|
+
v[2] = (leftWidth + textureRect.y) / atlasHeight;
|
|
252
|
+
v[1] = (leftWidth + centerWidth + textureRect.y) / atlasHeight;
|
|
253
|
+
v[0] = (textureRect.y + textureRect.width - texelCorrect) / atlasHeight;
|
|
254
|
+
for (row = 0; row < 4; row++) {
|
|
255
|
+
for (col = 0; col < 4; col++) {
|
|
256
|
+
uvs[offset] = u[row];
|
|
257
|
+
uvs[offset + 1] = v[3 - col];
|
|
258
|
+
offset += 2;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
u[0] = (textureRect.x + texelCorrect) / atlasWidth;
|
|
264
|
+
u[1] = (leftWidth + textureRect.x) / atlasWidth;
|
|
265
|
+
u[2] = (leftWidth + centerWidth + textureRect.x) / atlasWidth;
|
|
266
|
+
u[3] = (textureRect.x + textureRect.width - texelCorrect) / atlasWidth;
|
|
267
|
+
v[3] = (textureRect.y + texelCorrect) / atlasHeight;
|
|
268
|
+
v[2] = (topHeight + textureRect.y) / atlasHeight;
|
|
269
|
+
v[1] = (topHeight + centerHeight + textureRect.y) / atlasHeight;
|
|
270
|
+
v[0] = (textureRect.y + textureRect.height - texelCorrect) / atlasHeight;
|
|
271
|
+
for (row = 0; row < 4; row++) {
|
|
272
|
+
for (col = 0; col < 4; col++) {
|
|
273
|
+
uvs[offset] = u[col];
|
|
274
|
+
uvs[offset + 1] = v[row];
|
|
275
|
+
offset += 2;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* <p>
|
|
283
|
+
* A 9-slice sprite for cocos2d UI. <br/>
|
|
284
|
+
* <br/>
|
|
285
|
+
* 9-slice scaling allows you to specify how scaling is applied <br/>
|
|
286
|
+
* to specific areas of a sprite. With 9-slice scaling (3x3 grid), <br/>
|
|
287
|
+
* you can ensure that the sprite does not become distorted when <br/>
|
|
288
|
+
* scaled. <br/>
|
|
289
|
+
* @see http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCScale9Sprite.html <br/>
|
|
290
|
+
* </p>
|
|
291
|
+
* @class
|
|
292
|
+
* @extends Node
|
|
293
|
+
*
|
|
294
|
+
* @property {Size} preferredSize - The preferred size of the 9-slice sprite
|
|
295
|
+
* @property {Rect} capInsets - The cap insets of the 9-slice sprite
|
|
296
|
+
* @property {Number} insetLeft - The left inset of the 9-slice sprite
|
|
297
|
+
* @property {Number} insetTop - The top inset of the 9-slice sprite
|
|
298
|
+
* @property {Number} insetRight - The right inset of the 9-slice sprite
|
|
299
|
+
* @property {Number} insetBottom - The bottom inset of the 9-slice sprite
|
|
300
|
+
*/
|
|
301
|
+
export class Scale9Sprite extends Node {
|
|
302
|
+
//resource data, could be async loaded.
|
|
303
|
+
_spriteFrame = null;
|
|
304
|
+
//scale 9 data
|
|
305
|
+
_insetLeft = 0;
|
|
306
|
+
_insetRight = 0;
|
|
307
|
+
_insetTop = 0;
|
|
308
|
+
_insetBottom = 0;
|
|
309
|
+
//blend function
|
|
310
|
+
_blendFunc = null;
|
|
311
|
+
//sliced or simple
|
|
312
|
+
_renderingType = 1;
|
|
313
|
+
//bright or not
|
|
314
|
+
_brightState = 0;
|
|
315
|
+
_opacityModifyRGB = false;
|
|
316
|
+
//rendering quads shared by canvas and webgl
|
|
317
|
+
_rawVerts = null;
|
|
318
|
+
_rawUvs = null;
|
|
319
|
+
_vertCount = 0;
|
|
320
|
+
_quadsDirty = true;
|
|
321
|
+
_uvsDirty = true;
|
|
322
|
+
_isTriangle = false;
|
|
323
|
+
_isTrimmedContentSize = false;
|
|
324
|
+
_textureLoaded = false;
|
|
325
|
+
//v3.3
|
|
326
|
+
_flippedX = false;
|
|
327
|
+
_flippedY = false;
|
|
328
|
+
_className = 'Scale9Sprite';
|
|
329
|
+
_loader;
|
|
330
|
+
_capInsetsInternal;
|
|
331
|
+
_cacheCapInsets;
|
|
332
|
+
/**
|
|
333
|
+
* Constructor function.
|
|
334
|
+
* @function
|
|
335
|
+
* @param {string|SpriteFrame} file file name of texture or a SpriteFrame
|
|
336
|
+
* @param {Rect} rectOrCapInsets
|
|
337
|
+
* @param {Rect} capInsets
|
|
338
|
+
* @returns {Scale9Sprite}
|
|
339
|
+
*/
|
|
340
|
+
constructor(file, rectOrCapInsets, capInsets) {
|
|
341
|
+
super();
|
|
342
|
+
//for async texture load
|
|
343
|
+
this._loader = new SpriteLoadManager();
|
|
344
|
+
this._renderCmd.setState(this._brightState);
|
|
345
|
+
this._blendFunc = BlendFunc._alphaPremultiplied();
|
|
346
|
+
this.setAnchorPoint(p(0.5, 0.5));
|
|
347
|
+
// Init vertex data for simple
|
|
348
|
+
this._rawVerts = null;
|
|
349
|
+
this._rawUvs = null;
|
|
350
|
+
this._vertices = dataPool.get(8) || new Float32Array(8);
|
|
351
|
+
this._uvs = dataPool.get(8) || new Float32Array(8);
|
|
352
|
+
if (file !== undefined) {
|
|
353
|
+
if (file instanceof SpriteFrame)
|
|
354
|
+
this.initWithSpriteFrame(file, rectOrCapInsets);
|
|
355
|
+
else {
|
|
356
|
+
const frame = spriteFrameCache.getSpriteFrame(file);
|
|
357
|
+
if (frame)
|
|
358
|
+
this.initWithSpriteFrame(frame, rectOrCapInsets);
|
|
359
|
+
else
|
|
360
|
+
this.initWithFile(file, rectOrCapInsets, capInsets);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (webgl === undefined) {
|
|
364
|
+
webgl = _renderType === game.RENDER_TYPE_WEBGL;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
textureLoaded() {
|
|
368
|
+
return this._textureLoaded;
|
|
369
|
+
}
|
|
370
|
+
getCapInsets() {
|
|
371
|
+
return Rect(this._capInsetsInternal);
|
|
372
|
+
}
|
|
373
|
+
_asyncSetCapInsets() {
|
|
374
|
+
this.removeEventListener('load', this._asyncSetCapInsets, this);
|
|
375
|
+
this.setCapInsets(this._cacheCapInsets);
|
|
376
|
+
this._cacheCapInsets = null;
|
|
377
|
+
}
|
|
378
|
+
setCapInsets(capInsets) {
|
|
379
|
+
// Asynchronous loading texture requires this data
|
|
380
|
+
// This data does not take effect immediately, so it does not affect the existing texture.
|
|
381
|
+
if (!this.loaded()) {
|
|
382
|
+
this._cacheCapInsets = capInsets;
|
|
383
|
+
this.removeEventListener('load', this._asyncSetCapInsets, this);
|
|
384
|
+
this.addEventListener('load', this._asyncSetCapInsets, this);
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
387
|
+
this._capInsetsInternal = capInsets;
|
|
388
|
+
this._updateCapInsets(this._spriteFrame._rect, this._capInsetsInternal);
|
|
389
|
+
}
|
|
390
|
+
_updateCapInsets(rect, capInsets) {
|
|
391
|
+
if (!capInsets || !rect || rectEqualToZero(capInsets)) {
|
|
392
|
+
rect = rect || { x: 0, y: 0, width: this._contentSize.width, height: this._contentSize.height };
|
|
393
|
+
this._capInsetsInternal = Rect(rect.width / 3, rect.height / 3, rect.width / 3, rect.height / 3);
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
this._capInsetsInternal = capInsets;
|
|
397
|
+
}
|
|
398
|
+
if (!rectEqualToZero(rect)) {
|
|
399
|
+
this._insetLeft = this._capInsetsInternal.x;
|
|
400
|
+
this._insetTop = this._capInsetsInternal.y;
|
|
401
|
+
this._insetRight = rect.width - this._insetLeft - this._capInsetsInternal.width;
|
|
402
|
+
this._insetBottom = rect.height - this._insetTop - this._capInsetsInternal.height;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
initWithFile(file, rect, capInsets) {
|
|
406
|
+
if (file instanceof _Rect) {
|
|
407
|
+
file = rect;
|
|
408
|
+
capInsets = file;
|
|
409
|
+
rect = Rect(0, 0, 0, 0);
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
rect = rect || Rect(0, 0, 0, 0);
|
|
413
|
+
capInsets = capInsets || Rect(0, 0, 0, 0);
|
|
414
|
+
}
|
|
415
|
+
if (!file)
|
|
416
|
+
throw new Error('Scale9Sprite.initWithFile(): file should be non-null');
|
|
417
|
+
let texture = textureCache.getTextureForKey(file);
|
|
418
|
+
if (!texture) {
|
|
419
|
+
texture = textureCache.addImage(file);
|
|
420
|
+
}
|
|
421
|
+
const locLoaded = texture.isLoaded();
|
|
422
|
+
this._textureLoaded = locLoaded;
|
|
423
|
+
this._loader.clear();
|
|
424
|
+
if (!locLoaded) {
|
|
425
|
+
this._loader.once(texture, function () {
|
|
426
|
+
this.initWithFile(file, rect, capInsets);
|
|
427
|
+
this.dispatchEvent('load');
|
|
428
|
+
}, this);
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
//in this function, the texture already make sure is loaded.
|
|
432
|
+
if (rectEqualToZero(rect)) {
|
|
433
|
+
const textureSize = texture.getContentSize();
|
|
434
|
+
rect = Rect(0, 0, textureSize.width, textureSize.height);
|
|
435
|
+
}
|
|
436
|
+
this.setTexture(texture, rect);
|
|
437
|
+
this._updateCapInsets(rect, capInsets);
|
|
438
|
+
return true;
|
|
439
|
+
}
|
|
440
|
+
updateWithBatchNode(batchNode, originalRect, rotated, capInsets) {
|
|
441
|
+
if (!batchNode) {
|
|
442
|
+
return false;
|
|
443
|
+
}
|
|
444
|
+
const texture = batchNode.getTexture();
|
|
445
|
+
this._loader.clear();
|
|
446
|
+
if (!texture.isLoaded()) {
|
|
447
|
+
this._loader.once(texture, function () {
|
|
448
|
+
this.updateWithBatchNode(batchNode, originalRect, rotated, capInsets);
|
|
449
|
+
this.dispatchEvent('load');
|
|
450
|
+
}, this);
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
this.setTexture(texture, originalRect);
|
|
454
|
+
this._updateCapInsets(originalRect, capInsets);
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Initializes a 9-slice sprite with an sprite frame
|
|
459
|
+
* @param spriteFrameOrSFName The sprite frame object.
|
|
460
|
+
*/
|
|
461
|
+
initWithSpriteFrame(spriteFrame, capInsets) {
|
|
462
|
+
this.setSpriteFrame(spriteFrame);
|
|
463
|
+
capInsets = capInsets || Rect(0, 0, 0, 0);
|
|
464
|
+
this._updateCapInsets(spriteFrame._rect, capInsets);
|
|
465
|
+
}
|
|
466
|
+
initWithSpriteFrameName(spriteFrameName, capInsets) {
|
|
467
|
+
if (!spriteFrameName)
|
|
468
|
+
throw new Error('Scale9Sprite.initWithSpriteFrameName(): spriteFrameName should be non-null');
|
|
469
|
+
const frame = spriteFrameCache.getSpriteFrame(spriteFrameName);
|
|
470
|
+
if (frame == null) {
|
|
471
|
+
log('Scale9Sprite.initWithSpriteFrameName(): cant find the sprite frame by spriteFrameName');
|
|
472
|
+
return false;
|
|
473
|
+
}
|
|
474
|
+
this.setSpriteFrame(frame);
|
|
475
|
+
capInsets = capInsets || Rect(0, 0, 0, 0);
|
|
476
|
+
this._updateCapInsets(frame._rect, capInsets);
|
|
477
|
+
}
|
|
478
|
+
loaded() {
|
|
479
|
+
if (this._spriteFrame === null) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
return this._spriteFrame.textureLoaded();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Change the texture file of 9 slice sprite
|
|
488
|
+
*
|
|
489
|
+
* @param textureOrTextureFile The name of the texture file.
|
|
490
|
+
*/
|
|
491
|
+
setTexture(texture, rect) {
|
|
492
|
+
const spriteFrame = new SpriteFrame(texture, rect);
|
|
493
|
+
this.setSpriteFrame(spriteFrame);
|
|
494
|
+
}
|
|
495
|
+
_updateBlendFunc() {
|
|
496
|
+
// it's possible to have an untextured sprite
|
|
497
|
+
const blendFunc = this._blendFunc;
|
|
498
|
+
if (!this._spriteFrame || !this._spriteFrame._texture.hasPremultipliedAlpha()) {
|
|
499
|
+
if (blendFunc.src === ONE && blendFunc.dst === BLEND_DST) {
|
|
500
|
+
blendFunc.src = SRC_ALPHA;
|
|
501
|
+
}
|
|
502
|
+
this._opacityModifyRGB = false;
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
if (blendFunc.src === SRC_ALPHA && blendFunc.dst === BLEND_DST) {
|
|
506
|
+
blendFunc.src = ONE;
|
|
507
|
+
}
|
|
508
|
+
this._opacityModifyRGB = true;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
setOpacityModifyRGB(value) {
|
|
512
|
+
if (this._opacityModifyRGB !== value) {
|
|
513
|
+
this._opacityModifyRGB = value;
|
|
514
|
+
this._renderCmd._setColorDirty();
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
isOpacityModifyRGB() {
|
|
518
|
+
return this._opacityModifyRGB;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* Change the sprite frame of 9 slice sprite
|
|
522
|
+
*
|
|
523
|
+
* @param spriteFrameOrSFFileName The name of the texture file.
|
|
524
|
+
*/
|
|
525
|
+
setSpriteFrame(spriteFrame) {
|
|
526
|
+
if (spriteFrame) {
|
|
527
|
+
this._spriteFrame = spriteFrame;
|
|
528
|
+
this._quadsDirty = true;
|
|
529
|
+
this._uvsDirty = true;
|
|
530
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
531
|
+
const self = this;
|
|
532
|
+
const onResourceDataLoaded = function () {
|
|
533
|
+
if (sizeEqualToSize(self._contentSize, Size(0, 0))) {
|
|
534
|
+
self.setContentSize(self._spriteFrame._rect);
|
|
535
|
+
}
|
|
536
|
+
self._textureLoaded = true;
|
|
537
|
+
self._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
538
|
+
renderer.childrenOrderDirty = true;
|
|
539
|
+
};
|
|
540
|
+
self._textureLoaded = spriteFrame.textureLoaded();
|
|
541
|
+
if (self._textureLoaded) {
|
|
542
|
+
onResourceDataLoaded();
|
|
543
|
+
}
|
|
544
|
+
else {
|
|
545
|
+
this._loader.clear();
|
|
546
|
+
this._loader.once(spriteFrame, function () {
|
|
547
|
+
onResourceDataLoaded();
|
|
548
|
+
this.dispatchEvent('load');
|
|
549
|
+
}, this);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Sets the source blending function.
|
|
555
|
+
*
|
|
556
|
+
* @param blendFunc A structure with source and destination factor to specify pixel arithmetic. e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.
|
|
557
|
+
*/
|
|
558
|
+
setBlendFunc(blendFunc, dst) {
|
|
559
|
+
if (dst === undefined) {
|
|
560
|
+
this._blendFunc.src = blendFunc.src || BLEND_SRC;
|
|
561
|
+
this._blendFunc.dst = blendFunc.dst || BLEND_DST;
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
this._blendFunc.src = blendFunc || BLEND_SRC;
|
|
565
|
+
this._blendFunc.dst = dst || BLEND_DST;
|
|
566
|
+
}
|
|
567
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Returns the blending function that is currently being used.
|
|
571
|
+
*
|
|
572
|
+
* @return A BlendFunc structure with source and destination factor which specified pixel arithmetic.
|
|
573
|
+
*/
|
|
574
|
+
getBlendFunc() {
|
|
575
|
+
return new BlendFunc(this._blendFunc.src, this._blendFunc.dst);
|
|
576
|
+
}
|
|
577
|
+
setPreferredSize(preferredSize) {
|
|
578
|
+
if (!preferredSize || sizeEqualToSize(this._contentSize, preferredSize))
|
|
579
|
+
return;
|
|
580
|
+
this.setContentSize(preferredSize);
|
|
581
|
+
}
|
|
582
|
+
getPreferredSize() {
|
|
583
|
+
return this.getContentSize();
|
|
584
|
+
}
|
|
585
|
+
// overrides
|
|
586
|
+
setContentSize(width, height) {
|
|
587
|
+
if (height === undefined) {
|
|
588
|
+
height = width.height;
|
|
589
|
+
width = width.width;
|
|
590
|
+
}
|
|
591
|
+
if (width === this._contentSize.width && height === this._contentSize.height) {
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
super.setContentSize(width, height);
|
|
595
|
+
this._quadsDirty = true;
|
|
596
|
+
}
|
|
597
|
+
getContentSize() {
|
|
598
|
+
if (this._renderingType === Scale9Sprite.RenderingType.SIMPLE) {
|
|
599
|
+
if (this._spriteFrame) {
|
|
600
|
+
return this._spriteFrame._originalSize;
|
|
601
|
+
}
|
|
602
|
+
return Size(this._contentSize);
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
return Size(this._contentSize);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
_setWidth(value) {
|
|
609
|
+
super._setWidth(value);
|
|
610
|
+
this._quadsDirty = true;
|
|
611
|
+
}
|
|
612
|
+
_setHeight(value) {
|
|
613
|
+
super._setHeight(value);
|
|
614
|
+
this._quadsDirty = true;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Change the state of 9-slice sprite.
|
|
618
|
+
* @see `State`
|
|
619
|
+
* @param state A enum value in State.
|
|
620
|
+
*/
|
|
621
|
+
setState(state) {
|
|
622
|
+
this._brightState = state;
|
|
623
|
+
this._renderCmd.setState(state);
|
|
624
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Query the current bright state.
|
|
628
|
+
* @return @see `State`
|
|
629
|
+
*/
|
|
630
|
+
getState() {
|
|
631
|
+
return this._brightState;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* change the rendering type, could be simple or slice
|
|
635
|
+
* @return @see `RenderingType`
|
|
636
|
+
*/
|
|
637
|
+
setRenderingType(type) {
|
|
638
|
+
if (this._renderingType === type)
|
|
639
|
+
return;
|
|
640
|
+
this._renderingType = type;
|
|
641
|
+
this._quadsDirty = true;
|
|
642
|
+
this._uvsDirty = true;
|
|
643
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* get the rendering type, could be simple or slice
|
|
647
|
+
* @return @see `RenderingType`
|
|
648
|
+
*/
|
|
649
|
+
getRenderingType() {
|
|
650
|
+
return this._renderingType;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* change the left border of 9 slice sprite, it should be specified before trimmed.
|
|
654
|
+
* @param insetLeft left border.
|
|
655
|
+
*/
|
|
656
|
+
setInsetLeft(insetLeft) {
|
|
657
|
+
this._insetLeft = insetLeft;
|
|
658
|
+
this._quadsDirty = true;
|
|
659
|
+
this._uvsDirty = true;
|
|
660
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* get the left border of 9 slice sprite, the result is specified before trimmed.
|
|
664
|
+
* @return left border.
|
|
665
|
+
*/
|
|
666
|
+
getInsetLeft() {
|
|
667
|
+
return this._insetLeft;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* change the top border of 9 slice sprite, it should be specified before trimmed.
|
|
671
|
+
* @param insetTop top border.
|
|
672
|
+
*/
|
|
673
|
+
setInsetTop(insetTop) {
|
|
674
|
+
this._insetTop = insetTop;
|
|
675
|
+
this._quadsDirty = true;
|
|
676
|
+
this._uvsDirty = true;
|
|
677
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* get the top border of 9 slice sprite, the result is specified before trimmed.
|
|
681
|
+
* @return top border.
|
|
682
|
+
*/
|
|
683
|
+
getInsetTop() {
|
|
684
|
+
return this._insetTop;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* change the right border of 9 slice sprite, it should be specified before trimmed.
|
|
688
|
+
* @param insetRight right border.
|
|
689
|
+
*/
|
|
690
|
+
setInsetRight(insetRight) {
|
|
691
|
+
this._insetRight = insetRight;
|
|
692
|
+
this._quadsDirty = true;
|
|
693
|
+
this._uvsDirty = true;
|
|
694
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* get the right border of 9 slice sprite, the result is specified before trimmed.
|
|
698
|
+
* @return right border.
|
|
699
|
+
*/
|
|
700
|
+
getInsetRight() {
|
|
701
|
+
return this._insetRight;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* change the bottom border of 9 slice sprite, it should be specified before trimmed.
|
|
705
|
+
* @param insetBottom bottom border.
|
|
706
|
+
*/
|
|
707
|
+
setInsetBottom(insetBottom) {
|
|
708
|
+
this._insetBottom = insetBottom;
|
|
709
|
+
this._quadsDirty = true;
|
|
710
|
+
this._uvsDirty = true;
|
|
711
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.contentDirty);
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* get the bottom border of 9 slice sprite, the result is specified before trimmed.
|
|
715
|
+
* @return bottom border.
|
|
716
|
+
*/
|
|
717
|
+
getInsetBottom() {
|
|
718
|
+
return this._insetBottom;
|
|
719
|
+
}
|
|
720
|
+
_rebuildQuads() {
|
|
721
|
+
if (!this._spriteFrame || !this._spriteFrame._textureLoaded) {
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
this._updateBlendFunc();
|
|
725
|
+
this._isTriangle = false;
|
|
726
|
+
switch (this._renderingType) {
|
|
727
|
+
case Scale9Sprite.RenderingType.SIMPLE:
|
|
728
|
+
simpleQuadGenerator._rebuildQuads_base(this, this._spriteFrame, this._contentSize, this._isTrimmedContentSize);
|
|
729
|
+
break;
|
|
730
|
+
case Scale9Sprite.RenderingType.SLICED:
|
|
731
|
+
scale9QuadGenerator._rebuildQuads_base(this, this._spriteFrame, this._contentSize, this._insetLeft, this._insetRight, this._insetTop, this._insetBottom);
|
|
732
|
+
break;
|
|
733
|
+
default:
|
|
734
|
+
this._quadsDirty = false;
|
|
735
|
+
this._uvsDirty = false;
|
|
736
|
+
error('Can not generate quad');
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
this._quadsDirty = false;
|
|
740
|
+
this._uvsDirty = false;
|
|
741
|
+
}
|
|
742
|
+
_createRenderCmd() {
|
|
743
|
+
return new Scale9SpriteWebGLRenderCmd(this);
|
|
744
|
+
}
|
|
745
|
+
get preferredSize() {
|
|
746
|
+
return this.getPreferredSize();
|
|
747
|
+
}
|
|
748
|
+
set preferredSize(value) {
|
|
749
|
+
this.setPreferredSize(value);
|
|
750
|
+
}
|
|
751
|
+
get capInsets() {
|
|
752
|
+
return this.getCapInsets();
|
|
753
|
+
}
|
|
754
|
+
set capInsets(value) {
|
|
755
|
+
this.setCapInsets(value);
|
|
756
|
+
}
|
|
757
|
+
get insetLeft() {
|
|
758
|
+
return this.getInsetLeft();
|
|
759
|
+
}
|
|
760
|
+
set insetLeft(value) {
|
|
761
|
+
this.setInsetLeft(value);
|
|
762
|
+
}
|
|
763
|
+
get insetTop() {
|
|
764
|
+
return this.getInsetTop();
|
|
765
|
+
}
|
|
766
|
+
set insetTop(value) {
|
|
767
|
+
this.setInsetTop(value);
|
|
768
|
+
}
|
|
769
|
+
get insetRight() {
|
|
770
|
+
return this.getInsetRight();
|
|
771
|
+
}
|
|
772
|
+
set insetRight(value) {
|
|
773
|
+
this.setInsetRight(value);
|
|
774
|
+
}
|
|
775
|
+
get insetBottom() {
|
|
776
|
+
return this.getInsetBottom();
|
|
777
|
+
}
|
|
778
|
+
set insetBottom(value) {
|
|
779
|
+
this.setInsetBottom(value);
|
|
780
|
+
}
|
|
781
|
+
static POSITIONS_CENTRE = 0;
|
|
782
|
+
static POSITIONS_TOP = 1;
|
|
783
|
+
static POSITIONS_LEFT = 2;
|
|
784
|
+
static POSITIONS_RIGHT = 3;
|
|
785
|
+
static POSITIONS_BOTTOM = 4;
|
|
786
|
+
static POSITIONS_TOPRIGHT = 5;
|
|
787
|
+
static POSITIONS_TOPLEFT = 6;
|
|
788
|
+
static POSITIONS_BOTTOMRIGHT = 7;
|
|
789
|
+
static state = { NORMAL: 0, GRAY: 1 };
|
|
790
|
+
static RenderingType = {
|
|
791
|
+
/**
|
|
792
|
+
* @property {Number} SIMPLE
|
|
793
|
+
*/
|
|
794
|
+
SIMPLE: 0,
|
|
795
|
+
/**
|
|
796
|
+
* @property {Number} SLICED
|
|
797
|
+
*/
|
|
798
|
+
SLICED: 1,
|
|
799
|
+
};
|
|
800
|
+
/**
|
|
801
|
+
* create a Scale9Sprite with Sprite frame.
|
|
802
|
+
* @deprecated since v3.0, please use "new Scale9Sprite(spriteFrame, capInsets)" instead.
|
|
803
|
+
* @param {SpriteFrame} spriteFrame
|
|
804
|
+
* @param {Rect} capInsets
|
|
805
|
+
* @returns {Scale9Sprite}
|
|
806
|
+
*/
|
|
807
|
+
static createWithSpriteFrame(spriteFrame, capInsets) {
|
|
808
|
+
return new Scale9Sprite(spriteFrame, capInsets);
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* create a Scale9Sprite with a Sprite frame name
|
|
812
|
+
* @deprecated since v3.0, please use "new Scale9Sprite(spriteFrameName, capInsets)" instead.
|
|
813
|
+
* @param {string} spriteFrameName
|
|
814
|
+
* @param {Rect} capInsets
|
|
815
|
+
* @returns {Scale9Sprite}
|
|
816
|
+
*/
|
|
817
|
+
static createWithSpriteFrameName(spriteFrameName, capInsets) {
|
|
818
|
+
const sprite = new Scale9Sprite();
|
|
819
|
+
sprite.initWithSpriteFrameName(spriteFrameName, capInsets);
|
|
820
|
+
return sprite;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
// EventHelper.prototype.apply(Scale9Sprite.prototype)
|
|
824
|
+
// var RenderingType = Scale9Sprite.RenderingType
|
|
825
|
+
//# sourceMappingURL=UIScale9Sprite.js.map
|