-
Notifications
You must be signed in to change notification settings - Fork 264
/
creatorInternal.d.ts
126 lines (99 loc) · 2.5 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
120
121
122
123
124
125
126
declare interface Object {
assign(obj1: Object, obj2: Object): Object;
}
declare function require(name: string): any;
/** 对creator.d.ts的补充, 后续从2.2.2版本中挖出来
*/
declare namespace cc {
declare class RenderFlow {
static FLAG_DONOTHING: number;
static FLAG_BREAK_FLOW: number;
static FLAG_LOCAL_TRANSFORM: number;
static FLAG_WORLD_TRANSFORM: number;
static FLAG_TRANSFORM: number;
static FLAG_UPDATE_RENDER_DATA: number;
static FLAG_OPACITY: number;
static FLAG_COLOR: number;
static FLAG_OPACITY_COLOR: number;
static FLAG_RENDER: number;
static FLAG_CHILDREN: number;
static FLAG_POST_RENDER: number;
static FLAG_FINAL: number;
static flows: any;
_doNothing(): void;
_localTransform(): void;
_worldTransform(): void;
_opacity(): void;
_color(): void;
_updateRenderData(): void;
_render(): void;
_children(): void;
_postRender(): void;
}
declare interface renderer {
// _handle: any; // 无效
}
/**
* 对creator.d.ts的补充
*/
export class Assembler {
public init(comp: cc.RenderComponent);
}
export class RenderData {
createFlexData(index, verticesFloats, indicesCount, vfmt);
vertices: any[];
dataLength: number;
}
declare interface Game {
_renderContext: WebGLRenderingContext;
}
declare interface Camera {
position: cc.Vec2;
render(): void;
}
declare interface Node {
_renderFlag: number;
_activeInHierarchy: boolean;
}
declare interface Sprite {
_spriteFrame: cc.SpriteFrame;
}
declare interface Material {
setProperty(name: string, value: any);
getProperty(name: string): any;
getHash(): string;
// 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;
_getDefaultMaterial(): cc.Material;
markForRender(shouldRender: boolean): void;
_activateMaterial(force: boolean = true): void;
_updateColor(): void;
_vertsDirty: boolean;
_assembler: cc.Assembler;
_materials: cc.Material[];
}
declare interface RenderData {
init(assembler: cc.Assembler);
createQuadData(index, verticesFloats, indicesCount);
vDatas;
uintVDatas;
iDatas;
meshCount: number;
_infos;
_flexBuffer;
clear(): void;
}
declare interface PhysicsManager {
_world: b2.World;
}
}