@galacean/engine-core 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +15448 -13299
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +15448 -13299
- package/dist/module.js +15434 -13295
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
- package/types/2d/atlas/SpriteAtlas.d.ts +2 -6
- package/types/2d/data/VertexData2D.d.ts +1 -0
- package/types/2d/enums/SpriteDrawMode.d.ts +4 -2
- package/types/2d/enums/SpriteTileMode.d.ts +11 -0
- package/types/2d/index.d.ts +1 -0
- package/types/2d/sprite/Sprite.d.ts +17 -8
- package/types/2d/sprite/SpriteMask.d.ts +16 -22
- package/types/2d/sprite/SpriteRenderer.d.ts +31 -17
- package/types/2d/text/Font.d.ts +2 -7
- package/types/2d/text/TextRenderer.d.ts +1 -13
- package/types/2d/text/index.d.ts +1 -0
- package/types/Camera.d.ts +32 -10
- package/types/Component.d.ts +0 -8
- package/types/ComponentsDependencies.d.ts +17 -9
- package/types/ComponentsManager.d.ts +3 -2
- package/types/DisorderedArray.d.ts +4 -3
- package/types/Engine.d.ts +35 -43
- package/types/Entity.d.ts +2 -2
- package/types/RenderPipeline/Basic2DBatcher.d.ts +6 -7
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +8 -6
- package/types/RenderPipeline/ClassPool.d.ts +3 -1
- package/types/RenderPipeline/CullingResults.d.ts +1 -0
- package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
- package/types/RenderPipeline/IPoolElement.d.ts +3 -0
- package/types/RenderPipeline/MeshRenderData.d.ts +17 -0
- package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
- package/types/RenderPipeline/PipelinePass.d.ts +16 -0
- package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
- package/types/RenderPipeline/RenderData.d.ts +7 -0
- package/types/RenderPipeline/RenderElement.d.ts +8 -8
- package/types/RenderPipeline/RenderElementX.d.ts +12 -0
- package/types/RenderPipeline/RenderPass.d.ts +1 -1
- package/types/RenderPipeline/RenderQueue.d.ts +3 -5
- package/types/RenderPipeline/SpriteElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteMaskBatcher.d.ts +4 -3
- package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
- package/types/RenderPipeline/SpriteMaskRenderData.d.ts +12 -0
- package/types/RenderPipeline/SpriteRenderData.d.ts +14 -0
- package/types/RenderPipeline/TextRenderData.d.ts +8 -0
- package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
- package/types/RenderPipeline/enums/PipelineStage.d.ts +9 -0
- package/types/RenderPipeline/index.d.ts +4 -0
- package/types/Renderer.d.ts +10 -15
- package/types/SafeLoopArray.d.ts +37 -0
- package/types/Scene.d.ts +13 -5
- package/types/Script.d.ts +18 -15
- package/types/Ticker.d.ts +30 -0
- package/types/Transform.d.ts +10 -12
- package/types/Utils.d.ts +28 -0
- package/types/animation/AnimationClip.d.ts +2 -1
- package/types/animation/Animator.d.ts +7 -4
- package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +0 -1
- package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
- package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
- package/types/animation/enums/LayerState.d.ts +3 -1
- package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
- package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
- package/types/asset/AssetType.d.ts +16 -16
- package/types/asset/ContentRestorer.d.ts +17 -0
- package/types/asset/GraphicsResource.d.ts +5 -0
- package/types/asset/IReferable.d.ts +2 -0
- package/types/asset/LoadItem.d.ts +16 -9
- package/types/asset/ReferResource.d.ts +22 -0
- package/types/asset/ResourceManager.d.ts +17 -9
- package/types/asset/request.d.ts +7 -3
- package/types/base/Constant.d.ts +2 -1
- package/types/base/EngineObject.d.ts +1 -0
- package/types/base/EventDispatcher.d.ts +2 -15
- package/types/base/Time.d.ts +27 -24
- package/types/base/index.d.ts +0 -2
- package/types/enums/ActiveChangeFlag.d.ts +6 -0
- package/types/enums/DepthTextureMode.d.ts +7 -0
- package/types/env-probe/CubeProbe.d.ts +0 -7
- package/types/env-probe/Probe.d.ts +0 -6
- package/types/graphic/Buffer.d.ts +5 -12
- package/types/graphic/Mesh.d.ts +5 -16
- package/types/graphic/Primitive.d.ts +1 -0
- package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
- package/types/graphic/SubMesh.d.ts +3 -1
- package/types/graphic/SubPrimitive.d.ts +9 -0
- package/types/index.d.ts +8 -7
- package/types/input/InputManager.d.ts +1 -1
- package/types/input/interface/IInput.d.ts +1 -1
- package/types/lighting/AmbientLight.d.ts +4 -1
- package/types/lighting/DirectLight.d.ts +0 -1
- package/types/lighting/Light.d.ts +0 -1
- package/types/lighting/LightManager.d.ts +1 -0
- package/types/lighting/SpotLight.d.ts +0 -1
- package/types/material/BaseMaterial.d.ts +8 -10
- package/types/material/BlinnPhongMaterial.d.ts +0 -3
- package/types/material/Material.d.ts +8 -8
- package/types/material/PBRMaterial.d.ts +12 -3
- package/types/material/PBRSpecularMaterial.d.ts +1 -1
- package/types/material/UnlitMaterial.d.ts +1 -1
- package/types/mesh/BlendShape.d.ts +1 -1
- package/types/mesh/BlendShapeFrame.d.ts +28 -6
- package/types/mesh/MeshRenderer.d.ts +7 -12
- package/types/mesh/ModelMesh.d.ts +5 -5
- package/types/mesh/PrimitiveMesh.d.ts +4 -2
- package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +0 -14
- package/types/particle/ParticleBufferUtils.d.ts +1 -0
- package/types/particle/ParticleData.d.ts +1 -0
- package/types/particle/ParticleGenerator.d.ts +72 -0
- package/types/particle/ParticleMaterial.d.ts +28 -0
- package/types/particle/ParticleMesh.d.ts +289 -0
- package/types/particle/ParticleRenderer.d.ts +2 -2
- package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
- package/types/particle/ParticleShaderMacro.d.ts +1 -0
- package/types/particle/ParticleShaderProperty.d.ts +1 -0
- package/types/particle/ParticleSystem.d.ts +41 -0
- package/types/particle/ParticleVertexElements.d.ts +1 -0
- package/types/particle/ParticleVertexUtils.d.ts +1 -0
- package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
- package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
- package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
- package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
- package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/enum/ParticleShapeType.d.ts +15 -0
- package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enum/index.d.ts +9 -0
- package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
- package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
- package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enums/ParticleStopMode.d.ts +6 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
- package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
- package/types/particle/module/Burst.d.ts +38 -0
- package/types/particle/module/ColorGradient.d.ts +75 -0
- package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/module/EmissionModule.d.ts +63 -0
- package/types/particle/module/FrameOverTime.d.ts +73 -0
- package/types/particle/module/ParticleCurve.d.ts +37 -0
- package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
- package/types/particle/module/SizeGradient.d.ts +151 -0
- package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/StartFrame.d.ts +46 -0
- package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
- package/types/particle/module/VelocityGradient.d.ts +110 -0
- package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
- package/types/particle/module/index.d.ts +15 -0
- package/types/particle/module/shape/BaseShape.d.ts +26 -0
- package/types/particle/module/shape/BoxShape.d.ts +20 -0
- package/types/particle/module/shape/CircleShape.d.ts +27 -0
- package/types/particle/module/shape/ConeShape.d.ts +35 -0
- package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/module/shape/SphereShape.d.ts +23 -0
- package/types/particle/module/shape/index.d.ts +5 -0
- package/types/particle/modules/Burst.d.ts +14 -0
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/modules/EmissionModule.d.ts +45 -0
- package/types/particle/modules/MainModule.d.ts +70 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
- package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
- package/types/particle/modules/ParticleCurve.d.ts +56 -0
- package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
- package/types/particle/modules/ParticleGradient.d.ts +94 -0
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/ShapeModule.d.ts +9 -0
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +38 -0
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/shape/BaseShape.d.ts +12 -0
- package/types/particle/modules/shape/BoxShape.d.ts +11 -0
- package/types/particle/modules/shape/CircleShape.d.ts +17 -0
- package/types/particle/modules/shape/ConeShape.d.ts +28 -0
- package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
- package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/modules/shape/SphereShape.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/modules/shape/index.d.ts +6 -0
- package/types/particle/moudules/Burst.d.ts +25 -0
- package/types/particle/moudules/Emission.d.ts +47 -0
- package/types/particle/moudules/EmissionModule.d.ts +49 -0
- package/types/particle/moudules/MainModule.d.ts +59 -0
- package/types/particle/moudules/ParticleCurve.d.ts +27 -0
- package/types/particle/moudules/ParticleGradient.d.ts +28 -0
- package/types/particle/moudules/ShapeModule.d.ts +7 -0
- package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
- package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
- package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
- package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
- package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/moudules/shape/index.d.ts +5 -0
- package/types/physics/CharacterController.d.ts +0 -2
- package/types/physics/Collider.d.ts +1 -1
- package/types/physics/Collision.d.ts +4 -0
- package/types/physics/PhysicsManager.d.ts +5 -22
- package/types/physics/PhysicsScene.d.ts +79 -0
- package/types/physics/joint/HingeJoint.d.ts +2 -2
- package/types/physics/joint/Joint.d.ts +2 -2
- package/types/physics/joint/SpringJoint.d.ts +1 -1
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +8 -0
- package/types/renderingHardwareInterface/index.d.ts +1 -0
- package/types/shader/Shader.d.ts +32 -23
- package/types/shader/ShaderData.d.ts +24 -24
- package/types/shader/ShaderMacro.d.ts +16 -0
- package/types/shader/ShaderPart.d.ts +41 -0
- package/types/shader/ShaderPass.d.ts +9 -2
- package/types/shader/ShaderProperty.d.ts +7 -0
- package/types/shader/ShaderTagKey.d.ts +16 -0
- package/types/shader/SubShader.d.ts +19 -0
- package/types/shader/enums/RenderStateElementKey.d.ts +60 -0
- package/types/shader/index.d.ts +5 -1
- package/types/shader/state/index.d.ts +6 -0
- package/types/shaderlib/particle/index.d.ts +14 -0
- package/types/shadow/CascadedShadowCasterPass.d.ts +1 -1
- package/types/shadow/PipelinePass.d.ts +16 -0
- package/types/sky/Sky.d.ts +12 -4
- package/types/sky/SkyBoxMaterial.d.ts +27 -9
- package/types/sky/SkyProceduralMaterial.d.ts +72 -0
- package/types/sky/index.d.ts +1 -0
- package/types/texture/RenderTarget.d.ts +2 -6
- package/types/texture/Texture.d.ts +8 -6
- package/types/texture/Texture2D.d.ts +3 -1
- package/types/texture/enums/TextureUsage.d.ts +9 -0
- package/types/texture/index.d.ts +1 -0
- package/types/trail/TrailRenderer.d.ts +0 -5
- package/types/utils/BoolUpdateFlag.d.ts +12 -0
- package/types/utils/DisorderedArray.d.ts +18 -0
- package/types/utils/SafeLoopArray.d.ts +41 -0
- package/types/utils/UpdateFlag.d.ts +20 -0
- package/types/utils/UpdateFlagManager.d.ts +1 -0
- package/types/utils/Utils.d.ts +31 -0
- package/types/xr/XRManager.d.ts +31 -0
- package/types/xr/component/XRPoseDriver.d.ts +10 -0
- package/types/xr/data/XRCamera.d.ts +6 -0
- package/types/xr/data/XRDevice.d.ts +9 -0
- package/types/xr/data/XRHandle.d.ts +10 -0
- package/types/xr/enum/EnumXRButton.d.ts +5 -0
- package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
- package/types/xr/enum/EnumXRFeature.d.ts +9 -0
- package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
- package/types/xr/enum/EnumXRMode.d.ts +7 -0
- package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
- package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
- package/types/xr/feature/XRCameraManager.d.ts +21 -0
- package/types/xr/feature/XRFeature.d.ts +29 -0
- package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
- package/types/xr/feature/XRInputManager.d.ts +16 -0
- package/types/xr/index.d.ts +18 -0
- package/types/xr/provider/XRProvider.d.ts +19 -0
- package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
- package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-math": "1.0.
|
|
18
|
+
"@galacean/engine-math": "1.0.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.0.
|
|
21
|
+
"@galacean/engine-design": "1.0.2"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReferResource } from "../../asset/ReferResource";
|
|
2
2
|
import { Engine } from "../../Engine";
|
|
3
3
|
import { Sprite } from "../sprite/Sprite";
|
|
4
4
|
/**
|
|
5
5
|
* Sprite Atlas.
|
|
6
6
|
*/
|
|
7
|
-
export declare class SpriteAtlas extends
|
|
7
|
+
export declare class SpriteAtlas extends ReferResource {
|
|
8
8
|
private _sprites;
|
|
9
9
|
private _spriteNamesToIndex;
|
|
10
10
|
/**
|
|
@@ -29,8 +29,4 @@ export declare class SpriteAtlas extends RefObject {
|
|
|
29
29
|
* @param engine - Engine to which the SpriteAtlas belongs
|
|
30
30
|
*/
|
|
31
31
|
constructor(engine: Engine);
|
|
32
|
-
/**
|
|
33
|
-
* @override
|
|
34
|
-
*/
|
|
35
|
-
_onDestroy(): void;
|
|
36
32
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
export declare enum SpriteDrawMode {
|
|
5
5
|
/** Overall scaling when modifying size. */
|
|
6
6
|
Simple = 0,
|
|
7
|
-
/** When modifying the size, it
|
|
8
|
-
Sliced = 1
|
|
7
|
+
/** When modifying the size of the renderer, it scales to fill the range according to the sprite border settings. */
|
|
8
|
+
Sliced = 1,
|
|
9
|
+
/** When modifying the size of the renderer, it will tile to fill the range according to the sprite border settings. */
|
|
10
|
+
Tiled = 2
|
|
9
11
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sprite's tiling mode enumeration.
|
|
3
|
+
* Only works in `SpriteDrawMode.tiled` mode.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum SpriteTileMode {
|
|
6
|
+
/** SpriteRenderer will tile continuously. */
|
|
7
|
+
Continuous = 0,
|
|
8
|
+
/** When the fractional part of the tiling multiple is greater than or equal to `SpriteRenderer.tileStretchValue`,
|
|
9
|
+
* a tile will be added,and the number of tiles can only be an integer. */
|
|
10
|
+
Adaptive = 1
|
|
11
|
+
}
|
package/types/2d/index.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export { OverflowMode } from "./enums/TextOverflow";
|
|
|
5
5
|
export { FontStyle } from "./enums/FontStyle";
|
|
6
6
|
export { SpriteAtlas } from "./atlas/SpriteAtlas";
|
|
7
7
|
export { SpriteDrawMode } from "./enums/SpriteDrawMode";
|
|
8
|
+
export { SpriteTileMode } from "./enums/SpriteTileMode";
|
|
8
9
|
export * from "./sprite/index";
|
|
9
10
|
export * from "./text/index";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Rect, Vector2, Vector4 } from "@galacean/engine-math";
|
|
2
|
-
import { RefObject } from "../../asset/RefObject";
|
|
3
2
|
import { Engine } from "../../Engine";
|
|
3
|
+
import { ReferResource } from "../../asset/ReferResource";
|
|
4
4
|
import { Texture2D } from "../../texture/Texture2D";
|
|
5
5
|
/**
|
|
6
6
|
* 2D sprite.
|
|
7
7
|
*/
|
|
8
|
-
export declare class Sprite extends
|
|
8
|
+
export declare class Sprite extends ReferResource {
|
|
9
9
|
/** The name of sprite. */
|
|
10
10
|
name: string;
|
|
11
|
-
private
|
|
12
|
-
private
|
|
11
|
+
private _automaticWidth;
|
|
12
|
+
private _automaticHeight;
|
|
13
|
+
private _customWidth;
|
|
14
|
+
private _customHeight;
|
|
13
15
|
private _positions;
|
|
14
16
|
private _uvs;
|
|
15
17
|
private _bounds;
|
|
@@ -28,11 +30,19 @@ export declare class Sprite extends RefObject {
|
|
|
28
30
|
set texture(value: Texture2D);
|
|
29
31
|
/**
|
|
30
32
|
* The width of the sprite (in world coordinates).
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* If width is set, return the set value,
|
|
36
|
+
* otherwise return the width calculated according to `Texture.width`, `Sprite.region`, `Sprite.atlasRegion`, `Sprite.atlasRegionOffset` and `Engine._pixelsPerUnit`.
|
|
31
37
|
*/
|
|
32
38
|
get width(): number;
|
|
33
39
|
set width(value: number);
|
|
34
40
|
/**
|
|
35
41
|
* The height of the sprite (in world coordinates).
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* If height is set, return the set value,
|
|
45
|
+
* otherwise return the height calculated according to `Texture.height`, `Sprite.region`, `Sprite.atlasRegion`, `Sprite.atlasRegionOffset` and `Engine._pixelsPerUnit`.
|
|
36
46
|
*/
|
|
37
47
|
get height(): number;
|
|
38
48
|
set height(value: number);
|
|
@@ -86,12 +96,11 @@ export declare class Sprite extends RefObject {
|
|
|
86
96
|
* @returns Cloned sprite
|
|
87
97
|
*/
|
|
88
98
|
clone(): Sprite;
|
|
89
|
-
/**
|
|
90
|
-
* @override
|
|
91
|
-
*/
|
|
92
|
-
_onDestroy(): void;
|
|
93
99
|
private _calDefaultSize;
|
|
94
100
|
private _updatePositions;
|
|
95
101
|
private _updateUVs;
|
|
96
102
|
private _dispatchSpriteChange;
|
|
103
|
+
private _onRegionChange;
|
|
104
|
+
private _onPivotChange;
|
|
105
|
+
private _onBorderChange;
|
|
97
106
|
}
|
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
import { BoundingBox } from "@galacean/engine-math";
|
|
2
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
3
1
|
import { Renderer } from "../../Renderer";
|
|
4
|
-
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
5
2
|
import { Sprite } from "./Sprite";
|
|
6
3
|
/**
|
|
7
4
|
* A component for masking Sprites.
|
|
8
5
|
*/
|
|
9
|
-
export declare class SpriteMask extends Renderer
|
|
6
|
+
export declare class SpriteMask extends Renderer {
|
|
10
7
|
/** The mask layers the sprite mask influence to. */
|
|
11
8
|
influenceLayers: number;
|
|
12
9
|
private _sprite;
|
|
13
|
-
private
|
|
14
|
-
private
|
|
10
|
+
private _automaticWidth;
|
|
11
|
+
private _automaticHeight;
|
|
12
|
+
private _customWidth;
|
|
13
|
+
private _customHeight;
|
|
15
14
|
private _flipX;
|
|
16
15
|
private _flipY;
|
|
17
16
|
private _alphaCutoff;
|
|
18
17
|
/**
|
|
19
|
-
* Render width.
|
|
18
|
+
* Render width (in world coordinates).
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* If width is set, return the set value,
|
|
22
|
+
* otherwise return `SpriteMask.sprite.width`.
|
|
20
23
|
*/
|
|
21
24
|
get width(): number;
|
|
22
25
|
set width(value: number);
|
|
23
26
|
/**
|
|
24
|
-
* Render height.
|
|
27
|
+
* Render height (in world coordinates).
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* If height is set, return the set value,
|
|
31
|
+
* otherwise return `SpriteMask.sprite.height`.
|
|
25
32
|
*/
|
|
26
33
|
get height(): number;
|
|
27
34
|
set height(value: number);
|
|
@@ -45,19 +52,6 @@ export declare class SpriteMask extends Renderer implements ICustomClone {
|
|
|
45
52
|
*/
|
|
46
53
|
get alphaCutoff(): number;
|
|
47
54
|
set alphaCutoff(value: number);
|
|
48
|
-
|
|
49
|
-
* @override
|
|
50
|
-
* @inheritdoc
|
|
51
|
-
*/
|
|
52
|
-
_onDestroy(): void;
|
|
53
|
-
/**
|
|
54
|
-
* @override
|
|
55
|
-
*/
|
|
56
|
-
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
57
|
-
/**
|
|
58
|
-
* @override
|
|
59
|
-
* @inheritdoc
|
|
60
|
-
*/
|
|
61
|
-
protected _render(context: RenderContext): void;
|
|
55
|
+
private _calDefaultSize;
|
|
62
56
|
private _onSpriteChange;
|
|
63
57
|
}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
1
|
+
import { Color } from "@galacean/engine-math";
|
|
3
2
|
import { Renderer } from "../../Renderer";
|
|
4
|
-
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
5
3
|
import { SpriteDrawMode } from "../enums/SpriteDrawMode";
|
|
6
4
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
5
|
+
import { SpriteTileMode } from "../enums/SpriteTileMode";
|
|
7
6
|
import { Sprite } from "./Sprite";
|
|
8
7
|
/**
|
|
9
8
|
* Renders a Sprite for 2D graphics.
|
|
10
9
|
*/
|
|
11
|
-
export declare class SpriteRenderer extends Renderer
|
|
10
|
+
export declare class SpriteRenderer extends Renderer {
|
|
12
11
|
private _drawMode;
|
|
13
12
|
private _assembler;
|
|
13
|
+
private _tileMode;
|
|
14
|
+
private _tiledAdaptiveThreshold;
|
|
14
15
|
private _color;
|
|
15
16
|
private _sprite;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
17
|
+
private _automaticWidth;
|
|
18
|
+
private _automaticHeight;
|
|
19
|
+
private _customWidth;
|
|
20
|
+
private _customHeight;
|
|
18
21
|
private _flipX;
|
|
19
22
|
private _flipY;
|
|
20
23
|
private _maskLayer;
|
|
@@ -23,7 +26,17 @@ export declare class SpriteRenderer extends Renderer implements ICustomClone {
|
|
|
23
26
|
* The draw mode of the sprite renderer.
|
|
24
27
|
*/
|
|
25
28
|
get drawMode(): SpriteDrawMode;
|
|
26
|
-
set drawMode(
|
|
29
|
+
set drawMode(value: SpriteDrawMode);
|
|
30
|
+
/**
|
|
31
|
+
* The tiling mode of the sprite renderer. (Only works in tiled mode.)
|
|
32
|
+
*/
|
|
33
|
+
get tileMode(): SpriteTileMode;
|
|
34
|
+
set tileMode(value: SpriteTileMode);
|
|
35
|
+
/**
|
|
36
|
+
* Stretch Threshold in Tile Adaptive Mode, specified in normalized. (Only works in tiled adaptive mode.)
|
|
37
|
+
*/
|
|
38
|
+
get tiledAdaptiveThreshold(): number;
|
|
39
|
+
set tiledAdaptiveThreshold(value: number);
|
|
27
40
|
/**
|
|
28
41
|
* The Sprite to render.
|
|
29
42
|
*/
|
|
@@ -35,12 +48,20 @@ export declare class SpriteRenderer extends Renderer implements ICustomClone {
|
|
|
35
48
|
get color(): Color;
|
|
36
49
|
set color(value: Color);
|
|
37
50
|
/**
|
|
38
|
-
* Render width.
|
|
51
|
+
* Render width (in world coordinates).
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* If width is set, return the set value,
|
|
55
|
+
* otherwise return `SpriteRenderer.sprite.width`.
|
|
39
56
|
*/
|
|
40
57
|
get width(): number;
|
|
41
58
|
set width(value: number);
|
|
42
59
|
/**
|
|
43
|
-
* Render height.
|
|
60
|
+
* Render height (in world coordinates).
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* If height is set, return the set value,
|
|
64
|
+
* otherwise return `SpriteRenderer.sprite.height`.
|
|
44
65
|
*/
|
|
45
66
|
get height(): number;
|
|
46
67
|
set height(value: number);
|
|
@@ -64,14 +85,7 @@ export declare class SpriteRenderer extends Renderer implements ICustomClone {
|
|
|
64
85
|
*/
|
|
65
86
|
get maskInteraction(): SpriteMaskInteraction;
|
|
66
87
|
set maskInteraction(value: SpriteMaskInteraction);
|
|
67
|
-
|
|
68
|
-
* @override
|
|
69
|
-
*/
|
|
70
|
-
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
71
|
-
/**
|
|
72
|
-
* @override
|
|
73
|
-
*/
|
|
74
|
-
protected _render(context: RenderContext): void;
|
|
88
|
+
private _calDefaultSize;
|
|
75
89
|
private _updateStencilState;
|
|
76
90
|
private _onSpriteChange;
|
|
77
91
|
}
|
package/types/2d/text/Font.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReferResource } from "../../asset/ReferResource";
|
|
2
2
|
import { Engine } from "../../Engine";
|
|
3
3
|
/**
|
|
4
4
|
* Font.
|
|
5
5
|
*/
|
|
6
|
-
export declare class Font extends
|
|
7
|
-
private static _fontMap;
|
|
6
|
+
export declare class Font extends ReferResource {
|
|
8
7
|
/**
|
|
9
8
|
* Create a system font.
|
|
10
9
|
* @param engine - Engine to which the font belongs
|
|
@@ -19,8 +18,4 @@ export declare class Font extends RefObject {
|
|
|
19
18
|
*/
|
|
20
19
|
get name(): string;
|
|
21
20
|
constructor(engine: Engine, name?: string);
|
|
22
|
-
/**
|
|
23
|
-
* @override
|
|
24
|
-
*/
|
|
25
|
-
_onDestroy(): void;
|
|
26
21
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { BoundingBox, Color } from "@galacean/engine-math";
|
|
2
|
-
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
3
2
|
import { Entity } from "../../Entity";
|
|
4
3
|
import { Renderer } from "../../Renderer";
|
|
5
|
-
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
6
|
-
import { TransformModifyFlags } from "../../Transform";
|
|
7
4
|
import { FontStyle } from "../enums/FontStyle";
|
|
8
5
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
9
6
|
import { TextHorizontalAlignment, TextVerticalAlignment } from "../enums/TextAlignment";
|
|
@@ -12,7 +9,7 @@ import { Font } from "./Font";
|
|
|
12
9
|
/**
|
|
13
10
|
* Renders a text for 2D graphics.
|
|
14
11
|
*/
|
|
15
|
-
export declare class TextRenderer extends Renderer
|
|
12
|
+
export declare class TextRenderer extends Renderer {
|
|
16
13
|
private static _charRenderDataPool;
|
|
17
14
|
private static _tempVec30;
|
|
18
15
|
private static _tempVec31;
|
|
@@ -107,17 +104,8 @@ export declare class TextRenderer extends Renderer implements ICustomClone {
|
|
|
107
104
|
*/
|
|
108
105
|
get bounds(): BoundingBox;
|
|
109
106
|
constructor(entity: Entity);
|
|
110
|
-
/**
|
|
111
|
-
* @override
|
|
112
|
-
*/
|
|
113
|
-
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
114
|
-
/**
|
|
115
|
-
* @override
|
|
116
|
-
*/
|
|
117
|
-
protected _render(context: RenderContext): void;
|
|
118
107
|
private _updateStencilState;
|
|
119
108
|
private _resetSubFont;
|
|
120
109
|
private _updatePosition;
|
|
121
110
|
private _updateLocalData;
|
|
122
|
-
protected _onTransformChanged(bit: TransformModifyFlags): void;
|
|
123
111
|
}
|
package/types/2d/text/index.d.ts
CHANGED
package/types/Camera.d.ts
CHANGED
|
@@ -2,16 +2,16 @@ import { Matrix, Ray, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
4
4
|
import { Layer } from "./Layer";
|
|
5
|
+
import { Shader } from "./shader/Shader";
|
|
5
6
|
import { ShaderData } from "./shader/ShaderData";
|
|
7
|
+
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
6
8
|
import { TextureCubeFace } from "./texture/enums/TextureCubeFace";
|
|
7
9
|
import { RenderTarget } from "./texture/RenderTarget";
|
|
8
10
|
/**
|
|
9
11
|
* Camera component, as the entrance to the three-dimensional world.
|
|
10
|
-
* @decorator `@dependentComponents(Transform)`
|
|
12
|
+
* @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
|
|
11
13
|
*/
|
|
12
14
|
export declare class Camera extends Component {
|
|
13
|
-
/** Shader data. */
|
|
14
|
-
readonly shaderData: ShaderData;
|
|
15
15
|
/** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */
|
|
16
16
|
priority: number;
|
|
17
17
|
/** Whether to enable frustum culling, it is enabled by default. */
|
|
@@ -26,6 +26,7 @@ export declare class Camera extends Component {
|
|
|
26
26
|
* @remarks Support bit manipulation, corresponding to `Layer`.
|
|
27
27
|
*/
|
|
28
28
|
cullingMask: Layer;
|
|
29
|
+
private _shaderData;
|
|
29
30
|
private _isProjMatSetting;
|
|
30
31
|
private _nearClipPlane;
|
|
31
32
|
private _farClipPlane;
|
|
@@ -44,6 +45,10 @@ export declare class Camera extends Component {
|
|
|
44
45
|
private _inverseProjectionMatrix;
|
|
45
46
|
private _lastAspectSize;
|
|
46
47
|
private _invViewProjMat;
|
|
48
|
+
/**
|
|
49
|
+
* Shader data.
|
|
50
|
+
*/
|
|
51
|
+
get shaderData(): ShaderData;
|
|
47
52
|
/**
|
|
48
53
|
* Near clip plane - the closest point to the camera when rendering occurs.
|
|
49
54
|
*/
|
|
@@ -178,20 +183,37 @@ export declare class Camera extends Component {
|
|
|
178
183
|
*/
|
|
179
184
|
render(cubeFace?: TextureCubeFace, mipLevel?: number): void;
|
|
180
185
|
/**
|
|
181
|
-
*
|
|
182
|
-
* @
|
|
186
|
+
* Set the replacement shader.
|
|
187
|
+
* @param shader - Replacement shader
|
|
188
|
+
* @param replacementTagName - Sub shader tag name
|
|
189
|
+
*
|
|
190
|
+
* @remarks
|
|
191
|
+
* If replacementTagName is not specified, the first sub shader will be replaced.
|
|
192
|
+
* If replacementTagName is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
183
193
|
*/
|
|
184
|
-
|
|
194
|
+
setReplacementShader(shader: Shader, replacementTagName?: string): any;
|
|
195
|
+
/**
|
|
196
|
+
* Set the replacement shader.
|
|
197
|
+
* @param shader - Replacement shader
|
|
198
|
+
* @param replacementTag - Sub shader tag
|
|
199
|
+
*
|
|
200
|
+
* @remarks
|
|
201
|
+
* If replacementTag is not specified, the first sub shader will be replaced.
|
|
202
|
+
* If replacementTag is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
203
|
+
*/
|
|
204
|
+
setReplacementShader(shader: Shader, replacementTag?: ShaderTagKey): any;
|
|
205
|
+
/**
|
|
206
|
+
* Reset and clear the replacement shader.
|
|
207
|
+
*/
|
|
208
|
+
resetReplacementShader(): void;
|
|
185
209
|
/**
|
|
186
|
-
* @override
|
|
187
210
|
* @inheritdoc
|
|
188
211
|
*/
|
|
189
|
-
|
|
212
|
+
_onEnable(): void;
|
|
190
213
|
/**
|
|
191
|
-
* @override
|
|
192
214
|
* @inheritdoc
|
|
193
215
|
*/
|
|
194
|
-
|
|
216
|
+
_onDisable(): void;
|
|
195
217
|
private _projMatChange;
|
|
196
218
|
private _innerViewportToWorldPoint;
|
|
197
219
|
private _updateShaderData;
|
package/types/Component.d.ts
CHANGED
|
@@ -12,10 +12,6 @@ export declare class Component extends EngineObject {
|
|
|
12
12
|
*/
|
|
13
13
|
get enabled(): boolean;
|
|
14
14
|
set enabled(value: boolean);
|
|
15
|
-
/**
|
|
16
|
-
* Indicates whether the component is destroyed.
|
|
17
|
-
*/
|
|
18
|
-
get destroyed(): boolean;
|
|
19
15
|
/**
|
|
20
16
|
* The entity which the component belongs to.
|
|
21
17
|
*/
|
|
@@ -25,8 +21,4 @@ export declare class Component extends EngineObject {
|
|
|
25
21
|
*/
|
|
26
22
|
get scene(): Scene;
|
|
27
23
|
constructor(entity: Entity);
|
|
28
|
-
/**
|
|
29
|
-
* Destroy this instance.
|
|
30
|
-
*/
|
|
31
|
-
destroy(): void;
|
|
32
24
|
}
|
|
@@ -2,16 +2,24 @@ import { Component } from "./Component";
|
|
|
2
2
|
import { Entity } from "./Entity";
|
|
3
3
|
type ComponentConstructor = new (entity: Entity) => Component;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Declare dependent component.
|
|
6
|
+
* @param component - Dependent component
|
|
7
|
+
* @param dependentMode - Dependent mode
|
|
6
8
|
*/
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export declare function dependentComponents(component: ComponentConstructor, dependentMode?: DependentMode): any;
|
|
10
|
+
/**
|
|
11
|
+
* Declare dependent components.
|
|
12
|
+
* @param components - Dependent components
|
|
13
|
+
* @param dependentMode - Dependent mode
|
|
14
|
+
*/
|
|
15
|
+
export declare function dependentComponents(components: ComponentConstructor[], dependentMode?: DependentMode): any;
|
|
12
16
|
/**
|
|
13
|
-
* Dependent
|
|
14
|
-
* @param components - Dependent components
|
|
17
|
+
* Dependent mode.
|
|
15
18
|
*/
|
|
16
|
-
export declare
|
|
19
|
+
export declare enum DependentMode {
|
|
20
|
+
/** Check only, throw error if dependent components do not exist. */
|
|
21
|
+
CheckOnly = 0,
|
|
22
|
+
/** Auto add if dependent components do not exist. */
|
|
23
|
+
AutoAdd = 1
|
|
24
|
+
}
|
|
17
25
|
export {};
|
|
@@ -2,6 +2,7 @@ import { Camera } from "./Camera";
|
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { Renderer } from "./Renderer";
|
|
4
4
|
import { Script } from "./Script";
|
|
5
|
+
import { Animator } from "./animation";
|
|
5
6
|
/**
|
|
6
7
|
* The manager of the components.
|
|
7
8
|
*/
|
|
@@ -26,8 +27,8 @@ export declare class ComponentsManager {
|
|
|
26
27
|
removeOnLateUpdateScript(script: Script): void;
|
|
27
28
|
addOnPhysicsUpdateScript(script: Script): void;
|
|
28
29
|
removeOnPhysicsUpdateScript(script: Script): void;
|
|
29
|
-
addOnUpdateAnimations(animation:
|
|
30
|
-
removeOnUpdateAnimations(animation:
|
|
30
|
+
addOnUpdateAnimations(animation: Animator): void;
|
|
31
|
+
removeOnUpdateAnimations(animation: Animator): void;
|
|
31
32
|
addOnUpdateRenderers(renderer: Renderer): void;
|
|
32
33
|
removeOnUpdateRenderers(renderer: Renderer): void;
|
|
33
34
|
addDisableScript(component: Script): void;
|
|
@@ -7,11 +7,12 @@ export declare class DisorderedArray<T> {
|
|
|
7
7
|
constructor(count?: number);
|
|
8
8
|
add(element: T): void;
|
|
9
9
|
delete(element: T): void;
|
|
10
|
+
set(index: number, element: T): void;
|
|
10
11
|
get(index: number): T;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param index
|
|
14
|
-
* @returns The replaced item is used to reset its index
|
|
13
|
+
* Delete the element at the specified index.
|
|
14
|
+
* @param index - The index of the element to be deleted
|
|
15
|
+
* @returns The replaced item is used to reset its index
|
|
15
16
|
*/
|
|
16
17
|
deleteByIndex(index: number): T;
|
|
17
18
|
garbageCollection(): void;
|
package/types/Engine.d.ts
CHANGED
|
@@ -1,44 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ResourceManager } from "./asset/ResourceManager";
|
|
3
|
-
import { EventDispatcher, Time } from "./base";
|
|
1
|
+
import { IPhysics } from "@galacean/engine-design";
|
|
4
2
|
import { Canvas } from "./Canvas";
|
|
5
|
-
import { ComponentsManager } from "./ComponentsManager";
|
|
6
3
|
import { EngineSettings } from "./EngineSettings";
|
|
7
4
|
import { Entity } from "./Entity";
|
|
5
|
+
import { SceneManager } from "./SceneManager";
|
|
6
|
+
import { ResourceManager } from "./asset/ResourceManager";
|
|
7
|
+
import { EventDispatcher, Time } from "./base";
|
|
8
|
+
import { ColorSpace } from "./enums/ColorSpace";
|
|
8
9
|
import { InputManager } from "./input";
|
|
9
|
-
import { LightManager } from "./lighting/LightManager";
|
|
10
|
-
import { Material } from "./material/Material";
|
|
11
10
|
import { PhysicsManager } from "./physics";
|
|
12
11
|
import { IHardwareRenderer } from "./renderingHardwareInterface";
|
|
13
|
-
import { ClassPool } from "./RenderPipeline/ClassPool";
|
|
14
|
-
import { MeshRenderElement } from "./RenderPipeline/MeshRenderElement";
|
|
15
|
-
import { RenderContext } from "./RenderPipeline/RenderContext";
|
|
16
|
-
import { SpriteElement } from "./RenderPipeline/SpriteElement";
|
|
17
|
-
import { SpriteMaskElement } from "./RenderPipeline/SpriteMaskElement";
|
|
18
|
-
import { TextRenderElement } from "./RenderPipeline/TextRenderElement";
|
|
19
|
-
import { Scene } from "./Scene";
|
|
20
|
-
import { SceneManager } from "./SceneManager";
|
|
21
|
-
import { RenderState } from "./shader/state/RenderState";
|
|
22
12
|
/**
|
|
23
13
|
* Engine.
|
|
24
14
|
*/
|
|
25
15
|
export declare class Engine extends EventDispatcher {
|
|
26
16
|
/** Physics manager of Engine. */
|
|
27
17
|
readonly physicsManager: PhysicsManager;
|
|
18
|
+
/** Input manager of Engine. */
|
|
28
19
|
readonly inputManager: InputManager;
|
|
29
|
-
_lightManager: LightManager;
|
|
30
|
-
_componentsManager: ComponentsManager;
|
|
31
|
-
_hardwareRenderer: IHardwareRenderer;
|
|
32
|
-
_lastRenderState: RenderState;
|
|
33
|
-
_renderElementPool: ClassPool<MeshRenderElement>;
|
|
34
|
-
_spriteElementPool: ClassPool<SpriteElement>;
|
|
35
|
-
_spriteMaskElementPool: ClassPool<SpriteMaskElement>;
|
|
36
|
-
_textElementPool: ClassPool<TextRenderElement>;
|
|
37
|
-
_spriteDefaultMaterial: Material;
|
|
38
|
-
_spriteMaskDefaultMaterial: Material;
|
|
39
|
-
_textDefaultFont: Font;
|
|
40
|
-
_renderContext: RenderContext;
|
|
41
|
-
protected _canvas: Canvas;
|
|
42
20
|
private _settings;
|
|
43
21
|
private _resourceManager;
|
|
44
22
|
private _sceneManager;
|
|
@@ -52,7 +30,9 @@ export declare class Engine extends EventDispatcher {
|
|
|
52
30
|
private _targetFrameInterval;
|
|
53
31
|
private _destroyed;
|
|
54
32
|
private _frameInProcess;
|
|
55
|
-
private
|
|
33
|
+
private _waitingDestroy;
|
|
34
|
+
private _isDeviceLost;
|
|
35
|
+
private _waitingGC;
|
|
56
36
|
private _animate;
|
|
57
37
|
/**
|
|
58
38
|
* Settings of Engine.
|
|
@@ -63,15 +43,15 @@ export declare class Engine extends EventDispatcher {
|
|
|
63
43
|
*/
|
|
64
44
|
get canvas(): Canvas;
|
|
65
45
|
/**
|
|
66
|
-
*
|
|
46
|
+
* The resource manager.
|
|
67
47
|
*/
|
|
68
48
|
get resourceManager(): ResourceManager;
|
|
69
49
|
/**
|
|
70
|
-
*
|
|
50
|
+
* The scene manager.
|
|
71
51
|
*/
|
|
72
52
|
get sceneManager(): SceneManager;
|
|
73
53
|
/**
|
|
74
|
-
*
|
|
54
|
+
* The time information of the engine.
|
|
75
55
|
*/
|
|
76
56
|
get time(): Time;
|
|
77
57
|
/**
|
|
@@ -96,13 +76,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
96
76
|
* Indicates whether the engine is destroyed.
|
|
97
77
|
*/
|
|
98
78
|
get destroyed(): boolean;
|
|
99
|
-
|
|
100
|
-
* Create engine.
|
|
101
|
-
* @param canvas - The canvas to use for rendering
|
|
102
|
-
* @param hardwareRenderer - Graphics API renderer
|
|
103
|
-
* @param settings - Engine Settings
|
|
104
|
-
*/
|
|
105
|
-
constructor(canvas: Canvas, hardwareRenderer: IHardwareRenderer, settings?: EngineSettings);
|
|
79
|
+
protected constructor(canvas: Canvas, hardwareRenderer: IHardwareRenderer, configuration: EngineConfiguration);
|
|
106
80
|
/**
|
|
107
81
|
* Create an entity.
|
|
108
82
|
* @param name - The name of the entity
|
|
@@ -125,16 +99,34 @@ export declare class Engine extends EventDispatcher {
|
|
|
125
99
|
* Execution engine loop.
|
|
126
100
|
*/
|
|
127
101
|
run(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Force lose graphic device.
|
|
104
|
+
* @remarks Used to simulate the phenomenon after the real loss of device.
|
|
105
|
+
*/
|
|
106
|
+
forceLoseDevice(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Force restore graphic device.
|
|
109
|
+
* @remarks Used to simulate the phenomenon after the real restore of device.
|
|
110
|
+
*/
|
|
111
|
+
forceRestoreDevice(): void;
|
|
128
112
|
private _destroy;
|
|
129
113
|
/**
|
|
130
114
|
* Destroy engine.
|
|
131
115
|
* @remarks If call during frame execution will delay until the end of the frame
|
|
132
116
|
*/
|
|
133
117
|
destroy(): void;
|
|
134
|
-
/**
|
|
135
|
-
* @intenral
|
|
136
|
-
*/
|
|
137
|
-
_render(scene: Scene): void;
|
|
138
118
|
private _createSpriteMaterial;
|
|
139
119
|
private _createSpriteMaskMaterial;
|
|
120
|
+
private _onDeviceLost;
|
|
121
|
+
private _onDeviceRestored;
|
|
122
|
+
private _gc;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Engine configuration.
|
|
126
|
+
*/
|
|
127
|
+
export interface EngineConfiguration {
|
|
128
|
+
/** Physics. */
|
|
129
|
+
physics?: IPhysics;
|
|
130
|
+
/** Color space. */
|
|
131
|
+
colorSpace?: ColorSpace;
|
|
140
132
|
}
|