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,818 @@
|
|
|
1
|
+
/* eslint-disable no-misleading-character-class */
|
|
2
|
+
import { renderer, view } from '../..';
|
|
3
|
+
import { _LogInfos, log } from '../../helper/Debugger';
|
|
4
|
+
import { Node } from '../base-nodes/Node';
|
|
5
|
+
import { p, Size } from '../cocoa/Geometry';
|
|
6
|
+
import { Color, color, contentScaleFactor } from '../platform';
|
|
7
|
+
import { FontDefinition } from '../platform/FontDefinition';
|
|
8
|
+
import { TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_LEFT, VERTICAL_TEXT_ALIGNMENT_TOP } from '../platform/Types';
|
|
9
|
+
import { Sprite } from '../sprites/Sprite';
|
|
10
|
+
import { LabelTTFWebGLRenderCmd } from './LabelTTFWebGLRenderCmd';
|
|
11
|
+
/**
|
|
12
|
+
* <p>LabelTTF is a subclass of TextureNode that knows how to render text labels with system font or a ttf font file<br/>
|
|
13
|
+
* All features from Sprite are valid in LabelTTF<br/>
|
|
14
|
+
* LabelTTF objects are slow for js-binding on mobile devices.<br/>
|
|
15
|
+
* Consider using LabelAtlas or LabelBMFont instead.<br/>
|
|
16
|
+
* You can create a LabelTTF from a font name, alignment, dimension and font size or a FontDefinition object.</p>
|
|
17
|
+
* @class
|
|
18
|
+
* @extends Sprite
|
|
19
|
+
*
|
|
20
|
+
* @param {String} text
|
|
21
|
+
* @param {String|FontDefinition} [fontName="Arial"]
|
|
22
|
+
* @param {Number} [fontSize=16]
|
|
23
|
+
* @param {Size} [dimensions=Size(0,0)]
|
|
24
|
+
* @param {Number} [hAlignment=TEXT_ALIGNMENT_LEFT]
|
|
25
|
+
* @param {Number} [vAlignment=VERTICAL_TEXT_ALIGNMENT_TOP]
|
|
26
|
+
* @example
|
|
27
|
+
* var myLabel = new LabelTTF('label text', 'Times New Roman', 32, Size(320,32), TEXT_ALIGNMENT_LEFT);
|
|
28
|
+
*
|
|
29
|
+
* var fontDef = new FontDefinition();
|
|
30
|
+
* fontDef.fontName = "Arial";
|
|
31
|
+
* fontDef.fontSize = "32";
|
|
32
|
+
* var myLabel = new LabelTTF('label text', fontDef);
|
|
33
|
+
*
|
|
34
|
+
* @property {String} string - Content string of label
|
|
35
|
+
* @property {Number} textAlign - Horizontal Alignment of label: TEXT_ALIGNMENT_LEFT|TEXT_ALIGNMENT_CENTER|TEXT_ALIGNMENT_RIGHT
|
|
36
|
+
* @property {Number} verticalAlign - Vertical Alignment of label: VERTICAL_TEXT_ALIGNMENT_TOP|VERTICAL_TEXT_ALIGNMENT_CENTER|VERTICAL_TEXT_ALIGNMENT_BOTTOM
|
|
37
|
+
* @property {Number} fontSize - Font size of label
|
|
38
|
+
* @property {String} fontName - Font name of label
|
|
39
|
+
* @property {String} font - The label font with a style string: e.g. "18px Verdana"
|
|
40
|
+
* @property {Number} boundingWidth - Width of the bounding box of label, the real content width is limited by boundingWidth
|
|
41
|
+
* @property {Number} boundingHeight - Height of the bounding box of label, the real content height is limited by boundingHeight
|
|
42
|
+
* @property {Color} fillStyle - The fill color
|
|
43
|
+
* @property {Color} strokeStyle - The stroke color
|
|
44
|
+
* @property {Number} lineWidth - The line width for stroke
|
|
45
|
+
* @property {Number} shadowOffsetX - The x axis offset of shadow
|
|
46
|
+
* @property {Number} shadowOffsetY - The y axis offset of shadow
|
|
47
|
+
* @property {Number} shadowOpacity - The opacity of shadow
|
|
48
|
+
* @property {Number} shadowBlur - The blur size of shadow
|
|
49
|
+
*/
|
|
50
|
+
export class LabelTTF extends Sprite {
|
|
51
|
+
static _wordRex = /([a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011‵-‷‹⁅]+|\S)/;
|
|
52
|
+
static _symbolRex = /^[!,.:;}\]%?>、‘“》»?。,!\u2010′-‴›‼⁆⁇-⁉]/;
|
|
53
|
+
static _lastWordRex = /([a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011‵-‷‹⁅]+|\S)$/;
|
|
54
|
+
static _lastEnglish = /[a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011‵-‷‹⁅]+$/;
|
|
55
|
+
static _firstEnglish = /^[a-zA-Z0-9\-¿¡«À-ÖØ-öø-ʯ\u0300-\u034e\u0350-\u036FͰ-ԯ\u2011‵-‷‹⁅]/;
|
|
56
|
+
static _textAlign = ['left', 'center', 'right'];
|
|
57
|
+
static _textBaseline = ['top', 'middle', 'bottom'];
|
|
58
|
+
//check the first character
|
|
59
|
+
static wrapInspection = true;
|
|
60
|
+
_dimensions = null;
|
|
61
|
+
_hAlignment = TEXT_ALIGNMENT_CENTER;
|
|
62
|
+
_vAlignment = VERTICAL_TEXT_ALIGNMENT_TOP;
|
|
63
|
+
_fontName = null;
|
|
64
|
+
_fontSize = 0.0;
|
|
65
|
+
_string = '';
|
|
66
|
+
_originalText = null;
|
|
67
|
+
_onCacheCanvasMode = true;
|
|
68
|
+
// font shadow
|
|
69
|
+
_shadowEnabled = false;
|
|
70
|
+
_shadowOffset = null;
|
|
71
|
+
_shadowOpacity = 0;
|
|
72
|
+
_shadowBlur = 0;
|
|
73
|
+
_shadowColor = null;
|
|
74
|
+
// font stroke
|
|
75
|
+
_strokeEnabled = false;
|
|
76
|
+
_strokeColor = null;
|
|
77
|
+
_strokeSize = 0;
|
|
78
|
+
_strokeShadowOffsetX = 0;
|
|
79
|
+
_strokeShadowOffsetY = 0;
|
|
80
|
+
_needUpdateTexture = false;
|
|
81
|
+
_lineWidths = null;
|
|
82
|
+
_className = 'LabelTTF';
|
|
83
|
+
//for web
|
|
84
|
+
_fontStyle = 'normal';
|
|
85
|
+
_fontWeight = 'normal';
|
|
86
|
+
_lineHeight = 'normal';
|
|
87
|
+
/**
|
|
88
|
+
* Initializes the LabelTTF with a font name, alignment, dimension and font size, do not call it by yourself,
|
|
89
|
+
* you should pass the correct arguments in constructor to initialize the label.
|
|
90
|
+
* @param {String} label string
|
|
91
|
+
* @param {String} fontName
|
|
92
|
+
* @param {Number} fontSize
|
|
93
|
+
* @param {Size} [dimensions=]
|
|
94
|
+
* @param {Number} [hAlignment=]
|
|
95
|
+
* @param {Number} [vAlignment=]
|
|
96
|
+
* @return {Boolean} return false on error
|
|
97
|
+
*/
|
|
98
|
+
initWithString(label = '', fontName = 'Arial', fontSize = 16, dimensions = Size(0, 0 /*fontSize*/), hAlignment = TEXT_ALIGNMENT_LEFT, vAlignment = VERTICAL_TEXT_ALIGNMENT_TOP) {
|
|
99
|
+
this._opacityModifyRGB = false;
|
|
100
|
+
this._dimensions = Size(dimensions.width, dimensions.height);
|
|
101
|
+
this._fontName = fontName;
|
|
102
|
+
this._hAlignment = hAlignment;
|
|
103
|
+
this._vAlignment = vAlignment;
|
|
104
|
+
this._fontSize = fontSize;
|
|
105
|
+
this._renderCmd._setFontStyle(this._fontName, fontSize, this._fontStyle, this._fontWeight);
|
|
106
|
+
this.setString(label);
|
|
107
|
+
this._renderCmd._setColorsString();
|
|
108
|
+
this._renderCmd._updateTexture();
|
|
109
|
+
this._setUpdateTextureDirty();
|
|
110
|
+
// Needed for high dpi text.
|
|
111
|
+
// In order to render it crisp, we request devicePixelRatio times the
|
|
112
|
+
// font size and scale it down 1/devicePixelRatio.
|
|
113
|
+
this._scaleX = this._scaleY = 1 / view.getDevicePixelRatio();
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
_setUpdateTextureDirty() {
|
|
117
|
+
this._needUpdateTexture = true;
|
|
118
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.textDirty);
|
|
119
|
+
}
|
|
120
|
+
constructor(text, fontName, fontSize, dimensions, hAlignment, vAlignment) {
|
|
121
|
+
super();
|
|
122
|
+
this._dimensions = Size(0, 0);
|
|
123
|
+
this._hAlignment = TEXT_ALIGNMENT_LEFT;
|
|
124
|
+
this._vAlignment = VERTICAL_TEXT_ALIGNMENT_TOP;
|
|
125
|
+
this._opacityModifyRGB = false;
|
|
126
|
+
this._fontName = 'Arial';
|
|
127
|
+
this._shadowEnabled = false;
|
|
128
|
+
this._shadowOffset = p(0, 0);
|
|
129
|
+
this._shadowOpacity = 0;
|
|
130
|
+
this._shadowBlur = 0;
|
|
131
|
+
this._strokeEnabled = false;
|
|
132
|
+
this._strokeColor = color(255, 255, 255, 255);
|
|
133
|
+
this._strokeSize = 0;
|
|
134
|
+
this._textFillColor = color(255, 255, 255, 255);
|
|
135
|
+
this._strokeShadowOffsetX = 0;
|
|
136
|
+
this._strokeShadowOffsetY = 0;
|
|
137
|
+
this._needUpdateTexture = false;
|
|
138
|
+
this._lineWidths = [];
|
|
139
|
+
// console.log('LabelTTF constructor', this._textFillColor)
|
|
140
|
+
this._renderCmd._setColorsString();
|
|
141
|
+
this._textureLoaded = true;
|
|
142
|
+
if (fontName && fontName instanceof FontDefinition) {
|
|
143
|
+
this.initWithStringAndTextDefinition(text, fontName);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.initWithString(text, fontName, fontSize, dimensions, hAlignment, vAlignment);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
init() {
|
|
150
|
+
this._textFillColor = color(255, 255, 255, 255);
|
|
151
|
+
this._strokeColor = color(255, 255, 255, 255);
|
|
152
|
+
return this.initWithString(' ', this._fontName, this._fontSize);
|
|
153
|
+
}
|
|
154
|
+
description() {
|
|
155
|
+
return `<LabelTTF | FontName =${this._fontName} FontSize = ${this._fontSize.toFixed(1)}>`;
|
|
156
|
+
}
|
|
157
|
+
getLineHeight() {
|
|
158
|
+
return !this._lineHeight || this._lineHeight.charAt
|
|
159
|
+
? this._renderCmd._getFontClientHeight()
|
|
160
|
+
: this._lineHeight || this._renderCmd._getFontClientHeight();
|
|
161
|
+
}
|
|
162
|
+
setLineHeight(lineHeight) {
|
|
163
|
+
this._lineHeight = lineHeight;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Returns the text of the label
|
|
167
|
+
* @return {String}
|
|
168
|
+
*/
|
|
169
|
+
getString() {
|
|
170
|
+
return this._string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Returns Horizontal Alignment of LabelTTF
|
|
174
|
+
* @return {TEXT_ALIGNMENT_LEFT|TEXT_ALIGNMENT_CENTER|TEXT_ALIGNMENT_RIGHT}
|
|
175
|
+
*/
|
|
176
|
+
getHorizontalAlignment() {
|
|
177
|
+
return this._hAlignment;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Returns Vertical Alignment of LabelTTF
|
|
181
|
+
* @return {VERTICAL_TEXT_ALIGNMENT_TOP|VERTICAL_TEXT_ALIGNMENT_CENTER|VERTICAL_TEXT_ALIGNMENT_BOTTOM}
|
|
182
|
+
*/
|
|
183
|
+
getVerticalAlignment() {
|
|
184
|
+
return this._vAlignment;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Returns the dimensions of LabelTTF, the dimension is the maximum size of the label, set it so that label will automatically change lines when necessary.
|
|
188
|
+
* @see LabelTTF#setDimensions, LabelTTF#boundingWidth and LabelTTF#boundingHeight
|
|
189
|
+
* @return {Size}
|
|
190
|
+
*/
|
|
191
|
+
getDimensions() {
|
|
192
|
+
return Size(this._dimensions);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Returns font size of LabelTTF
|
|
196
|
+
* @return {Number}
|
|
197
|
+
*/
|
|
198
|
+
getFontSize() {
|
|
199
|
+
return this._fontSize;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Returns font name of LabelTTF
|
|
203
|
+
* @return {String}
|
|
204
|
+
*/
|
|
205
|
+
getFontName() {
|
|
206
|
+
return this._fontName;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Initializes the CCLabelTTF with a font name, alignment, dimension and font size, do not call it by yourself, you should pass the correct arguments in constructor to initialize the label.
|
|
210
|
+
* @param {String} text
|
|
211
|
+
* @param {FontDefinition} textDefinition
|
|
212
|
+
* @return {Boolean}
|
|
213
|
+
*/
|
|
214
|
+
initWithStringAndTextDefinition(text, textDefinition) {
|
|
215
|
+
// prepare everything needed to render the label
|
|
216
|
+
this._updateWithTextDefinition(textDefinition, false);
|
|
217
|
+
// set the string
|
|
218
|
+
this.setString(text);
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Sets the text definition used by this label
|
|
223
|
+
* @param {FontDefinition} theDefinition
|
|
224
|
+
*/
|
|
225
|
+
setTextDefinition(theDefinition) {
|
|
226
|
+
if (theDefinition)
|
|
227
|
+
this._updateWithTextDefinition(theDefinition, true);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Extract the text definition used by this label
|
|
231
|
+
* @return {FontDefinition}
|
|
232
|
+
*/
|
|
233
|
+
getTextDefinition() {
|
|
234
|
+
return this._prepareTextDefinition(false);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Enable or disable shadow for the label
|
|
238
|
+
* @param {Color | Number} a Color or The x axis offset of the shadow
|
|
239
|
+
* @param {Size | Number} b Size or The y axis offset of the shadow
|
|
240
|
+
* @param {Number} c The blur size of the shadow or The opacity of the shadow (0 to 1)
|
|
241
|
+
* @param {null | Number} d Null or The blur size of the shadow
|
|
242
|
+
* @example
|
|
243
|
+
* old:
|
|
244
|
+
* labelttf.enableShadow(shadowOffsetX, shadowOffsetY, shadowOpacity, shadowBlur);
|
|
245
|
+
* new:
|
|
246
|
+
* labelttf.enableShadow(shadowColor, offset, blurRadius);
|
|
247
|
+
*/
|
|
248
|
+
enableShadow(a, b, c, d) {
|
|
249
|
+
if (a.r != null && a.g != null && a.b != null && a.a != null) {
|
|
250
|
+
this._enableShadow(a, b, c);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this._enableShadowNoneColor(a, b, c, d);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
_enableShadowNoneColor(shadowOffsetX, shadowOffsetY, shadowOpacity, shadowBlur) {
|
|
257
|
+
shadowOpacity = shadowOpacity || 0.5;
|
|
258
|
+
if (false === this._shadowEnabled)
|
|
259
|
+
this._shadowEnabled = true;
|
|
260
|
+
const locShadowOffset = this._shadowOffset;
|
|
261
|
+
if ((locShadowOffset && locShadowOffset.x !== shadowOffsetX) || locShadowOffset._y !== shadowOffsetY) {
|
|
262
|
+
locShadowOffset.x = shadowOffsetX;
|
|
263
|
+
locShadowOffset.y = shadowOffsetY;
|
|
264
|
+
}
|
|
265
|
+
if (this._shadowOpacity !== shadowOpacity) {
|
|
266
|
+
this._shadowOpacity = shadowOpacity;
|
|
267
|
+
}
|
|
268
|
+
this._renderCmd._setColorsString();
|
|
269
|
+
if (this._shadowBlur !== shadowBlur)
|
|
270
|
+
this._shadowBlur = shadowBlur;
|
|
271
|
+
this._setUpdateTextureDirty();
|
|
272
|
+
}
|
|
273
|
+
_enableShadow(shadowColor, offset, blurRadius) {
|
|
274
|
+
if (!this._shadowColor) {
|
|
275
|
+
this._shadowColor = color(255, 255, 255, 128);
|
|
276
|
+
}
|
|
277
|
+
this._shadowColor.r = shadowColor.r;
|
|
278
|
+
this._shadowColor.g = shadowColor.g;
|
|
279
|
+
this._shadowColor.b = shadowColor.b;
|
|
280
|
+
const x = offset.width || offset.x || 0;
|
|
281
|
+
const y = offset.height || offset.y || 0;
|
|
282
|
+
const a = shadowColor.a != null ? shadowColor.a / 255 : 0.5;
|
|
283
|
+
const b = blurRadius;
|
|
284
|
+
this._enableShadowNoneColor(x, y, a, b);
|
|
285
|
+
}
|
|
286
|
+
_getShadowOffsetX() {
|
|
287
|
+
return this._shadowOffset.x;
|
|
288
|
+
}
|
|
289
|
+
_setShadowOffsetX(x) {
|
|
290
|
+
if (false === this._shadowEnabled)
|
|
291
|
+
this._shadowEnabled = true;
|
|
292
|
+
if (this._shadowOffset.x !== x) {
|
|
293
|
+
this._shadowOffset.x = x;
|
|
294
|
+
this._setUpdateTextureDirty();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
_getShadowOffsetY() {
|
|
298
|
+
return this._shadowOffset._y;
|
|
299
|
+
}
|
|
300
|
+
_setShadowOffsetY(y) {
|
|
301
|
+
if (false === this._shadowEnabled)
|
|
302
|
+
this._shadowEnabled = true;
|
|
303
|
+
if (this._shadowOffset._y !== y) {
|
|
304
|
+
this._shadowOffset._y = y;
|
|
305
|
+
this._setUpdateTextureDirty();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
_getShadowOffset() {
|
|
309
|
+
return p(this._shadowOffset.x, this._shadowOffset.y);
|
|
310
|
+
}
|
|
311
|
+
_setShadowOffset(offset) {
|
|
312
|
+
if (false === this._shadowEnabled)
|
|
313
|
+
this._shadowEnabled = true;
|
|
314
|
+
if (this._shadowOffset.x !== offset.x || this._shadowOffset.y !== offset.y) {
|
|
315
|
+
this._shadowOffset.x = offset.x;
|
|
316
|
+
this._shadowOffset.y = offset.y;
|
|
317
|
+
this._setUpdateTextureDirty();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
_getShadowOpacity() {
|
|
321
|
+
return this._shadowOpacity;
|
|
322
|
+
}
|
|
323
|
+
_setShadowOpacity(shadowOpacity) {
|
|
324
|
+
if (false === this._shadowEnabled)
|
|
325
|
+
this._shadowEnabled = true;
|
|
326
|
+
if (this._shadowOpacity !== shadowOpacity) {
|
|
327
|
+
this._shadowOpacity = shadowOpacity;
|
|
328
|
+
this._renderCmd._setColorsString();
|
|
329
|
+
this._setUpdateTextureDirty();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
_getShadowBlur() {
|
|
333
|
+
return this._shadowBlur;
|
|
334
|
+
}
|
|
335
|
+
_setShadowBlur(shadowBlur) {
|
|
336
|
+
if (false === this._shadowEnabled)
|
|
337
|
+
this._shadowEnabled = true;
|
|
338
|
+
if (this._shadowBlur !== shadowBlur) {
|
|
339
|
+
this._shadowBlur = shadowBlur;
|
|
340
|
+
this._setUpdateTextureDirty();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Disable shadow rendering
|
|
345
|
+
*/
|
|
346
|
+
disableShadow() {
|
|
347
|
+
if (this._shadowEnabled) {
|
|
348
|
+
this._shadowEnabled = false;
|
|
349
|
+
this._setUpdateTextureDirty();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Enable label stroke with stroke parameters
|
|
354
|
+
* @param {Color} strokeColor The color of stroke
|
|
355
|
+
* @param {Number} strokeSize The size of stroke
|
|
356
|
+
*/
|
|
357
|
+
enableStroke(strokeColor, strokeSize) {
|
|
358
|
+
if (this._strokeEnabled === false)
|
|
359
|
+
this._strokeEnabled = true;
|
|
360
|
+
const locStrokeColor = this._strokeColor;
|
|
361
|
+
if (locStrokeColor.r !== strokeColor.r || locStrokeColor.g !== strokeColor.g || locStrokeColor.b !== strokeColor.b) {
|
|
362
|
+
locStrokeColor.r = strokeColor.r;
|
|
363
|
+
locStrokeColor.g = strokeColor.g;
|
|
364
|
+
locStrokeColor.b = strokeColor.b;
|
|
365
|
+
this._renderCmd._setColorsString();
|
|
366
|
+
}
|
|
367
|
+
if (this._strokeSize !== strokeSize)
|
|
368
|
+
this._strokeSize = strokeSize || 0;
|
|
369
|
+
this._setUpdateTextureDirty();
|
|
370
|
+
}
|
|
371
|
+
_getStrokeStyle() {
|
|
372
|
+
return this._strokeColor;
|
|
373
|
+
}
|
|
374
|
+
_setStrokeStyle(strokeStyle) {
|
|
375
|
+
if (this._strokeEnabled === false)
|
|
376
|
+
this._strokeEnabled = true;
|
|
377
|
+
const locStrokeColor = this._strokeColor;
|
|
378
|
+
if (locStrokeColor.r !== strokeStyle.r || locStrokeColor.g !== strokeStyle.g || locStrokeColor.b !== strokeStyle.b) {
|
|
379
|
+
locStrokeColor.r = strokeStyle.r;
|
|
380
|
+
locStrokeColor.g = strokeStyle.g;
|
|
381
|
+
locStrokeColor.b = strokeStyle.b;
|
|
382
|
+
this._renderCmd._setColorsString();
|
|
383
|
+
this._setUpdateTextureDirty();
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
_getLineWidth() {
|
|
387
|
+
return this._strokeSize;
|
|
388
|
+
}
|
|
389
|
+
_setLineWidth(lineWidth) {
|
|
390
|
+
if (this._strokeEnabled === false)
|
|
391
|
+
this._strokeEnabled = true;
|
|
392
|
+
if (this._strokeSize !== lineWidth) {
|
|
393
|
+
this._strokeSize = lineWidth || 0;
|
|
394
|
+
this._setUpdateTextureDirty();
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Disable label stroke
|
|
399
|
+
*/
|
|
400
|
+
disableStroke() {
|
|
401
|
+
if (this._strokeEnabled) {
|
|
402
|
+
this._strokeEnabled = false;
|
|
403
|
+
this._setUpdateTextureDirty();
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Sets the text fill color
|
|
408
|
+
* @function
|
|
409
|
+
* @param {Color} fillColor The fill color of the label
|
|
410
|
+
*/
|
|
411
|
+
setFontFillColor(fillColor) {
|
|
412
|
+
const locTextFillColor = this._textFillColor;
|
|
413
|
+
if (locTextFillColor.r !== fillColor.r || locTextFillColor.g !== fillColor.g || locTextFillColor.b !== fillColor.b) {
|
|
414
|
+
this._textFillColor.r = fillColor.r;
|
|
415
|
+
this._textFillColor.g = fillColor.g;
|
|
416
|
+
this._textFillColor.b = fillColor.b;
|
|
417
|
+
this._renderCmd._setColorsString();
|
|
418
|
+
this._needUpdateTexture = true;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
_getFillStyle() {
|
|
422
|
+
return this._textFillColor;
|
|
423
|
+
}
|
|
424
|
+
//set the text definition for this label
|
|
425
|
+
_updateWithTextDefinition(textDefinition, mustUpdateTexture) {
|
|
426
|
+
if (textDefinition.fontDimensions) {
|
|
427
|
+
this._dimensions.width = textDefinition.boundingWidth;
|
|
428
|
+
this._dimensions.height = textDefinition.boundingHeight;
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
this._dimensions.width = 0;
|
|
432
|
+
this._dimensions.height = 0;
|
|
433
|
+
}
|
|
434
|
+
this._hAlignment = textDefinition.textAlign;
|
|
435
|
+
this._vAlignment = textDefinition.verticalAlign;
|
|
436
|
+
this._fontName = textDefinition.fontName;
|
|
437
|
+
this._fontSize = textDefinition.fontSize || 12;
|
|
438
|
+
if (textDefinition.lineHeight)
|
|
439
|
+
this._lineHeight = textDefinition.lineHeight;
|
|
440
|
+
else
|
|
441
|
+
this._lineHeight = this._fontSize;
|
|
442
|
+
this._renderCmd._setFontStyle(textDefinition);
|
|
443
|
+
// shadow
|
|
444
|
+
if (textDefinition.shadowEnabled)
|
|
445
|
+
this.enableShadow(textDefinition.shadowOffsetX, textDefinition.shadowOffsetY, textDefinition.shadowOpacity, textDefinition.shadowBlur);
|
|
446
|
+
// stroke
|
|
447
|
+
if (textDefinition.strokeEnabled)
|
|
448
|
+
this.enableStroke(textDefinition.strokeStyle, textDefinition.lineWidth);
|
|
449
|
+
// fill color
|
|
450
|
+
this.setFontFillColor(textDefinition.fillStyle);
|
|
451
|
+
if (mustUpdateTexture)
|
|
452
|
+
this._renderCmd._updateTexture();
|
|
453
|
+
const flags = Node._dirtyFlags;
|
|
454
|
+
this._renderCmd.setDirtyFlag(flags.colorDirty | flags.opacityDirty | flags.textDirty);
|
|
455
|
+
}
|
|
456
|
+
_prepareTextDefinition(adjustForResolution) {
|
|
457
|
+
const texDef = new FontDefinition();
|
|
458
|
+
if (adjustForResolution) {
|
|
459
|
+
texDef.fontSize = this._fontSize;
|
|
460
|
+
texDef.boundingWidth = contentScaleFactor() * this._dimensions.width;
|
|
461
|
+
texDef.boundingHeight = contentScaleFactor() * this._dimensions.height;
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
texDef.fontSize = this._fontSize;
|
|
465
|
+
texDef.boundingWidth = this._dimensions.width;
|
|
466
|
+
texDef.boundingHeight = this._dimensions.height;
|
|
467
|
+
}
|
|
468
|
+
texDef.fontName = this._fontName;
|
|
469
|
+
texDef.textAlign = this._hAlignment;
|
|
470
|
+
texDef.verticalAlign = this._vAlignment;
|
|
471
|
+
// stroke
|
|
472
|
+
if (this._strokeEnabled) {
|
|
473
|
+
texDef.strokeEnabled = true;
|
|
474
|
+
const locStrokeColor = this._strokeColor;
|
|
475
|
+
texDef.strokeStyle = color(locStrokeColor.r, locStrokeColor.g, locStrokeColor.b);
|
|
476
|
+
texDef.lineWidth = this._strokeSize;
|
|
477
|
+
}
|
|
478
|
+
else
|
|
479
|
+
texDef.strokeEnabled = false;
|
|
480
|
+
// shadow
|
|
481
|
+
if (this._shadowEnabled) {
|
|
482
|
+
texDef.shadowEnabled = true;
|
|
483
|
+
texDef.shadowBlur = this._shadowBlur;
|
|
484
|
+
texDef.shadowOpacity = this._shadowOpacity;
|
|
485
|
+
texDef.shadowOffsetX = (adjustForResolution ? contentScaleFactor() : 1) * this._shadowOffset.x;
|
|
486
|
+
texDef.shadowOffsetY = (adjustForResolution ? contentScaleFactor() : 1) * this._shadowOffset.y;
|
|
487
|
+
}
|
|
488
|
+
else
|
|
489
|
+
texDef._shadowEnabled = false;
|
|
490
|
+
// text tint
|
|
491
|
+
const locTextFillColor = this._textFillColor;
|
|
492
|
+
texDef.fillStyle = color(locTextFillColor.r, locTextFillColor.g, locTextFillColor.b);
|
|
493
|
+
return texDef;
|
|
494
|
+
}
|
|
495
|
+
/*
|
|
496
|
+
* BEGIN SCALE METHODS
|
|
497
|
+
*
|
|
498
|
+
* In order to make the value of scaleX and scaleY consistent across
|
|
499
|
+
* screens, we provide patched versions that return the same values as if
|
|
500
|
+
* the screen was not HiDPI.
|
|
501
|
+
*/
|
|
502
|
+
/**
|
|
503
|
+
* Returns the scale factor of the node.
|
|
504
|
+
* @warning: Assertion will fail when _scaleX != _scaleY.
|
|
505
|
+
* @function
|
|
506
|
+
* @return {Number} The scale factor
|
|
507
|
+
*/
|
|
508
|
+
getScale() {
|
|
509
|
+
if (this._scaleX !== this._scaleY)
|
|
510
|
+
log(_LogInfos.Node_getScale);
|
|
511
|
+
return this._scaleX * view.getDevicePixelRatio();
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Sets the scale factor of the node. 1.0 is the default scale factor. This function can modify the X and Y scale at the same time.
|
|
515
|
+
* @function
|
|
516
|
+
* @param {Number} scale or scaleX value
|
|
517
|
+
* @param {Number} [scaleY=]
|
|
518
|
+
*/
|
|
519
|
+
setScale(scale, scaleY) {
|
|
520
|
+
const ratio = view.getDevicePixelRatio();
|
|
521
|
+
this._scaleX = scale / ratio;
|
|
522
|
+
this._scaleY = (scaleY || scaleY === 0 ? scaleY : scale) / ratio;
|
|
523
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.transformDirty);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Returns the scale factor on X axis of this node
|
|
527
|
+
* @function
|
|
528
|
+
* @return {Number} The scale factor on X axis.
|
|
529
|
+
*/
|
|
530
|
+
getScaleX() {
|
|
531
|
+
return this._scaleX * view.getDevicePixelRatio();
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* <p>
|
|
535
|
+
* Changes the scale factor on X axis of this node <br/>
|
|
536
|
+
* The default value is 1.0 if you haven't changed it before
|
|
537
|
+
* </p>
|
|
538
|
+
* @function
|
|
539
|
+
* @param {Number} newScaleX The scale factor on X axis.
|
|
540
|
+
*/
|
|
541
|
+
setScaleX(newScaleX) {
|
|
542
|
+
this._scaleX = newScaleX / view.getDevicePixelRatio();
|
|
543
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.transformDirty);
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Returns the scale factor on Y axis of this node
|
|
547
|
+
* @function
|
|
548
|
+
* @return {Number} The scale factor on Y axis.
|
|
549
|
+
*/
|
|
550
|
+
getScaleY() {
|
|
551
|
+
return this._scaleY * view.getDevicePixelRatio();
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* <p>
|
|
555
|
+
* Changes the scale factor on Y axis of this node <br/>
|
|
556
|
+
* The Default value is 1.0 if you haven't changed it before.
|
|
557
|
+
* </p>
|
|
558
|
+
* @function
|
|
559
|
+
* @param {Number} newScaleY The scale factor on Y axis.
|
|
560
|
+
*/
|
|
561
|
+
setScaleY(newScaleY) {
|
|
562
|
+
this._scaleY = newScaleY / view.getDevicePixelRatio();
|
|
563
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.transformDirty);
|
|
564
|
+
}
|
|
565
|
+
/*
|
|
566
|
+
* END SCALE METHODS
|
|
567
|
+
*/
|
|
568
|
+
/**
|
|
569
|
+
* Changes the text content of the label
|
|
570
|
+
* @warning Changing the string is as expensive as creating a new LabelTTF. To obtain better performance use LabelAtlas
|
|
571
|
+
* @param {String} text Text content for the label
|
|
572
|
+
*/
|
|
573
|
+
setString(text = '') {
|
|
574
|
+
if (this._originalText !== text) {
|
|
575
|
+
this._originalText = `${text}`;
|
|
576
|
+
this._updateString();
|
|
577
|
+
// Force update
|
|
578
|
+
this._setUpdateTextureDirty();
|
|
579
|
+
this._renderCmd.setDirtyFlag(Node._dirtyFlags.transformDirty);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
_updateString() {
|
|
583
|
+
if ((!this._string || this._string === '') && this._string !== this._originalText)
|
|
584
|
+
renderer.childrenOrderDirty = true;
|
|
585
|
+
this._string = this._originalText;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Sets Horizontal Alignment of LabelTTF
|
|
589
|
+
* @param {TEXT_ALIGNMENT_LEFT|TEXT_ALIGNMENT_CENTER|TEXT_ALIGNMENT_RIGHT} alignment Horizontal Alignment
|
|
590
|
+
*/
|
|
591
|
+
setHorizontalAlignment(alignment) {
|
|
592
|
+
if (alignment !== this._hAlignment) {
|
|
593
|
+
this._hAlignment = alignment;
|
|
594
|
+
// Force update
|
|
595
|
+
this._setUpdateTextureDirty();
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Sets Vertical Alignment of LabelTTF
|
|
600
|
+
* @param {VERTICAL_TEXT_ALIGNMENT_TOP|VERTICAL_TEXT_ALIGNMENT_CENTER|VERTICAL_TEXT_ALIGNMENT_BOTTOM} verticalAlignment
|
|
601
|
+
*/
|
|
602
|
+
setVerticalAlignment(verticalAlignment) {
|
|
603
|
+
if (verticalAlignment !== this._vAlignment) {
|
|
604
|
+
this._vAlignment = verticalAlignment;
|
|
605
|
+
// Force update
|
|
606
|
+
this._setUpdateTextureDirty();
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Set Dimensions of LabelTTF, the dimension is the maximum size of the label, set it so that label will automatically change lines when necessary.
|
|
611
|
+
* @param {Size|Number} dim dimensions or width of dimensions
|
|
612
|
+
* @param {Number} [height] height of dimensions
|
|
613
|
+
*/
|
|
614
|
+
setDimensions(dim, height) {
|
|
615
|
+
let width;
|
|
616
|
+
if (height === undefined) {
|
|
617
|
+
width = dim.width;
|
|
618
|
+
height = dim.height;
|
|
619
|
+
}
|
|
620
|
+
else
|
|
621
|
+
width = dim;
|
|
622
|
+
if (width !== this._dimensions.width || height !== this._dimensions.height) {
|
|
623
|
+
this._dimensions.width = width;
|
|
624
|
+
this._dimensions.height = height;
|
|
625
|
+
this._updateString();
|
|
626
|
+
// Force update
|
|
627
|
+
this._setUpdateTextureDirty();
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
_getBoundingWidth() {
|
|
631
|
+
return this._dimensions.width;
|
|
632
|
+
}
|
|
633
|
+
_setBoundingWidth(width) {
|
|
634
|
+
if (width !== this._dimensions.width) {
|
|
635
|
+
this._dimensions.width = width;
|
|
636
|
+
this._updateString();
|
|
637
|
+
// Force update
|
|
638
|
+
this._setUpdateTextureDirty();
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
_getBoundingHeight() {
|
|
642
|
+
return this._dimensions.height;
|
|
643
|
+
}
|
|
644
|
+
_setBoundingHeight(height) {
|
|
645
|
+
if (height !== this._dimensions.height) {
|
|
646
|
+
this._dimensions.height = height;
|
|
647
|
+
this._updateString();
|
|
648
|
+
// Force update
|
|
649
|
+
this._setUpdateTextureDirty();
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Sets font size of LabelTTF
|
|
654
|
+
* @param {Number} fontSize
|
|
655
|
+
*/
|
|
656
|
+
setFontSize(fontSize) {
|
|
657
|
+
if (this._fontSize !== fontSize) {
|
|
658
|
+
this._fontSize = fontSize;
|
|
659
|
+
this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
|
|
660
|
+
// Force update
|
|
661
|
+
this._setUpdateTextureDirty();
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* Sets font name of LabelTTF
|
|
666
|
+
* @param {String} fontName
|
|
667
|
+
*/
|
|
668
|
+
setFontName(fontName) {
|
|
669
|
+
if (this._fontName && this._fontName !== fontName) {
|
|
670
|
+
this._fontName = fontName;
|
|
671
|
+
this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
|
|
672
|
+
// Force update
|
|
673
|
+
this._setUpdateTextureDirty();
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
_getFont() {
|
|
677
|
+
return this._renderCmd._getFontStyle();
|
|
678
|
+
}
|
|
679
|
+
_setFont(fontStyle) {
|
|
680
|
+
const res = LabelTTF._fontStyleRE.exec(fontStyle);
|
|
681
|
+
if (res) {
|
|
682
|
+
this._fontSize = parseInt(res[1]);
|
|
683
|
+
this._fontName = res[2];
|
|
684
|
+
this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
|
|
685
|
+
// Force update
|
|
686
|
+
this._setUpdateTextureDirty();
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Returns the actual content size of the label, the content size is the real size that the label occupied while dimension is the outer bounding box of the label.
|
|
691
|
+
* @returns {Size} The content size
|
|
692
|
+
*/
|
|
693
|
+
getContentSize() {
|
|
694
|
+
if (this._needUpdateTexture)
|
|
695
|
+
this._renderCmd._updateTTF();
|
|
696
|
+
const ratio = view.getDevicePixelRatio();
|
|
697
|
+
return Size(this._contentSize.width / ratio, this._contentSize.height / ratio);
|
|
698
|
+
}
|
|
699
|
+
_getWidth() {
|
|
700
|
+
if (this._needUpdateTexture)
|
|
701
|
+
this._renderCmd._updateTTF();
|
|
702
|
+
return this._contentSize.width / view.getDevicePixelRatio();
|
|
703
|
+
}
|
|
704
|
+
_getHeight() {
|
|
705
|
+
if (this._needUpdateTexture)
|
|
706
|
+
this._renderCmd._updateTTF();
|
|
707
|
+
return this._contentSize.height / view.getDevicePixelRatio();
|
|
708
|
+
}
|
|
709
|
+
setTextureRect(rect, rotated, untrimmedSize) {
|
|
710
|
+
this._rectRotated = rotated || false;
|
|
711
|
+
this.setContentSize(untrimmedSize || rect);
|
|
712
|
+
const locRect = this._rect;
|
|
713
|
+
locRect.x = rect.x;
|
|
714
|
+
locRect.y = rect.y;
|
|
715
|
+
locRect.width = rect.width;
|
|
716
|
+
locRect.height = rect.height;
|
|
717
|
+
this._renderCmd._setTextureCoords(rect, false);
|
|
718
|
+
let relativeOffsetX = this._unflippedOffsetPositionFromCenter.x, relativeOffsetY = this._unflippedOffsetPositionFromCenter.y;
|
|
719
|
+
if (this._flippedX)
|
|
720
|
+
relativeOffsetX = -relativeOffsetX;
|
|
721
|
+
if (this._flippedY)
|
|
722
|
+
relativeOffsetY = -relativeOffsetY;
|
|
723
|
+
this._offsetPosition.x = relativeOffsetX + (rect.width - locRect.width) / 2;
|
|
724
|
+
this._offsetPosition.y = relativeOffsetY + (rect.height - locRect.height) / 2;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* set Target to draw on
|
|
728
|
+
* @param boolean onCanvas
|
|
729
|
+
*/
|
|
730
|
+
setDrawMode(onCacheMode) {
|
|
731
|
+
this._onCacheCanvasMode = onCacheMode;
|
|
732
|
+
}
|
|
733
|
+
_createRenderCmd() {
|
|
734
|
+
return new LabelTTFWebGLRenderCmd(this);
|
|
735
|
+
}
|
|
736
|
+
//For web only
|
|
737
|
+
_setFontStyle(fontStyle) {
|
|
738
|
+
if (this._fontStyle !== fontStyle) {
|
|
739
|
+
this._fontStyle = fontStyle;
|
|
740
|
+
this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
|
|
741
|
+
this._setUpdateTextureDirty();
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
_getFontStyle() {
|
|
745
|
+
return this._fontStyle;
|
|
746
|
+
}
|
|
747
|
+
_setFontWeight(fontWeight) {
|
|
748
|
+
if (this._fontWeight !== fontWeight) {
|
|
749
|
+
this._fontWeight = fontWeight;
|
|
750
|
+
this._renderCmd._setFontStyle(this._fontName, this._fontSize, this._fontStyle, this._fontWeight);
|
|
751
|
+
this._setUpdateTextureDirty();
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
_getFontWeight() {
|
|
755
|
+
return this._fontWeight;
|
|
756
|
+
}
|
|
757
|
+
static _fontStyleRE = /^(\d+)px\s+['"]?([\w\s\d]+)['"]?$/;
|
|
758
|
+
/**
|
|
759
|
+
* Returns the height of text with an specified font family and font size, in
|
|
760
|
+
* device independent pixels.
|
|
761
|
+
*
|
|
762
|
+
* @param {string|FontDefinition} fontName
|
|
763
|
+
* @param {number} fontSize
|
|
764
|
+
* @returns {number}
|
|
765
|
+
* @private
|
|
766
|
+
*/
|
|
767
|
+
static __getFontHeightByDiv = function (fontName, fontSize) {
|
|
768
|
+
let clientHeight;
|
|
769
|
+
const labelDiv = __labelHeightDiv;
|
|
770
|
+
if (fontName instanceof FontDefinition) {
|
|
771
|
+
/** @type FontDefinition */
|
|
772
|
+
const fontDef = fontName;
|
|
773
|
+
clientHeight = LabelTTF.__fontHeightCache[fontDef._getCanvasFontStr()];
|
|
774
|
+
if (clientHeight > 0)
|
|
775
|
+
return clientHeight;
|
|
776
|
+
labelDiv.innerHTML = 'ajghl~!';
|
|
777
|
+
labelDiv.style.fontFamily = fontDef.fontName;
|
|
778
|
+
labelDiv.style.fontSize = `${fontDef.fontSize}px`;
|
|
779
|
+
labelDiv.style.fontStyle = fontDef.fontStyle;
|
|
780
|
+
labelDiv.style.fontWeight = fontDef.fontWeight;
|
|
781
|
+
clientHeight = labelDiv.clientHeight;
|
|
782
|
+
LabelTTF.__fontHeightCache[fontDef._getCanvasFontStr()] = clientHeight;
|
|
783
|
+
labelDiv.innerHTML = '';
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
//Default
|
|
787
|
+
clientHeight = LabelTTF.__fontHeightCache[`${fontName}.${fontSize}`];
|
|
788
|
+
if (clientHeight > 0)
|
|
789
|
+
return clientHeight;
|
|
790
|
+
labelDiv.innerHTML = 'ajghl~!';
|
|
791
|
+
labelDiv.style.fontFamily = fontName;
|
|
792
|
+
labelDiv.style.fontSize = `${fontSize}px`;
|
|
793
|
+
clientHeight = labelDiv.clientHeight;
|
|
794
|
+
LabelTTF.__fontHeightCache[`${fontName}.${fontSize}`] = clientHeight;
|
|
795
|
+
labelDiv.innerHTML = '';
|
|
796
|
+
}
|
|
797
|
+
return clientHeight;
|
|
798
|
+
};
|
|
799
|
+
static __fontHeightCache = {};
|
|
800
|
+
}
|
|
801
|
+
// PrototypeLabelTTF()
|
|
802
|
+
// Only support style in this format: "18px Verdana" or "18px 'Helvetica Neue'"
|
|
803
|
+
const __labelHeightDiv = document.createElement('div');
|
|
804
|
+
__labelHeightDiv.style.fontFamily = 'Arial';
|
|
805
|
+
__labelHeightDiv.style.position = 'absolute';
|
|
806
|
+
__labelHeightDiv.style.left = '-100px';
|
|
807
|
+
__labelHeightDiv.style.top = '-100px';
|
|
808
|
+
__labelHeightDiv.style.lineHeight = 'normal';
|
|
809
|
+
function appendDiv() {
|
|
810
|
+
document.body.appendChild(__labelHeightDiv);
|
|
811
|
+
}
|
|
812
|
+
if (document.readyState === 'loading') {
|
|
813
|
+
document.addEventListener('DOMContentLoaded', appendDiv, { once: true });
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
appendDiv();
|
|
817
|
+
}
|
|
818
|
+
//# sourceMappingURL=LabelTTF.js.map
|