Skip to content

Commit cead695

Browse files
committed
Add comments
1 parent 77344cd commit cead695

File tree

27 files changed

+2905
-136
lines changed

27 files changed

+2905
-136
lines changed

plugins/gameobjects/fullwindow/fullwindowrectangle/FullWindowRectangle.d.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,28 @@
22

33
export default FullWindowRectangle;
44

5+
/**
6+
* Rectangle that always fills the game window.
7+
*/
58
declare class FullWindowRectangle extends Phaser.GameObjects.Rectangle {
9+
/**
10+
* Create a full-window rectangle.
11+
* @param scene - The Scene to which this object belongs.
12+
* @param fillColor - Fill color.
13+
* @param fillAlpha - Fill alpha.
14+
*/
615
constructor(
716
scene: Phaser.Scene,
817
fillColor?: number,
918
fillAlpha?: number
1019
);
1120

21+
/**
22+
* Alpha value.
23+
*/
1224
alpha: number;
25+
/**
26+
* Tint value.
27+
*/
1328
tint: number;
14-
}
29+
}

plugins/gameobjects/shape/checkbox/Checkbox.d.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,31 @@ export default Checkbox;
55

66
declare namespace Checkbox {
77
interface IConfig extends CheckboxShape.IConfig {
8+
/**
9+
* True to disable interaction changes.
10+
*/
811
readOnly?: boolean;
12+
/**
13+
* Input configuration.
14+
*/
915
input?: Click.IConfig,
1016
}
1117
}
1218

