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,765 @@
|
|
|
1
|
+
import { _renderContext, game } from '..';
|
|
2
|
+
import { Size } from '../core/cocoa/Geometry';
|
|
3
|
+
import { configuration } from '../core/Configuration';
|
|
4
|
+
import { EventHelper } from '../core/event-manager/EventHelper';
|
|
5
|
+
import { contentScaleFactor, SHADER_POSITION_TEXTURE, VERTEX_ATTRIB_POSITION, VERTEX_ATTRIB_TEX_COORDS } from '../core/platform/Macro';
|
|
6
|
+
import { _LogInfos, assert, log } from '../helper/Debugger';
|
|
7
|
+
import { loader } from '../helper/loader';
|
|
8
|
+
import { NextPOT } from '../render-texture/RenderTexture';
|
|
9
|
+
import { GLProgram, GLProgramState } from '../shaders';
|
|
10
|
+
import { glBindTexture2D } from '../shaders/GLStateCache';
|
|
11
|
+
import { shaderCache } from '../shaders/ShaderCache';
|
|
12
|
+
/**
|
|
13
|
+
* <p>
|
|
14
|
+
* This class allows to easily create OpenGL or Canvas 2D textures from images, text or raw data. <br/>
|
|
15
|
+
* The created Texture2D object will always have power-of-two dimensions. <br/>
|
|
16
|
+
* Depending on how you create the Texture2D object, the actual image area of the texture might be smaller than the texture dimensions <br/>
|
|
17
|
+
* i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0). <br/>
|
|
18
|
+
* Be aware that the content of the generated textures will be upside-down! </p>
|
|
19
|
+
* @name Texture2D
|
|
20
|
+
* @class
|
|
21
|
+
* @extends Class
|
|
22
|
+
*
|
|
23
|
+
* @property {WebGLTexture} name - <@readonly> WebGLTexture Object
|
|
24
|
+
* @property {Number} pixelFormat - <@readonly> Pixel format of the texture
|
|
25
|
+
* @property {Number} pixelsWidth - <@readonly> Width in pixels
|
|
26
|
+
* @property {Number} pixelsHeight - <@readonly> Height in pixels
|
|
27
|
+
* @property {Number} width - Content width in points
|
|
28
|
+
* @property {Number} height - Content height in points
|
|
29
|
+
* @property {GLProgram} shaderProgram - The shader program used by drawAtPoint and drawInRect
|
|
30
|
+
* @property {Number} maxS - Texture max S
|
|
31
|
+
* @property {Number} maxT - Texture max T
|
|
32
|
+
*/
|
|
33
|
+
//Original : Texture2DWebGL
|
|
34
|
+
export let PVRHaveAlphaPremultiplied_ = false;
|
|
35
|
+
export class Texture2D extends EventHelper {
|
|
36
|
+
/**
|
|
37
|
+
* <p>
|
|
38
|
+
* treats (or not) PVR files as if they have alpha premultiplied. <br/>
|
|
39
|
+
* Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is <br/>
|
|
40
|
+
* possible load them as if they have (or not) the alpha channel premultiplied. <br/>
|
|
41
|
+
* <br/>
|
|
42
|
+
* By default it is disabled. <br/>
|
|
43
|
+
* </p>
|
|
44
|
+
* @param haveAlphaPremultiplied
|
|
45
|
+
*/
|
|
46
|
+
static PVRImagesHavePremultipliedAlpha = function (haveAlphaPremultiplied) {
|
|
47
|
+
PVRHaveAlphaPremultiplied_ = haveAlphaPremultiplied;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* 32-bit texture: RGBA8888
|
|
51
|
+
* @memberOf Texture2D
|
|
52
|
+
* @name PIXEL_FORMAT_RGBA8888
|
|
53
|
+
* @static
|
|
54
|
+
* @constant
|
|
55
|
+
* @type {Number}
|
|
56
|
+
*/
|
|
57
|
+
static PIXEL_FORMAT_RGBA8888 = 2;
|
|
58
|
+
/**
|
|
59
|
+
* 24-bit texture: RGBA888
|
|
60
|
+
* @memberOf Texture2D
|
|
61
|
+
* @name PIXEL_FORMAT_RGB888
|
|
62
|
+
* @static
|
|
63
|
+
* @constant
|
|
64
|
+
* @type {Number}
|
|
65
|
+
*/
|
|
66
|
+
static PIXEL_FORMAT_RGB888 = 3;
|
|
67
|
+
/**
|
|
68
|
+
* 16-bit texture without Alpha channel
|
|
69
|
+
* @memberOf Texture2D
|
|
70
|
+
* @name PIXEL_FORMAT_RGB565
|
|
71
|
+
* @static
|
|
72
|
+
* @constant
|
|
73
|
+
* @type {Number}
|
|
74
|
+
*/
|
|
75
|
+
static PIXEL_FORMAT_RGB565 = 4;
|
|
76
|
+
/**
|
|
77
|
+
* 8-bit textures used as masks
|
|
78
|
+
* @memberOf Texture2D
|
|
79
|
+
* @name PIXEL_FORMAT_A8
|
|
80
|
+
* @static
|
|
81
|
+
* @constant
|
|
82
|
+
* @type {Number}
|
|
83
|
+
*/
|
|
84
|
+
static PIXEL_FORMAT_A8 = 5;
|
|
85
|
+
/**
|
|
86
|
+
* 8-bit intensity texture
|
|
87
|
+
* @memberOf Texture2D
|
|
88
|
+
* @name PIXEL_FORMAT_I8
|
|
89
|
+
* @static
|
|
90
|
+
* @constant
|
|
91
|
+
* @type {Number}
|
|
92
|
+
*/
|
|
93
|
+
static PIXEL_FORMAT_I8 = 6;
|
|
94
|
+
/**
|
|
95
|
+
* 16-bit textures used as masks
|
|
96
|
+
* @memberOf Texture2D
|
|
97
|
+
* @name PIXEL_FORMAT_AI88
|
|
98
|
+
* @static
|
|
99
|
+
* @constant
|
|
100
|
+
* @type {Number}
|
|
101
|
+
*/
|
|
102
|
+
static PIXEL_FORMAT_AI88 = 7;
|
|
103
|
+
/**
|
|
104
|
+
* 16-bit textures: RGBA4444
|
|
105
|
+
* @memberOf Texture2D
|
|
106
|
+
* @name PIXEL_FORMAT_RGBA4444
|
|
107
|
+
* @static
|
|
108
|
+
* @constant
|
|
109
|
+
* @type {Number}
|
|
110
|
+
*/
|
|
111
|
+
static PIXEL_FORMAT_RGBA4444 = 8;
|
|
112
|
+
/**
|
|
113
|
+
* 16-bit textures: RGB5A1
|
|
114
|
+
* @memberOf Texture2D
|
|
115
|
+
* @name PIXEL_FORMAT_RGB5A1
|
|
116
|
+
* @static
|
|
117
|
+
* @constant
|
|
118
|
+
* @type {Number}
|
|
119
|
+
*/
|
|
120
|
+
static PIXEL_FORMAT_RGB5A1 = 7;
|
|
121
|
+
/**
|
|
122
|
+
* 4-bit PVRTC-compressed texture: PVRTC4
|
|
123
|
+
* @memberOf Texture2D
|
|
124
|
+
* @name PIXEL_FORMAT_PVRTC4
|
|
125
|
+
* @static
|
|
126
|
+
* @constant
|
|
127
|
+
* @type {Number}
|
|
128
|
+
*/
|
|
129
|
+
static PIXEL_FORMAT_PVRTC4 = 9;
|
|
130
|
+
/**
|
|
131
|
+
* 2-bit PVRTC-compressed texture: PVRTC2
|
|
132
|
+
* @memberOf Texture2D
|
|
133
|
+
* @name PIXEL_FORMAT_PVRTC2
|
|
134
|
+
* @static
|
|
135
|
+
* @constant
|
|
136
|
+
* @type {Number}
|
|
137
|
+
*/
|
|
138
|
+
static PIXEL_FORMAT_PVRTC2 = 10;
|
|
139
|
+
/**
|
|
140
|
+
* Default texture format: RGBA8888
|
|
141
|
+
* @memberOf Texture2D
|
|
142
|
+
* @name PIXEL_FORMAT_DEFAULT
|
|
143
|
+
* @static
|
|
144
|
+
* @constant
|
|
145
|
+
* @type {Number}
|
|
146
|
+
*/
|
|
147
|
+
static PIXEL_FORMAT_DEFAULT = Texture2D.PIXEL_FORMAT_RGBA8888;
|
|
148
|
+
/**
|
|
149
|
+
* The default pixel format
|
|
150
|
+
* @memberOf Texture2D
|
|
151
|
+
* @name PIXEL_FORMAT_PVRTC2
|
|
152
|
+
* @static
|
|
153
|
+
* @type {Number}
|
|
154
|
+
*/
|
|
155
|
+
static defaultPixelFormat = Texture2D.PIXEL_FORMAT_DEFAULT;
|
|
156
|
+
static _M = {
|
|
157
|
+
[Texture2D.PIXEL_FORMAT_RGBA8888]: 'RGBA8888',
|
|
158
|
+
[Texture2D.PIXEL_FORMAT_RGB888]: 'RGB888',
|
|
159
|
+
[Texture2D.PIXEL_FORMAT_RGB565]: 'RGB565',
|
|
160
|
+
[Texture2D.PIXEL_FORMAT_A8]: 'A8',
|
|
161
|
+
[Texture2D.PIXEL_FORMAT_I8]: 'I8',
|
|
162
|
+
[Texture2D.PIXEL_FORMAT_AI88]: 'AI88',
|
|
163
|
+
[Texture2D.PIXEL_FORMAT_RGBA4444]: 'RGBA4444',
|
|
164
|
+
[Texture2D.PIXEL_FORMAT_RGB5A1]: 'RGB5A1',
|
|
165
|
+
[Texture2D.PIXEL_FORMAT_PVRTC4]: 'PVRTC4',
|
|
166
|
+
[Texture2D.PIXEL_FORMAT_PVRTC2]: 'PVRTC2',
|
|
167
|
+
};
|
|
168
|
+
static _B = {
|
|
169
|
+
[Texture2D.PIXEL_FORMAT_RGBA8888]: 32,
|
|
170
|
+
[Texture2D.PIXEL_FORMAT_RGB888]: 24,
|
|
171
|
+
[Texture2D.PIXEL_FORMAT_RGB565]: 16,
|
|
172
|
+
[Texture2D.PIXEL_FORMAT_A8]: 8,
|
|
173
|
+
[Texture2D.PIXEL_FORMAT_I8]: 8,
|
|
174
|
+
[Texture2D.PIXEL_FORMAT_AI88]: 16,
|
|
175
|
+
[Texture2D.PIXEL_FORMAT_RGBA4444]: 16,
|
|
176
|
+
[Texture2D.PIXEL_FORMAT_RGB5A1]: 16,
|
|
177
|
+
[Texture2D.PIXEL_FORMAT_PVRTC4]: 4,
|
|
178
|
+
[Texture2D.PIXEL_FORMAT_PVRTC2]: 3,
|
|
179
|
+
};
|
|
180
|
+
// By default PVR images are treated as if they don't have the alpha channel premultiplied
|
|
181
|
+
_pVRHaveAlphaPremultiplied;
|
|
182
|
+
_pixelFormat;
|
|
183
|
+
_pixelsWide;
|
|
184
|
+
_pixelsHigh;
|
|
185
|
+
_name;
|
|
186
|
+
_contentSize;
|
|
187
|
+
maxS;
|
|
188
|
+
maxT;
|
|
189
|
+
_hasPremultipliedAlpha;
|
|
190
|
+
_hasMipmaps;
|
|
191
|
+
shaderProgram;
|
|
192
|
+
_textureLoaded;
|
|
193
|
+
_htmlElementObj;
|
|
194
|
+
_webTextureObj;
|
|
195
|
+
url;
|
|
196
|
+
_glProgramState;
|
|
197
|
+
_vertexBuffer;
|
|
198
|
+
_texBuffer;
|
|
199
|
+
// runtime-attached event helper methods (added by EventHelper.apply at runtime)
|
|
200
|
+
// addEventListener?: (type: any, callback: any, target?: any) => void;
|
|
201
|
+
// removeEventTarget?: (type: any, target?: any) => void;
|
|
202
|
+
// dispatchEvent?: (type: any) => void;
|
|
203
|
+
constructor() {
|
|
204
|
+
super();
|
|
205
|
+
this._pVRHaveAlphaPremultiplied = true;
|
|
206
|
+
this._pixelFormat = null;
|
|
207
|
+
this._pixelsWide = 0;
|
|
208
|
+
this._pixelsHigh = 0;
|
|
209
|
+
this._name = '';
|
|
210
|
+
this._contentSize = null;
|
|
211
|
+
this.maxS = 0;
|
|
212
|
+
this.maxT = 0;
|
|
213
|
+
this._hasPremultipliedAlpha = false;
|
|
214
|
+
this._hasMipmaps = false;
|
|
215
|
+
this.shaderProgram = null;
|
|
216
|
+
this._textureLoaded = false;
|
|
217
|
+
this._htmlElementObj = null;
|
|
218
|
+
this._webTextureObj = null;
|
|
219
|
+
this.url = null;
|
|
220
|
+
// ctor behavior
|
|
221
|
+
this._contentSize = Size(0, 0);
|
|
222
|
+
this._pixelFormat = Texture2D.defaultPixelFormat;
|
|
223
|
+
const gl = _renderContext;
|
|
224
|
+
this._vertexBuffer = gl.createBuffer();
|
|
225
|
+
this._texBuffer = gl.createBuffer();
|
|
226
|
+
}
|
|
227
|
+
// release texture
|
|
228
|
+
releaseTexture() {
|
|
229
|
+
if (this._webTextureObj)
|
|
230
|
+
_renderContext.deleteTexture(this._webTextureObj);
|
|
231
|
+
this._htmlElementObj = null;
|
|
232
|
+
loader.release(this.url);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* pixel format of the texture
|
|
236
|
+
* @return {Number}
|
|
237
|
+
*/
|
|
238
|
+
getPixelFormat() {
|
|
239
|
+
return this._pixelFormat;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* width in pixels
|
|
243
|
+
* @return {Number}
|
|
244
|
+
*/
|
|
245
|
+
getPixelsWide() {
|
|
246
|
+
return this._pixelsWide;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* height in pixels
|
|
250
|
+
* @return {Number}
|
|
251
|
+
*/
|
|
252
|
+
getPixelsHigh() {
|
|
253
|
+
return this._pixelsHigh;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* get WebGLTexture Object
|
|
257
|
+
* @return {WebGLTexture}
|
|
258
|
+
*/
|
|
259
|
+
getName() {
|
|
260
|
+
return this._webTextureObj;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* content size
|
|
264
|
+
* @return {Size}
|
|
265
|
+
*/
|
|
266
|
+
getContentSize() {
|
|
267
|
+
return Size(this._contentSize.width / contentScaleFactor(), this._contentSize.height / contentScaleFactor());
|
|
268
|
+
}
|
|
269
|
+
_getWidth() {
|
|
270
|
+
return this._contentSize.width / contentScaleFactor();
|
|
271
|
+
}
|
|
272
|
+
_getHeight() {
|
|
273
|
+
return this._contentSize.height / contentScaleFactor();
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* get content size in pixels
|
|
277
|
+
* @return {Size}
|
|
278
|
+
*/
|
|
279
|
+
getContentSizeInPixels() {
|
|
280
|
+
return this._contentSize;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* texture max S
|
|
284
|
+
* @return {Number}
|
|
285
|
+
*/
|
|
286
|
+
getMaxS() {
|
|
287
|
+
return this.maxS;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* set texture max S
|
|
291
|
+
* @param {Number} maxS
|
|
292
|
+
*/
|
|
293
|
+
setMaxS(maxS) {
|
|
294
|
+
this.maxS = maxS;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* get texture max T
|
|
298
|
+
* @return {Number}
|
|
299
|
+
*/
|
|
300
|
+
getMaxT() {
|
|
301
|
+
return this.maxT;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* set texture max T
|
|
305
|
+
* @param {Number} maxT
|
|
306
|
+
*/
|
|
307
|
+
setMaxT(maxT) {
|
|
308
|
+
this.maxT = maxT;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* return shader program used by drawAtPoint and drawInRect
|
|
312
|
+
* @return {GLProgram}
|
|
313
|
+
*/
|
|
314
|
+
getShaderProgram() {
|
|
315
|
+
return this.shaderProgram;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* set shader program used by drawAtPoint and drawInRect
|
|
319
|
+
* @param {GLProgram} shaderProgram
|
|
320
|
+
*/
|
|
321
|
+
setShaderProgram(shaderProgram) {
|
|
322
|
+
this.shaderProgram = shaderProgram;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* whether or not the texture has their Alpha premultiplied
|
|
326
|
+
* @return {Boolean}
|
|
327
|
+
*/
|
|
328
|
+
hasPremultipliedAlpha() {
|
|
329
|
+
return this._hasPremultipliedAlpha;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* whether or not use mipmap
|
|
333
|
+
* @return {Boolean}
|
|
334
|
+
*/
|
|
335
|
+
hasMipmaps() {
|
|
336
|
+
return this._hasMipmaps;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* description
|
|
340
|
+
* @return {string}
|
|
341
|
+
*/
|
|
342
|
+
description() {
|
|
343
|
+
return `<Texture2D | Name = ${this._name} | Dimensions = ${this._pixelsWide} x ${this._pixelsHigh} | Coordinates = (${this.maxS}, ${this.maxT})>`;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* These functions are needed to create mutable textures
|
|
347
|
+
* @param {Array} data
|
|
348
|
+
*/
|
|
349
|
+
releaseData(_data) {
|
|
350
|
+
_data = null;
|
|
351
|
+
}
|
|
352
|
+
keepData(_data, _length) {
|
|
353
|
+
//The texture data mustn't be saved because it isn't a mutable texture.
|
|
354
|
+
return _data;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Intializes with a texture2d with data
|
|
358
|
+
* @param {Array} data
|
|
359
|
+
* @param {Number} pixelFormat
|
|
360
|
+
* @param {Number} pixelsWide
|
|
361
|
+
* @param {Number} pixelsHigh
|
|
362
|
+
* @param {Size} contentSize
|
|
363
|
+
* @return {Boolean}
|
|
364
|
+
*/
|
|
365
|
+
initWithData(data, pixelFormat, pixelsWide, pixelsHigh, contentSize) {
|
|
366
|
+
const gl = _renderContext;
|
|
367
|
+
let format = gl.RGBA, type = gl.UNSIGNED_BYTE;
|
|
368
|
+
const bitsPerPixel = (Texture2D._B || [])[pixelFormat];
|
|
369
|
+
const bytesPerRow = (pixelsWide * bitsPerPixel) / 8;
|
|
370
|
+
if (bytesPerRow % 8 === 0) {
|
|
371
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 8);
|
|
372
|
+
}
|
|
373
|
+
else if (bytesPerRow % 4 === 0) {
|
|
374
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
|
|
375
|
+
}
|
|
376
|
+
else if (bytesPerRow % 2 === 0) {
|
|
377
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 2);
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
|
|
381
|
+
}
|
|
382
|
+
this._webTextureObj = gl.createTexture();
|
|
383
|
+
glBindTexture2D(this);
|
|
384
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
385
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
386
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
387
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
388
|
+
// Specify OpenGL texture image
|
|
389
|
+
switch (pixelFormat) {
|
|
390
|
+
case Texture2D.PIXEL_FORMAT_RGBA8888:
|
|
391
|
+
format = gl.RGBA;
|
|
392
|
+
break;
|
|
393
|
+
case Texture2D.PIXEL_FORMAT_RGB888:
|
|
394
|
+
format = gl.RGB;
|
|
395
|
+
break;
|
|
396
|
+
case Texture2D.PIXEL_FORMAT_RGBA4444:
|
|
397
|
+
type = gl.UNSIGNED_SHORT_4_4_4_4;
|
|
398
|
+
break;
|
|
399
|
+
case Texture2D.PIXEL_FORMAT_RGB5A1:
|
|
400
|
+
type = gl.UNSIGNED_SHORT_5_5_5_1;
|
|
401
|
+
break;
|
|
402
|
+
case Texture2D.PIXEL_FORMAT_RGB565:
|
|
403
|
+
type = gl.UNSIGNED_SHORT_5_6_5;
|
|
404
|
+
break;
|
|
405
|
+
case Texture2D.PIXEL_FORMAT_AI88:
|
|
406
|
+
format = gl.LUMINANCE_ALPHA;
|
|
407
|
+
break;
|
|
408
|
+
case Texture2D.PIXEL_FORMAT_A8:
|
|
409
|
+
format = gl.ALPHA;
|
|
410
|
+
break;
|
|
411
|
+
case Texture2D.PIXEL_FORMAT_I8:
|
|
412
|
+
format = gl.LUMINANCE;
|
|
413
|
+
break;
|
|
414
|
+
default:
|
|
415
|
+
assert(0, _LogInfos.Texture2D_initWithData);
|
|
416
|
+
}
|
|
417
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, format, pixelsWide, pixelsHigh, 0, format, type, data);
|
|
418
|
+
this._contentSize.width = contentSize.width;
|
|
419
|
+
this._contentSize.height = contentSize.height;
|
|
420
|
+
this._pixelsWide = pixelsWide;
|
|
421
|
+
this._pixelsHigh = pixelsHigh;
|
|
422
|
+
this._pixelFormat = pixelFormat;
|
|
423
|
+
this.maxS = contentSize.width / pixelsWide;
|
|
424
|
+
this.maxT = contentSize.height / pixelsHigh;
|
|
425
|
+
this._hasPremultipliedAlpha = false;
|
|
426
|
+
this._hasMipmaps = false;
|
|
427
|
+
this.shaderProgram = shaderCache.programForKey(SHADER_POSITION_TEXTURE);
|
|
428
|
+
this._textureLoaded = true;
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
Drawing extensions to make it easy to draw basic quads using a CCTexture2D object.
|
|
433
|
+
These functions require gl.TEXTURE_2D and both gl.VERTEX_ARRAY and gl.TEXTURE_COORD_ARRAY client states to be enabled.
|
|
434
|
+
*/
|
|
435
|
+
/**
|
|
436
|
+
* draws a texture at a given point
|
|
437
|
+
* @param {Point} point
|
|
438
|
+
*/
|
|
439
|
+
drawAtPoint(point) {
|
|
440
|
+
const gl = _renderContext;
|
|
441
|
+
const width = this._pixelsWide * this.maxS;
|
|
442
|
+
const height = this._pixelsHigh * this.maxT;
|
|
443
|
+
const vertices = new Float32Array([
|
|
444
|
+
point.x,
|
|
445
|
+
point.y,
|
|
446
|
+
point.x + width,
|
|
447
|
+
point.y,
|
|
448
|
+
point.x,
|
|
449
|
+
point.y + height,
|
|
450
|
+
point.x + width,
|
|
451
|
+
point.y + height,
|
|
452
|
+
]);
|
|
453
|
+
const coordinates = new Float32Array([0.0, this.maxT, this.maxS, this.maxT, 0.0, 0.0, this.maxS, 0.0]);
|
|
454
|
+
this._glProgramState.apply();
|
|
455
|
+
this._glProgramState._glprogram.setUniformsForBuiltins();
|
|
456
|
+
glBindTexture2D(this);
|
|
457
|
+
// vertex buffer
|
|
458
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
|
|
459
|
+
gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.DYNAMIC_DRAW);
|
|
460
|
+
gl.enableVertexAttribArray(VERTEX_ATTRIB_POSITION);
|
|
461
|
+
gl.vertexAttribPointer(VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0);
|
|
462
|
+
// texcoord buffer
|
|
463
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, this._texBuffer);
|
|
464
|
+
gl.bufferData(gl.ARRAY_BUFFER, coordinates, gl.DYNAMIC_DRAW);
|
|
465
|
+
gl.enableVertexAttribArray(VERTEX_ATTRIB_TEX_COORDS);
|
|
466
|
+
gl.vertexAttribPointer(VERTEX_ATTRIB_TEX_COORDS, 2, gl.FLOAT, false, 0, 0);
|
|
467
|
+
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* draws a texture inside a rect
|
|
471
|
+
* @param {Rect} rect
|
|
472
|
+
*/
|
|
473
|
+
drawInRect(rect) {
|
|
474
|
+
const gl = _renderContext;
|
|
475
|
+
const vertices = new Float32Array([
|
|
476
|
+
rect.x,
|
|
477
|
+
rect.y,
|
|
478
|
+
rect.x + rect.width,
|
|
479
|
+
rect.y,
|
|
480
|
+
rect.x,
|
|
481
|
+
rect.y + rect.height,
|
|
482
|
+
rect.x + rect.width,
|
|
483
|
+
rect.y + rect.height,
|
|
484
|
+
]);
|
|
485
|
+
const coordinates = new Float32Array([0.0, this.maxT, this.maxS, this.maxT, 0.0, 0.0, this.maxS, 0.0]);
|
|
486
|
+
this._glProgramState.apply();
|
|
487
|
+
this._glProgramState._glprogram.setUniformsForBuiltins();
|
|
488
|
+
glBindTexture2D(this);
|
|
489
|
+
// vertex buffer
|
|
490
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, this._vertexBuffer);
|
|
491
|
+
gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.DYNAMIC_DRAW);
|
|
492
|
+
gl.enableVertexAttribArray(VERTEX_ATTRIB_POSITION);
|
|
493
|
+
gl.vertexAttribPointer(VERTEX_ATTRIB_POSITION, 2, gl.FLOAT, false, 0, 0);
|
|
494
|
+
// texcoord buffer
|
|
495
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, this._texBuffer);
|
|
496
|
+
gl.bufferData(gl.ARRAY_BUFFER, coordinates, gl.DYNAMIC_DRAW);
|
|
497
|
+
gl.enableVertexAttribArray(VERTEX_ATTRIB_TEX_COORDS);
|
|
498
|
+
gl.vertexAttribPointer(VERTEX_ATTRIB_TEX_COORDS, 2, gl.FLOAT, false, 0, 0);
|
|
499
|
+
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Initializes a texture from a UIImage object
|
|
503
|
+
* @param uiImage
|
|
504
|
+
* @return {Boolean}
|
|
505
|
+
*/
|
|
506
|
+
initWithImage(uiImage) {
|
|
507
|
+
if (uiImage == null) {
|
|
508
|
+
log(_LogInfos.Texture2D_initWithImage);
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
511
|
+
const imageWidth = uiImage.getWidth();
|
|
512
|
+
const imageHeight = uiImage.getHeight();
|
|
513
|
+
const maxTextureSize = configuration.getMaxTextureSize();
|
|
514
|
+
if (imageWidth > maxTextureSize || imageHeight > maxTextureSize) {
|
|
515
|
+
log(_LogInfos.Texture2D_initWithImage_2, imageWidth, imageHeight, maxTextureSize, maxTextureSize);
|
|
516
|
+
return false;
|
|
517
|
+
}
|
|
518
|
+
this._textureLoaded = true;
|
|
519
|
+
// always load premultiplied images
|
|
520
|
+
return this._initPremultipliedATextureWithImage(uiImage, imageWidth, imageHeight);
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* init with HTML element
|
|
524
|
+
* @param {HTMLImageElement|HTMLCanvasElement} element
|
|
525
|
+
*/
|
|
526
|
+
initWithElement(element) {
|
|
527
|
+
if (!element)
|
|
528
|
+
return;
|
|
529
|
+
this._webTextureObj = _renderContext.createTexture();
|
|
530
|
+
this._htmlElementObj = element;
|
|
531
|
+
this._textureLoaded = true;
|
|
532
|
+
// Textures should be loaded with premultiplied alpha in order to avoid gray bleeding
|
|
533
|
+
// when semitransparent textures are interpolated (e.g. when scaled).
|
|
534
|
+
this._hasPremultipliedAlpha = true;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* HTMLElement Object getter
|
|
538
|
+
* @return {HTMLElement}
|
|
539
|
+
*/
|
|
540
|
+
getHtmlElementObj() {
|
|
541
|
+
return this._htmlElementObj;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* whether texture is loaded
|
|
545
|
+
* @return {Boolean}
|
|
546
|
+
*/
|
|
547
|
+
isLoaded() {
|
|
548
|
+
return this._textureLoaded;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* handler of texture loaded event
|
|
552
|
+
* @param {Boolean} [premultiplied=false]
|
|
553
|
+
*/
|
|
554
|
+
handleLoadedTexture(premultiplied) {
|
|
555
|
+
premultiplied = premultiplied !== undefined ? premultiplied : this._hasPremultipliedAlpha;
|
|
556
|
+
// Not sure about this ! Some texture need to be updated even after loaded
|
|
557
|
+
if (!game._rendererInitialized)
|
|
558
|
+
return;
|
|
559
|
+
if (!this._htmlElementObj)
|
|
560
|
+
return;
|
|
561
|
+
if (!this._htmlElementObj.width || !this._htmlElementObj.height)
|
|
562
|
+
return;
|
|
563
|
+
//upload image to buffer
|
|
564
|
+
const gl = _renderContext;
|
|
565
|
+
glBindTexture2D(this);
|
|
566
|
+
gl.pixelStorei(gl.UNPACK_ALIGNMENT, 4);
|
|
567
|
+
if (premultiplied)
|
|
568
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
|
|
569
|
+
// Specify OpenGL texture image
|
|
570
|
+
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._htmlElementObj);
|
|
571
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
572
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
573
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
574
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
575
|
+
this.shaderProgram = shaderCache.programForKey(SHADER_POSITION_TEXTURE);
|
|
576
|
+
glBindTexture2D(null);
|
|
577
|
+
if (premultiplied)
|
|
578
|
+
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0);
|
|
579
|
+
const pixelsWide = this._htmlElementObj.width;
|
|
580
|
+
const pixelsHigh = this._htmlElementObj.height;
|
|
581
|
+
this._pixelsWide = this._contentSize.width = pixelsWide;
|
|
582
|
+
this._pixelsHigh = this._contentSize.height = pixelsHigh;
|
|
583
|
+
this._pixelFormat = Texture2D.PIXEL_FORMAT_RGBA8888;
|
|
584
|
+
this.maxS = 1;
|
|
585
|
+
this.maxT = 1;
|
|
586
|
+
this._hasPremultipliedAlpha = premultiplied;
|
|
587
|
+
this._hasMipmaps = false;
|
|
588
|
+
if (window.ENABLE_IMAGE_POOL) {
|
|
589
|
+
this._htmlElementObj = null;
|
|
590
|
+
}
|
|
591
|
+
//dispatch load event to listener.
|
|
592
|
+
this.dispatchEvent('load');
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Initializes a texture from a string with dimensions, alignment, font name and font size (note: initWithString does not support on HTML5)
|
|
596
|
+
*/
|
|
597
|
+
initWithString(_text, _fontName, _fontSize, _dimensions, _hAlignment, _vAlignment) {
|
|
598
|
+
log(_LogInfos.Texture2D_initWithString);
|
|
599
|
+
return null;
|
|
600
|
+
}
|
|
601
|
+
initWithETCFile(_file) {
|
|
602
|
+
log(_LogInfos.Texture2D_initWithETCFile_2);
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
initWithPVRFile(_file) {
|
|
606
|
+
log(_LogInfos.Texture2D_initWithPVRFile_2);
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
initWithPVRTCData(_data, _level, _bpp, _hasAlpha, _length, _pixelFormat) {
|
|
610
|
+
log(_LogInfos.Texture2D_initWithPVRTCData_2);
|
|
611
|
+
return false;
|
|
612
|
+
}
|
|
613
|
+
setTexParameters(texParams, magFilter, wrapS, wrapT) {
|
|
614
|
+
const gl = _renderContext;
|
|
615
|
+
if (magFilter !== undefined)
|
|
616
|
+
texParams = { minFilter: texParams, magFilter: magFilter, wrapS: wrapS, wrapT: wrapT };
|
|
617
|
+
assert((this._pixelsWide === NextPOT(this._pixelsWide) && this._pixelsHigh === NextPOT(this._pixelsHigh)) ||
|
|
618
|
+
(texParams.wrapS === gl.CLAMP_TO_EDGE && texParams.wrapT === gl.CLAMP_TO_EDGE), 'WebGLRenderingContext.CLAMP_TO_EDGE should be used in NPOT textures');
|
|
619
|
+
glBindTexture2D(this);
|
|
620
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texParams.minFilter);
|
|
621
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texParams.magFilter);
|
|
622
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, texParams.wrapS);
|
|
623
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, texParams.wrapT);
|
|
624
|
+
}
|
|
625
|
+
setAntiAliasTexParameters() {
|
|
626
|
+
const gl = _renderContext;
|
|
627
|
+
glBindTexture2D(this);
|
|
628
|
+
if (!this._hasMipmaps)
|
|
629
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
630
|
+
else
|
|
631
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
|
|
632
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
|
633
|
+
}
|
|
634
|
+
setAliasTexParameters() {
|
|
635
|
+
const gl = _renderContext;
|
|
636
|
+
glBindTexture2D(this);
|
|
637
|
+
if (!this._hasMipmaps)
|
|
638
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
639
|
+
else
|
|
640
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST);
|
|
641
|
+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
642
|
+
}
|
|
643
|
+
generateMipmap() {
|
|
644
|
+
assert(this._pixelsWide === NextPOT(this._pixelsWide) && this._pixelsHigh === NextPOT(this._pixelsHigh), 'Mimpap texture only works in POT textures');
|
|
645
|
+
glBindTexture2D(this);
|
|
646
|
+
_renderContext.generateMipmap(_renderContext.TEXTURE_2D);
|
|
647
|
+
this._hasMipmaps = true;
|
|
648
|
+
}
|
|
649
|
+
stringForFormat() {
|
|
650
|
+
return this.constructor._M[this._pixelFormat];
|
|
651
|
+
}
|
|
652
|
+
bitsPerPixelForFormat(format) {
|
|
653
|
+
format = format || this._pixelFormat;
|
|
654
|
+
const value = this.constructor._B[format];
|
|
655
|
+
if (value != null)
|
|
656
|
+
return value;
|
|
657
|
+
log(_LogInfos.Texture2D_bitsPerPixelForFormat, format);
|
|
658
|
+
return -1;
|
|
659
|
+
}
|
|
660
|
+
_initPremultipliedATextureWithImage(uiImage, width, height) {
|
|
661
|
+
let tempData = uiImage.getData();
|
|
662
|
+
let inPixel32;
|
|
663
|
+
let inPixel8;
|
|
664
|
+
const hasAlpha = uiImage.hasAlpha();
|
|
665
|
+
const imageSize = Size(uiImage.getWidth(), uiImage.getHeight());
|
|
666
|
+
let pixelFormat = Texture2D.defaultPixelFormat;
|
|
667
|
+
const bpp = uiImage.getBitsPerComponent();
|
|
668
|
+
// compute pixel format
|
|
669
|
+
if (!hasAlpha) {
|
|
670
|
+
if (bpp >= 8) {
|
|
671
|
+
pixelFormat = Texture2D.PIXEL_FORMAT_RGB888;
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
log(_LogInfos.Texture2D__initPremultipliedATextureWithImage);
|
|
675
|
+
pixelFormat = Texture2D.PIXEL_FORMAT_RGB565;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
// Repack the pixel data into the right format
|
|
679
|
+
let i;
|
|
680
|
+
const length = width * height;
|
|
681
|
+
if (pixelFormat === Texture2D.PIXEL_FORMAT_RGB565) {
|
|
682
|
+
if (hasAlpha) {
|
|
683
|
+
// Convert "RRRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA" to "RRRRRGGGGGGBBBBB"
|
|
684
|
+
tempData = new Uint16Array(width * height);
|
|
685
|
+
inPixel32 = uiImage.getData();
|
|
686
|
+
for (i = 0; i < length; ++i) {
|
|
687
|
+
tempData[i] =
|
|
688
|
+
((((inPixel32[i] >> 0) & 0xff) >> 3) << 11) | // R
|
|
689
|
+
((((inPixel32[i] >> 8) & 0xff) >> 2) << 5) | // G
|
|
690
|
+
((((inPixel32[i] >> 16) & 0xff) >> 3) << 0); // B
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
else {
|
|
694
|
+
// Convert "RRRRRRRRRGGGGGGGGBBBBBBBB" to "RRRRRGGGGGGBBBBB"
|
|
695
|
+
tempData = new Uint16Array(width * height);
|
|
696
|
+
inPixel8 = uiImage.getData();
|
|
697
|
+
for (i = 0; i < length; ++i) {
|
|
698
|
+
tempData[i] =
|
|
699
|
+
(((inPixel8[i] & 0xff) >> 3) << 11) | // R
|
|
700
|
+
(((inPixel8[i] & 0xff) >> 2) << 5) | // G
|
|
701
|
+
(((inPixel8[i] & 0xff) >> 3) << 0); // B
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
else if (pixelFormat === Texture2D.PIXEL_FORMAT_RGBA4444) {
|
|
706
|
+
tempData = new Uint16Array(width * height);
|
|
707
|
+
inPixel32 = uiImage.getData();
|
|
708
|
+
for (i = 0; i < length; ++i) {
|
|
709
|
+
tempData[i] =
|
|
710
|
+
((((inPixel32[i] >> 0) & 0xff) >> 4) << 12) | // R
|
|
711
|
+
((((inPixel32[i] >> 8) & 0xff) >> 4) << 8) | // G
|
|
712
|
+
((((inPixel32[i] >> 16) & 0xff) >> 4) << 4) | // B
|
|
713
|
+
((((inPixel32[i] >> 24) & 0xff) >> 4) << 0); // A
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
else if (pixelFormat === Texture2D.PIXEL_FORMAT_RGB5A1) {
|
|
717
|
+
tempData = new Uint16Array(width * height);
|
|
718
|
+
inPixel32 = uiImage.getData();
|
|
719
|
+
for (i = 0; i < length; ++i) {
|
|
720
|
+
tempData[i] =
|
|
721
|
+
((((inPixel32[i] >> 0) & 0xff) >> 3) << 11) | // R
|
|
722
|
+
((((inPixel32[i] >> 8) & 0xff) >> 3) << 6) | // G
|
|
723
|
+
((((inPixel32[i] >> 16) & 0xff) >> 3) << 1) | // B
|
|
724
|
+
((((inPixel32[i] >> 24) & 0xff) >> 7) << 0); // A
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
else if (pixelFormat === Texture2D.PIXEL_FORMAT_A8) {
|
|
728
|
+
tempData = new Uint8Array(width * height);
|
|
729
|
+
inPixel32 = uiImage.getData();
|
|
730
|
+
for (i = 0; i < length; ++i) {
|
|
731
|
+
tempData[i] = (inPixel32 >> 24) & 0xff; // A
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
if (hasAlpha && pixelFormat === Texture2D.PIXEL_FORMAT_RGB888) {
|
|
735
|
+
inPixel32 = uiImage.getData();
|
|
736
|
+
tempData = new Uint8Array(width * height * 3);
|
|
737
|
+
for (i = 0; i < length; ++i) {
|
|
738
|
+
tempData[i * 3] = (inPixel32 >> 0) & 0xff; // R
|
|
739
|
+
tempData[i * 3 + 1] = (inPixel32 >> 8) & 0xff; // G
|
|
740
|
+
tempData[i * 3 + 2] = (inPixel32 >> 16) & 0xff; // B
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
this.initWithData(tempData, pixelFormat, width, height, imageSize);
|
|
744
|
+
// if (tempData != uiImage.getData()) tempData = null
|
|
745
|
+
this._hasPremultipliedAlpha = uiImage.isPremultipliedAlpha();
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* add listener for loaded event
|
|
750
|
+
* @param {Function} callback
|
|
751
|
+
* @param {Node} target
|
|
752
|
+
* @deprecated since 3.1, please use addEventListener instead
|
|
753
|
+
*/
|
|
754
|
+
addLoadedEventListener(callback, target) {
|
|
755
|
+
this.addEventListener('load', callback, target);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* remove listener from listeners by target
|
|
759
|
+
* @param {Node} target
|
|
760
|
+
*/
|
|
761
|
+
removeLoadedEventListener(target) {
|
|
762
|
+
this.removeEventTarget('load', target);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
//# sourceMappingURL=TexturesWebGL.js.map
|