forked from 4ian/GDevelop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject-data.d.ts
More file actions
232 lines (211 loc) · 5.46 KB
/
Copy pathproject-data.d.ts
File metadata and controls
232 lines (211 loc) · 5.46 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/*
* GDevelop JS Platform
* Copyright 2013-present Florian Rival (Florian.Rival@gmail.com). All rights reserved.
* This project is released under the MIT License.
*/
/**
* Contains the data of a serialized exported project.
*/
declare interface ProjectData {
firstLayout: string;
gdVersion: GdVersionData;
properties: ProjectPropertiesData;
resources: ResourcesData;
objects: ObjectData[];
variables: RootVariableData[];
layouts: LayoutData[];
externalLayouts: ExternalLayoutData[];
}
/** Object containing initial properties for all objects extending {@link gdjs.RuntimeObject}. */
declare type ObjectData = {
/** The name of the object. During the game, objects can be queried by their name (see {@link gdjs.RuntimeScene.prototype.getObjects} for example). */
name: string;
/** The object type. */
type: string;
/** The list of default variables. */
variables: Array<RootVariableData>;
/** The list of default behaviors. */
behaviors: Array<BehaviorData>;
/** The list of effects. */
effects: Array<EffectData>;
};
declare type VariableType =
| 'string'
| 'number'
| 'boolean'
| 'structure'
| 'array';
/** Data representation of a GDevelop variable */
declare type VariableData = Readonly<{
/** The name of the variable. Leave blank for array children. */
name?: string;
/** The value of the variable. Leave blank for structures. */
value?: string | float | boolean;
/** The children of the structure. Leave blank if value is defined. */
children?: VariableData[];
/** The type of the variable. Defaults to number. */
type?: VariableType;
}>;
/** A variable child of a container. Those always have a name. */
declare type RootVariableData = Omit<VariableData, 'name'> & { name: string };
/** Properties to set up a behavior. */
declare type BehaviorData = {
/** The name of the behavior (for getting from an object (object.getBehavior) for example) */
name: string;
/** The behavior type. Used by GDJS to find the proper behavior to construct. */
type: string;
};
declare interface GdVersionData {
build: number;
major: number;
minor: number;
revision: number;
}
declare interface LayoutData {
r: number;
v: number;
b: number;
mangledName: string;
name: string;
stopSoundsOnStartup: boolean;
title: string;
variables: RootVariableData[];
instances: InstanceData[];
objects: ObjectData[];
layers: LayerData[];
behaviorsSharedData: BehaviorSharedData[];
}
declare interface BehaviorSharedData {
name: string;
type: string;
}
declare interface ExternalLayoutData {
name: string;
instances: InstanceData[];
}
declare interface InstanceData {
persistentUuid: string;
angle: number;
customSize: boolean;
height: number;
layer: string;
locked: boolean;
name: string;
width: number;
x: number;
y: number;
zOrder: number;
numberProperties: InstanceNumberProperty[];
stringProperties: InstanceStringProperty[];
initialVariables: RootVariableData[];
}
declare interface InstanceNumberProperty {
name: string;
value: number;
}
declare interface InstanceStringProperty {
name: string;
value: string;
}
declare interface LayerData {
name: string;
visibility: boolean;
cameras: CameraData[];
effects: EffectData[];
ambientLightColorR: number;
ambientLightColorG: number;
ambientLightColorB: number;
isLightingLayer: boolean;
followBaseLayerCamera: boolean;
}
declare interface CameraData {
defaultSize: boolean;
defaultViewport: boolean;
height: number;
viewportBottom: number;
viewportLeft: number;
viewportRight: number;
viewportTop: number;
width: number;
}
declare interface EffectData {
effectType: string;
name: string;
doubleParameters: {
[name: string]: number;
};
stringParameters: {
[name: string]: string;
};
booleanParameters: {
[name: string]: boolean;
};
}
declare interface ProjectPropertiesData {
adaptGameResolutionAtRuntime: boolean;
folderProject: boolean;
orientation: string;
packageName: string;
projectFile: string;
scaleMode: 'linear' | 'nearest';
pixelsRounding: boolean;
sizeOnStartupMode: string;
useExternalSourceFiles: boolean;
version: string;
name: string;
author: string;
windowWidth: number;
windowHeight: number;
latestCompilationDirectory: string;
maxFPS: number;
minFPS: number;
verticalSync: boolean;
loadingScreen: LoadingScreenData;
currentPlatform: string;
extensionProperties: Array<ExtensionProperty>;
useDeprecatedZeroAsDefaultZOrder?: boolean;
projectUuid?: string;
}
declare interface ExtensionProperty {
extension: string;
property: string;
value: string;
}
declare interface LoadingScreenData {
showGDevelopSplash: boolean;
backgroundImageResourceName: string;
backgroundColor: integer;
backgroundFadeInDuration: float;
minDuration: float;
logoAndProgressFadeInDuration: float;
logoAndProgressLogoFadeInDelay: float;
showProgressBar: boolean;
progressBarMinWidth: float;
progressBarMaxWidth: float;
progressBarWidthPercent: float;
progressBarHeight: float;
progressBarColor: integer;
}
declare interface ResourcesData {
resources: ResourceData[];
}
declare interface ResourceData {
alwaysLoaded?: boolean;
file: string;
kind: ResourceKind;
metadata: string;
name: string;
smoothed?: boolean;
userAdded: boolean;
disablePreload?: boolean;
preloadAsSound?: boolean;
preloadAsMusic?: boolean;
preloadInCache?: boolean;
}
declare type ResourceKind =
| 'audio'
| 'image'
| 'font'
| 'video'
| 'json'
| 'bitmapFont';