19+
/**
20+
* Checkbox with click input handling.
21+
*/
1322
declare class Checkbox extends CheckboxShape {
23+
/**
24+
* Create a checkbox.
25+
* @param scene - The Scene to which this object belongs.
26+
* @param x - The x position.
27+
* @param y - The y position.
28+
* @param width - The width.
29+
* @param height - The height.
30+
* @param color - Checked color.
31+
* @param config - Configuration options.
32+
*/
1433
constructor(
1534
scene: Phaser.Scene,
1635
x?: number, y?: number,
@@ -32,11 +51,24 @@ declare class Checkbox extends CheckboxShape {
3251
config?: Checkbox.IConfig
3352
);
3453

54+
/**
55+
* Create a checkbox from config.
56+
* @param scene - The Scene to which this object belongs.
57+
* @param config - Configuration options.
58+
*/
3559
constructor(
3660
scene: Phaser.Scene,
3761
config?: Checkbox.IConfig
3862
);
3963

64+
/**
65+
* Enable or disable read-only mode.
66+
* @param readOnly - True to enable.
67+
* @returns This instance.
68+
*/
4069
setReadOnly(readOnly?: boolean): this;
70+
/**
71+
* Read-only flag.
72+
*/
4173
readOnly: boolean;
4274
}

plugins/gameobjects/shape/checkbox/CheckboxShape.d.ts

Lines changed: 202 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,114 @@ export default Checkbox;
44

55
declare namespace Checkbox {
66
interface IConfig {
7-
x: number, y: number,
8-
width: number, height: number,
7+
/**
8+
* Initial x position.
9+
*/
10+
x: number,
11+
/**
12+
* Initial y position.
13+
*/
14+
y: number,
15+
/**
16+
* Initial width.
17+
*/
18+
width: number,
19+
/**
20+
* Initial height.
21+
*/
22+
height: number,
923

10-
color?: number, boxFillAlpha?: number,
11-
uncheckedColor?: number, uncheckedBoxFillAlpha?: number,
24+
/**
25+
* Checked box fill color.
26+
*/
27+
color?: number,
28+
/**
29+
* Checked box fill alpha.
30+
*/
31+
boxFillAlpha?: number,
32+
/**
33+
* Unchecked box fill color.
34+
*/
35+
uncheckedColor?: number,
36+
/**
37+
* Unchecked box fill alpha.
38+
*/
39+
uncheckedBoxFillAlpha?: number,
1240

13-
boxLineWidth?: number, boxStrokeColor?: number, boxStrokeAlpha?: number,
14-
uncheckedBoxStrokeColor?: number, uncheckedBoxStrokeAlpha?: number,
41+
/**
42+
* Box stroke line width.
43+
*/
44+
boxLineWidth?: number,
45+
/**
46+
* Box stroke color.
47+
*/
48+
boxStrokeColor?: number,
49+
/**
50+
* Box stroke alpha.
51+
*/
52+
boxStrokeAlpha?: number,
53+
/**
54+
* Unchecked box stroke color.
55+
*/
56+
uncheckedBoxStrokeColor?: number,
57+
/**
58+
* Unchecked box stroke alpha.
59+
*/
60+
uncheckedBoxStrokeAlpha?: number,
1561

62+
/**
63+
* Box size.
64+
*/
1665
boxSize?: number,
66+
/**
67+
* Checker size.
68+
*/
1769
checkerSize?: number,
1870

19-
checkerColor?: number, checkerAlpha?: number,
71+
/**
72+
* Checker color.
73+
*/
74+
checkerColor?: number,
75+
/**
76+
* Checker alpha.
77+
*/
78+
checkerAlpha?: number,
2079

80+
/**
81+
* True to render a circle box.
82+
*/
2183
circleBox?: boolean,
2284

85+
/**
86+
* Checker animation duration.
87+
*/
2388
animationDuration?: number,
2489

90+
/**
91+
* Checked state.
92+
*/
2593
checked?: boolean,
94+
/**
95+
* Value state.
96+
*/
2697
value?: boolean,
2798
}
2899
}
29100

101+
/**
102+
* Checkbox shape built from custom shapes.
103+
*/
30104
declare class Checkbox extends BaseShapes {
105+
/**
106+
* Create a checkbox.
107+
* @param scene - The Scene to which this object belongs.
108+
* @param x - The x position.
109+
* @param y - The y position.
110+
* @param width - The width.
111+
* @param height - The height.
112+
* @param color - Checked color.
113+
* @param config - Configuration options.
114+
*/
31115
constructor(
32116
scene: Phaser.Scene,
33117
x: number, y: number,
@@ -43,42 +127,152 @@ declare class Checkbox extends BaseShapes {
43127
config?: Checkbox.IConfig
44128
);
45129

130+
/**
131+
* Create a checkbox from config.
132+
* @param scene - The Scene to which this object belongs.
133+
* @param config - Configuration options.
134+
*/
46135
constructor(
47136
scene: Phaser.Scene,
48137
config?: Checkbox.IConfig
49138
);
50139

140+
/**
141+
* Set value state.
142+
* @param value - New value.
143+
* @returns This instance.
144+
*/
51145
setValue(value: boolean): this;
146+
/**
147+
* Toggle value state.
148+
* @returns This instance.
149+
*/
52150
toggleValue(): this;
151+
/**
152+
* Value state.
153+
*/
53154
value: boolean;
54155

156+
/**
157+
* Set checked state.
158+
* @param checked - New checked state.
159+
* @returns This instance.
160+
*/
55161
setChecked(checked?: boolean): this;
162+
/**
163+
* Toggle checked state.
164+
* @returns This instance.
165+
*/
56166
toggleChecked(): this;
167+
/**
168+
* Checked state.
169+
*/
57170
checked: boolean;
58171

172+
/**
173+
* Set box shape to circle or square.
174+
* @param isCircleShape - True for circle box.
175+
* @returns This instance.
176+
*/
59177
setBoxShape(isCircleShape?: boolean): this;
60178

179+
/**
180+
* Set checked box fill style.
181+
* @param color - Fill color.
182+
* @param alpha - Fill alpha.
183+
* @returns This instance.
184+
*/
61185
setBoxFillStyle(color: number, alpha?: number): this;
186+
/**
187+
* Checked box fill color.
188+
*/
62189
boxFillColor: number;
190+
/**
191+
* Checked box fill alpha.
192+
*/
63193
boxFillAlpha: number;
194+
/**
195+
* Set unchecked box fill style.
196+
* @param color - Fill color.
197+
* @param alpha - Fill alpha.
198+
* @returns This instance.
199+
*/
64200
setUncheckedBoxFillStyle(color: number, alpha?: number): this;
201+
/**
202+
* Unchecked box fill color.
203+
*/
65204
uncheckedBoxFillColor: number;
205+
/**
206+
* Unchecked box fill alpha.
207+
*/
66208
uncheckedBoxFillAlpha: number;
67209

210+
/**
211+
* Set box stroke style.
212+
* @param lineWidth - Line width.
213+
* @param color - Stroke color.
214+
* @param alpha - Stroke alpha.
215+
* @returns This instance.
216+
*/
68217
setBoxStrokeStyle(lineWidth: number, color: number, alpha?: number): this;
218+
/**
219+
* Box line width.
220+
*/
69221
boxLineWidth: number;
222+
/**
223+
* Box stroke color.
224+
*/
70225
boxStrokeColor: number;
226+
/**
227+
* Box stroke alpha.
228+
*/
71229
boxStrokeAlpha: number;
72230

231+
/**
232+
* Set unchecked box stroke style.
233+
* @param lineWidth - Line width.
234+
* @param color - Stroke color.
235+
* @param alpha - Stroke alpha.
236+
* @returns This instance.
237+
*/
73238
setUncheckedBoxStrokeStyle(lineWidth: number, color: number, alpha?: number): this;
239+
/**
240+
* Unchecked box line width.
241+
*/
74242
uncheckedBoxLineWidth: number;
243+
/**
244+
* Unchecked box stroke color.
245+
*/
75246
uncheckedBoxStrokeColor: number;
247+
/**
248+
* Unchecked box stroke alpha.
249+
*/
76250
uncheckedBoxStrokeAlpha: number;
77251

252+
/**
253+
* Set checker style.
254+
* @param color - Checker color.
255+
* @param alpha - Checker alpha.
256+
* @returns This instance.
257+
*/
78258
setCheckerStyle(color: number, alpha?: number): this;
259+
/**
260+
* Checker color.
261+
*/
79262
checkerColor: number;
263+
/**
264+
* Checker alpha.
265+
*/
80266
checkAlpha: number;
81267

268+
/**
269+
* Set checker animation duration.
270+
* @param duration - Duration in ms.
271+
* @returns This instance.
272+
*/
82273
setCheckerAnimationDuration(duration: number): this;
274+
/**
275+
* Checker animation duration.
276+
*/
83277
checkerAnimDuration: number;
84-
}
278+
}

0 commit comments

Comments
 (0)