-
Notifications
You must be signed in to change notification settings - Fork 156
/
creatorInternal.d.ts
119 lines (97 loc) · 2.48 KB
/
creatorInternal.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Copyright 2021 Cao Gaoting<[email protected]>
// https://caogtaa.github.io
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
/*
* Date: 2020-07-24 11:44:36
* LastEditors: GT<[email protected]>
* LastEditTime: 2021-08-16 13:58:56
*/
declare interface Object {
assign(obj1: Object, obj2: Object): Object;
}
declare function require(name: string): any;
/** 对creator.d.ts的补充, 后续从2.2.2版本中挖出来
*/
declare namespace cc {
/** 对creator.d.ts的补充
追加cc.Assembler方法
*/
export class Assembler {
public _renderComp: cc.RenderComponent;
public init(comp: cc.RenderComponent);
public getVfmt();
static public register(renderCompCtor, assembler);
}
export class RenderData {
init(assembler: cc.Assembler);
createQuadData(index, verticesFloats, indicesCount);
createFlexData(index, verticesFloats, indicesCount, vfmt): cc.FlexBuffer;
initQuadIndices(idata);
vDatas;
uintVDatas;
iDatas;
meshCount: number;
_infos;
_flexBuffer;
}
declare interface Game {
_renderContext: WebGLRenderingContext;
}
declare interface Camera {
position: cc.Vec2;
render(): void;
}
declare interface Sprite {
_spriteFrame: cc.SpriteFrame;
}
declare interface renderer {
// _handle: any; // 无效
}
declare interface Material {
setProperty(name: string, value: any);
// static getInstantiatedMaterial(material: Material, comp: RenderComponent): Material; // 无效
}
/** 对creator.d.ts的补充
creator.d.ts已经导出RenderComponent,此处追加一些方法和成员
engine\cocos2d\core\components\CCRenderComponent.js
*/
declare interface RenderComponent {
/**
@param dirty dirty
*/
setVertsDirty(): void;
disableRender(): void;
markForRender(shouldRender: boolean): void;
_activateMaterial(force: boolean = true): void;
_vertsDirty: boolean;
_assembler: cc.Assembler;
_resetAssembler(): void;
}
declare interface FlexBuffer {
usedVertices: number;
usedIndices: number;
usedVerticesFloats: number;
vData: Float32Array;
uintVData: Uint32Array;
iData: Uint16Array;
reset();
used(verticesCount: number, indicesCount: number);
reserve(verticesCount: number, indicesCount: number);
}
declare interface PhysicsManager {
_world: b2.World;
}
export namespace Graphics {
export class Point {
x: number;
y: number;
dx: number;
dy: number;
dmx: number;
dmy: number;
flags: number;
len: number;
}
}
}