hudini 0.11.0 → 0.11.1
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/components/section-header/section-header.d.ts +5 -5
- package/dist/components/section-header/section-header.js +14 -14
- package/dist/components/section-header/section-header.spec.js +1 -1
- package/dist/components/text-button/text-button.d.ts +117 -10
- package/dist/components/text-button/text-button.d.ts.map +1 -1
- package/dist/components/text-button/text-button.js +95 -13
- package/dist/components/text-button/text-button.js.map +1 -1
- package/dist/components/text-button/text-button.spec.js +2 -2
- package/dist/components/text-button/text-button.spec.js.map +1 -1
- package/dist/utils/get-hudini.d.ts +5 -0
- package/dist/utils/get-hudini.d.ts.map +1 -0
- package/dist/utils/get-hudini.js +4 -0
- package/dist/utils/get-hudini.js.map +1 -0
- package/dist/utils/get-pw-from-scene.d.ts +1 -3
- package/dist/utils/get-pw-from-scene.d.ts.map +1 -1
- package/dist/utils/get-pw-from-scene.js +0 -3
- package/dist/utils/get-pw-from-scene.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export type SectionHeaderParams = {
|
|
|
10
10
|
/** Text content of the header */
|
|
11
11
|
text: string;
|
|
12
12
|
/** Font size in px (number) or a Phaser Wind font size token (string). Defaults to 'lg'. */
|
|
13
|
-
|
|
13
|
+
fontSize?: FontSizeKey | number;
|
|
14
14
|
/** Font family. Defaults to 'display'. */
|
|
15
15
|
font?: FontKey | string;
|
|
16
16
|
/** Background color. Defaults to 'blue-600'. */
|
|
@@ -37,7 +37,7 @@ export declare class SectionHeader extends GameObjects.Container {
|
|
|
37
37
|
/** Reference to the PhaserWind plugin */
|
|
38
38
|
private pw;
|
|
39
39
|
/** Font size in pixels */
|
|
40
|
-
private
|
|
40
|
+
private fontSizePx;
|
|
41
41
|
/** Margin size in pixels */
|
|
42
42
|
private marginPx;
|
|
43
43
|
/** Border radius in pixels */
|
|
@@ -56,7 +56,7 @@ export declare class SectionHeader extends GameObjects.Container {
|
|
|
56
56
|
* Creates a new SectionHeader
|
|
57
57
|
* @param params Configuration parameters for the header
|
|
58
58
|
*/
|
|
59
|
-
constructor({ scene, x, y, text,
|
|
59
|
+
constructor({ scene, x, y, text, fontSize, font, backgroundColor, textColor, strokeColor, borderRadius, margin, }: SectionHeaderParams);
|
|
60
60
|
/**
|
|
61
61
|
* Sets the text content of the header
|
|
62
62
|
* @param text New text content
|
|
@@ -65,10 +65,10 @@ export declare class SectionHeader extends GameObjects.Container {
|
|
|
65
65
|
setText(text: string): this;
|
|
66
66
|
/**
|
|
67
67
|
* Sets the font size of the header text
|
|
68
|
-
* @param
|
|
68
|
+
* @param fontSize New font size (number in px or FontSizeKey)
|
|
69
69
|
* @returns this for chaining
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
setFontSize(fontSize: FontSizeKey | number): this;
|
|
72
72
|
/**
|
|
73
73
|
* Sets the font family of the header text
|
|
74
74
|
* @param font New font family (FontKey or string)
|
|
@@ -23,7 +23,7 @@ export class SectionHeader extends GameObjects.Container {
|
|
|
23
23
|
/** Reference to the PhaserWind plugin */
|
|
24
24
|
pw;
|
|
25
25
|
/** Font size in pixels */
|
|
26
|
-
|
|
26
|
+
fontSizePx;
|
|
27
27
|
/** Margin size in pixels */
|
|
28
28
|
marginPx;
|
|
29
29
|
/** Border radius in pixels */
|
|
@@ -42,15 +42,15 @@ export class SectionHeader extends GameObjects.Container {
|
|
|
42
42
|
* Creates a new SectionHeader
|
|
43
43
|
* @param params Configuration parameters for the header
|
|
44
44
|
*/
|
|
45
|
-
constructor({ scene, x, y, text,
|
|
45
|
+
constructor({ scene, x, y, text, fontSize, font, backgroundColor = 'blue-600', textColor = 'white', strokeColor, borderRadius = 'md', margin = '4', }) {
|
|
46
46
|
super(scene, x, y);
|
|
47
47
|
this.pw = getPWFromScene(scene);
|
|
48
48
|
// Store values
|
|
49
49
|
this.textValue = text;
|
|
50
|
-
this.
|
|
51
|
-
typeof
|
|
52
|
-
?
|
|
53
|
-
: this.pw.fontSize.px(
|
|
50
|
+
this.fontSizePx =
|
|
51
|
+
typeof fontSize === 'number'
|
|
52
|
+
? fontSize
|
|
53
|
+
: this.pw.fontSize.px(fontSize ?? 'lg');
|
|
54
54
|
this.marginPx =
|
|
55
55
|
typeof margin === 'number'
|
|
56
56
|
? margin
|
|
@@ -85,15 +85,15 @@ export class SectionHeader extends GameObjects.Container {
|
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
87
87
|
* Sets the font size of the header text
|
|
88
|
-
* @param
|
|
88
|
+
* @param fontSize New font size (number in px or FontSizeKey)
|
|
89
89
|
* @returns this for chaining
|
|
90
90
|
*/
|
|
91
|
-
|
|
92
|
-
this.
|
|
93
|
-
typeof
|
|
94
|
-
?
|
|
95
|
-
: this.pw.fontSize.px(
|
|
96
|
-
this.headerText.setFontSize(this.
|
|
91
|
+
setFontSize(fontSize) {
|
|
92
|
+
this.fontSizePx =
|
|
93
|
+
typeof fontSize === 'number'
|
|
94
|
+
? fontSize
|
|
95
|
+
: this.pw.fontSize.px(fontSize ?? 'lg');
|
|
96
|
+
this.headerText.setFontSize(this.fontSizePx);
|
|
97
97
|
this.regenerateGraphics();
|
|
98
98
|
return this;
|
|
99
99
|
}
|
|
@@ -175,7 +175,7 @@ export class SectionHeader extends GameObjects.Container {
|
|
|
175
175
|
*/
|
|
176
176
|
createHeaderText(scene) {
|
|
177
177
|
this.headerText = scene.add.text(0, 0, this.textValue, {
|
|
178
|
-
fontSize: `${this.
|
|
178
|
+
fontSize: `${this.fontSizePx}px`,
|
|
179
179
|
fontFamily: this.fontValue,
|
|
180
180
|
color: this.textColorValue,
|
|
181
181
|
stroke: this.strokeColorValue,
|
|
@@ -1,52 +1,159 @@
|
|
|
1
1
|
import { GameObjects, Scene } from 'phaser';
|
|
2
2
|
import { type ColorKey, type FontKey, type FontSizeKey, type RadiusKey, type SpacingKey } from 'phaser-wind';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for creating a TextButton.
|
|
5
|
+
*/
|
|
3
6
|
export type TextButtonParams = {
|
|
7
|
+
/** Phaser scene where the button will be added. */
|
|
4
8
|
scene: Scene;
|
|
9
|
+
/** X position of the button. */
|
|
5
10
|
x: number;
|
|
11
|
+
/** Y position of the button. */
|
|
6
12
|
y: number;
|
|
13
|
+
/** Button text. */
|
|
7
14
|
text: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Font size in px (number) or a Phaser Wind font size token (string).
|
|
17
|
+
* Defaults to 'md'.
|
|
18
|
+
*/
|
|
19
|
+
fontSize?: FontSizeKey | number;
|
|
20
|
+
/**
|
|
21
|
+
* Font family. Defaults to 'sans'.
|
|
22
|
+
*/
|
|
11
23
|
font?: FontKey | string;
|
|
12
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Background color. Defaults to 'blue'.
|
|
26
|
+
*/
|
|
13
27
|
backgroundColor?: ColorKey | string;
|
|
14
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Text color. Defaults to 'white'.
|
|
30
|
+
*/
|
|
15
31
|
textColor?: ColorKey | string;
|
|
16
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Border radius in px (number) or a Phaser Wind radius token (string).
|
|
34
|
+
* Defaults to 'md'.
|
|
35
|
+
*/
|
|
17
36
|
borderRadius?: RadiusKey | number;
|
|
18
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Margin/padding in px (number) or a Phaser Wind spacing token (string).
|
|
39
|
+
* Defaults to 'md'.
|
|
40
|
+
*/
|
|
19
41
|
margin?: SpacingKey | number;
|
|
42
|
+
/**
|
|
43
|
+
* Callback function for click event.
|
|
44
|
+
*/
|
|
20
45
|
onClick?: () => void;
|
|
21
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* A customizable text button component for Phaser, supporting auto-sizing,
|
|
49
|
+
* design tokens, and interactive effects.
|
|
50
|
+
*/
|
|
22
51
|
export declare class TextButton extends GameObjects.Container {
|
|
52
|
+
/** The background sprite of the button. */
|
|
23
53
|
backgroundSprite: GameObjects.Sprite;
|
|
54
|
+
/** The shadow sprite of the button. */
|
|
24
55
|
shadowSprite: GameObjects.Sprite;
|
|
56
|
+
/** The text object of the button. */
|
|
25
57
|
buttonText: GameObjects.Text;
|
|
26
58
|
private pw;
|
|
27
|
-
private
|
|
59
|
+
private fontSizePx;
|
|
28
60
|
private marginPx;
|
|
29
61
|
private borderRadiusPx;
|
|
30
62
|
private backgroundColorValue;
|
|
31
63
|
private textColorValue;
|
|
32
64
|
private fontValue;
|
|
33
65
|
private textValue;
|
|
34
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Creates a new TextButton instance.
|
|
68
|
+
* @param params TextButtonParams
|
|
69
|
+
*/
|
|
70
|
+
constructor({ scene, x, y, text, fontSize, font, backgroundColor, textColor, borderRadius, margin, onClick, }: TextButtonParams);
|
|
71
|
+
/**
|
|
72
|
+
* Sets the button text.
|
|
73
|
+
* @param text The new text.
|
|
74
|
+
* @returns This TextButton instance.
|
|
75
|
+
*/
|
|
35
76
|
setText(text: string): this;
|
|
36
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Sets the font size.
|
|
79
|
+
* @param fontSize Font size in px or token.
|
|
80
|
+
* @returns This TextButton instance.
|
|
81
|
+
*/
|
|
82
|
+
setFontSize(fontSize: FontSizeKey | number): this;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the font family.
|
|
85
|
+
* @param font Font family as string or token.
|
|
86
|
+
* @returns This TextButton instance.
|
|
87
|
+
*/
|
|
37
88
|
setFont(font: FontKey | string): this;
|
|
89
|
+
/**
|
|
90
|
+
* Sets the background color.
|
|
91
|
+
* @param color Color as token or CSS string.
|
|
92
|
+
* @returns This TextButton instance.
|
|
93
|
+
*/
|
|
38
94
|
setBackgroundColor(color: ColorKey | string): this;
|
|
95
|
+
/**
|
|
96
|
+
* Sets the text color.
|
|
97
|
+
* @param color Color as token or CSS string.
|
|
98
|
+
* @returns This TextButton instance.
|
|
99
|
+
*/
|
|
39
100
|
setTextColor(color: ColorKey | string): this;
|
|
101
|
+
/**
|
|
102
|
+
* Sets the border radius.
|
|
103
|
+
* @param borderRadius Border radius in px or token.
|
|
104
|
+
* @returns This TextButton instance.
|
|
105
|
+
*/
|
|
40
106
|
setBorderRadius(borderRadius: RadiusKey | number): this;
|
|
107
|
+
/**
|
|
108
|
+
* Sets the margin (padding).
|
|
109
|
+
* @param margin Margin in px or token.
|
|
110
|
+
* @returns This TextButton instance.
|
|
111
|
+
*/
|
|
41
112
|
setMargin(margin: SpacingKey | number): this;
|
|
113
|
+
/**
|
|
114
|
+
* Creates the button text GameObject.
|
|
115
|
+
* @param scene Phaser scene.
|
|
116
|
+
*/
|
|
42
117
|
private createButtonText;
|
|
118
|
+
/**
|
|
119
|
+
* Creates the shadow sprite for the button.
|
|
120
|
+
* @param scene Phaser scene.
|
|
121
|
+
*/
|
|
43
122
|
private createShadowSprite;
|
|
123
|
+
/**
|
|
124
|
+
* Creates the background sprite for the button.
|
|
125
|
+
* @param scene Phaser scene.
|
|
126
|
+
*/
|
|
44
127
|
private createBackgroundSprite;
|
|
128
|
+
/**
|
|
129
|
+
* Regenerates the background and shadow textures based on current state.
|
|
130
|
+
*/
|
|
45
131
|
private regenerateSprites;
|
|
132
|
+
/**
|
|
133
|
+
* Calculates the button's width and height based on text and margin.
|
|
134
|
+
* @returns Object with width and height.
|
|
135
|
+
*/
|
|
46
136
|
private getButtonDimensions;
|
|
137
|
+
/**
|
|
138
|
+
* Creates a texture for the button's shadow.
|
|
139
|
+
* @param scene Phaser scene.
|
|
140
|
+
* @returns The texture key.
|
|
141
|
+
*/
|
|
47
142
|
private createShadowTexture;
|
|
143
|
+
/**
|
|
144
|
+
* Creates a texture for the button's background.
|
|
145
|
+
* @param scene Phaser scene.
|
|
146
|
+
* @returns The texture key.
|
|
147
|
+
*/
|
|
48
148
|
private createBackgroundTexture;
|
|
149
|
+
/**
|
|
150
|
+
* Adds the button's visual elements to the container.
|
|
151
|
+
*/
|
|
49
152
|
private setupContainer;
|
|
153
|
+
/**
|
|
154
|
+
* Sets up interactivity for the button, including hover and click effects.
|
|
155
|
+
* @param onClick Optional click callback.
|
|
156
|
+
*/
|
|
50
157
|
private setupInteractivity;
|
|
51
158
|
}
|
|
52
159
|
//# sourceMappingURL=text-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-button.d.ts","sourceRoot":"","sources":["../../../src/components/text-button/text-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AAIrB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb
|
|
1
|
+
{"version":3,"file":"text-button.d.ts","sourceRoot":"","sources":["../../../src/components/text-button/text-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AAIrB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mDAAmD;IACnD,KAAK,EAAE,KAAK,CAAC;IACb,gCAAgC;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,gCAAgC;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,mBAAmB;IACnB,IAAI,EAAE,MAAM,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AAI;IAUxD;;;;OAIG;IACI,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAU5C;;;;OAIG;IACI,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI;IAMzD;;;;OAIG;IACI,YAAY,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI;IAMnD;;;;OAIG;IACI,eAAe,CAAC,YAAY,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI;IAS9D;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI;IASnD;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IASxB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAM1B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAM9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IA+B3B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAyB/B;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;CA4C3B"}
|
|
@@ -9,27 +9,38 @@ const HOVER_SCALE = 1.05;
|
|
|
9
9
|
const CLICK_OFFSET = 2;
|
|
10
10
|
const SHADOW_OFFSET = 4;
|
|
11
11
|
const SHADOW_OPACITY = 0.15;
|
|
12
|
+
/**
|
|
13
|
+
* A customizable text button component for Phaser, supporting auto-sizing,
|
|
14
|
+
* design tokens, and interactive effects.
|
|
15
|
+
*/
|
|
12
16
|
export class TextButton extends GameObjects.Container {
|
|
17
|
+
/** The background sprite of the button. */
|
|
13
18
|
backgroundSprite;
|
|
19
|
+
/** The shadow sprite of the button. */
|
|
14
20
|
shadowSprite;
|
|
21
|
+
/** The text object of the button. */
|
|
15
22
|
buttonText;
|
|
16
23
|
pw;
|
|
17
|
-
|
|
24
|
+
fontSizePx;
|
|
18
25
|
marginPx;
|
|
19
26
|
borderRadiusPx;
|
|
20
27
|
backgroundColorValue;
|
|
21
28
|
textColorValue;
|
|
22
29
|
fontValue;
|
|
23
30
|
textValue;
|
|
24
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new TextButton instance.
|
|
33
|
+
* @param params TextButtonParams
|
|
34
|
+
*/
|
|
35
|
+
constructor({ scene, x, y, text, fontSize, font, backgroundColor = 'blue', textColor = 'white', borderRadius = 'md', margin = '4', onClick, }) {
|
|
25
36
|
super(scene, x, y);
|
|
26
37
|
this.pw = getPWFromScene(scene);
|
|
27
38
|
// Store values
|
|
28
39
|
this.textValue = text;
|
|
29
|
-
this.
|
|
30
|
-
typeof
|
|
31
|
-
?
|
|
32
|
-
: this.pw.fontSize.px(
|
|
40
|
+
this.fontSizePx =
|
|
41
|
+
typeof fontSize === 'number'
|
|
42
|
+
? fontSize
|
|
43
|
+
: this.pw.fontSize.px(fontSize ?? 'md');
|
|
33
44
|
this.marginPx =
|
|
34
45
|
typeof margin === 'number'
|
|
35
46
|
? margin
|
|
@@ -51,21 +62,36 @@ export class TextButton extends GameObjects.Container {
|
|
|
51
62
|
this.setupInteractivity(onClick);
|
|
52
63
|
}
|
|
53
64
|
// API Methods
|
|
65
|
+
/**
|
|
66
|
+
* Sets the button text.
|
|
67
|
+
* @param text The new text.
|
|
68
|
+
* @returns This TextButton instance.
|
|
69
|
+
*/
|
|
54
70
|
setText(text) {
|
|
55
71
|
this.textValue = text;
|
|
56
72
|
this.buttonText.setText(text);
|
|
57
73
|
this.regenerateSprites();
|
|
58
74
|
return this;
|
|
59
75
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Sets the font size.
|
|
78
|
+
* @param fontSize Font size in px or token.
|
|
79
|
+
* @returns This TextButton instance.
|
|
80
|
+
*/
|
|
81
|
+
setFontSize(fontSize) {
|
|
82
|
+
this.fontSizePx =
|
|
83
|
+
typeof fontSize === 'number'
|
|
84
|
+
? fontSize
|
|
85
|
+
: this.pw.fontSize.px(fontSize ?? 'md');
|
|
86
|
+
this.buttonText.setFontSize(this.fontSizePx);
|
|
66
87
|
this.regenerateSprites();
|
|
67
88
|
return this;
|
|
68
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Sets the font family.
|
|
92
|
+
* @param font Font family as string or token.
|
|
93
|
+
* @returns This TextButton instance.
|
|
94
|
+
*/
|
|
69
95
|
setFont(font) {
|
|
70
96
|
this.fontValue =
|
|
71
97
|
typeof font === 'string'
|
|
@@ -75,16 +101,31 @@ export class TextButton extends GameObjects.Container {
|
|
|
75
101
|
this.regenerateSprites();
|
|
76
102
|
return this;
|
|
77
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Sets the background color.
|
|
106
|
+
* @param color Color as token or CSS string.
|
|
107
|
+
* @returns This TextButton instance.
|
|
108
|
+
*/
|
|
78
109
|
setBackgroundColor(color) {
|
|
79
110
|
this.backgroundColorValue = Color.rgb(color);
|
|
80
111
|
this.regenerateSprites();
|
|
81
112
|
return this;
|
|
82
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Sets the text color.
|
|
116
|
+
* @param color Color as token or CSS string.
|
|
117
|
+
* @returns This TextButton instance.
|
|
118
|
+
*/
|
|
83
119
|
setTextColor(color) {
|
|
84
120
|
this.textColorValue = Color.rgb(color);
|
|
85
121
|
this.buttonText.setColor(this.textColorValue);
|
|
86
122
|
return this;
|
|
87
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Sets the border radius.
|
|
126
|
+
* @param borderRadius Border radius in px or token.
|
|
127
|
+
* @returns This TextButton instance.
|
|
128
|
+
*/
|
|
88
129
|
setBorderRadius(borderRadius) {
|
|
89
130
|
this.borderRadiusPx =
|
|
90
131
|
typeof borderRadius === 'number'
|
|
@@ -93,6 +134,11 @@ export class TextButton extends GameObjects.Container {
|
|
|
93
134
|
this.regenerateSprites();
|
|
94
135
|
return this;
|
|
95
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Sets the margin (padding).
|
|
139
|
+
* @param margin Margin in px or token.
|
|
140
|
+
* @returns This TextButton instance.
|
|
141
|
+
*/
|
|
96
142
|
setMargin(margin) {
|
|
97
143
|
this.marginPx =
|
|
98
144
|
typeof margin === 'number'
|
|
@@ -101,24 +147,39 @@ export class TextButton extends GameObjects.Container {
|
|
|
101
147
|
this.regenerateSprites();
|
|
102
148
|
return this;
|
|
103
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Creates the button text GameObject.
|
|
152
|
+
* @param scene Phaser scene.
|
|
153
|
+
*/
|
|
104
154
|
createButtonText(scene) {
|
|
105
155
|
this.buttonText = scene.add.text(0, 0, this.textValue, {
|
|
106
|
-
fontSize: `${this.
|
|
156
|
+
fontSize: `${this.fontSizePx}px`,
|
|
107
157
|
fontFamily: this.fontValue,
|
|
108
158
|
color: this.textColorValue,
|
|
109
159
|
});
|
|
110
160
|
this.buttonText.setOrigin(0.5, 0.5);
|
|
111
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Creates the shadow sprite for the button.
|
|
164
|
+
* @param scene Phaser scene.
|
|
165
|
+
*/
|
|
112
166
|
createShadowSprite(scene) {
|
|
113
167
|
const shadowTexture = this.createShadowTexture(scene);
|
|
114
168
|
this.shadowSprite = scene.add.sprite(0, SHADOW_OFFSET, shadowTexture);
|
|
115
169
|
this.shadowSprite.setOrigin(0.5, 0.5);
|
|
116
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Creates the background sprite for the button.
|
|
173
|
+
* @param scene Phaser scene.
|
|
174
|
+
*/
|
|
117
175
|
createBackgroundSprite(scene) {
|
|
118
176
|
const backgroundTexture = this.createBackgroundTexture(scene);
|
|
119
177
|
this.backgroundSprite = scene.add.sprite(0, 0, backgroundTexture);
|
|
120
178
|
this.backgroundSprite.setOrigin(0.5, 0.5);
|
|
121
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Regenerates the background and shadow textures based on current state.
|
|
182
|
+
*/
|
|
122
183
|
regenerateSprites() {
|
|
123
184
|
// Update text bounds after text/font changes
|
|
124
185
|
this.buttonText.setText(this.textValue);
|
|
@@ -128,12 +189,21 @@ export class TextButton extends GameObjects.Container {
|
|
|
128
189
|
this.shadowSprite.setTexture(shadowTexture);
|
|
129
190
|
this.backgroundSprite.setTexture(backgroundTexture);
|
|
130
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Calculates the button's width and height based on text and margin.
|
|
194
|
+
* @returns Object with width and height.
|
|
195
|
+
*/
|
|
131
196
|
getButtonDimensions() {
|
|
132
197
|
const textBounds = this.buttonText.getBounds();
|
|
133
198
|
const width = textBounds.width + this.marginPx * 2;
|
|
134
199
|
const height = textBounds.height + this.marginPx * 2;
|
|
135
200
|
return { width, height };
|
|
136
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Creates a texture for the button's shadow.
|
|
204
|
+
* @param scene Phaser scene.
|
|
205
|
+
* @returns The texture key.
|
|
206
|
+
*/
|
|
137
207
|
createShadowTexture(scene) {
|
|
138
208
|
const { width, height } = this.getButtonDimensions();
|
|
139
209
|
const textureKey = `textButton_shadow_${this.backgroundColorValue}_${this.borderRadiusPx}_${width}_${height}`;
|
|
@@ -152,6 +222,11 @@ export class TextButton extends GameObjects.Container {
|
|
|
152
222
|
graphics.destroy();
|
|
153
223
|
return textureKey;
|
|
154
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Creates a texture for the button's background.
|
|
227
|
+
* @param scene Phaser scene.
|
|
228
|
+
* @returns The texture key.
|
|
229
|
+
*/
|
|
155
230
|
createBackgroundTexture(scene) {
|
|
156
231
|
const { width, height } = this.getButtonDimensions();
|
|
157
232
|
const textureKey = `textButton_bg_${this.backgroundColorValue}_${this.borderRadiusPx}_${width}_${height}`;
|
|
@@ -170,9 +245,16 @@ export class TextButton extends GameObjects.Container {
|
|
|
170
245
|
graphics.destroy();
|
|
171
246
|
return textureKey;
|
|
172
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Adds the button's visual elements to the container.
|
|
250
|
+
*/
|
|
173
251
|
setupContainer() {
|
|
174
252
|
this.add([this.shadowSprite, this.backgroundSprite, this.buttonText]);
|
|
175
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Sets up interactivity for the button, including hover and click effects.
|
|
256
|
+
* @param onClick Optional click callback.
|
|
257
|
+
*/
|
|
176
258
|
setupInteractivity(onClick) {
|
|
177
259
|
this.backgroundSprite.setInteractive({ useHandCursor: true });
|
|
178
260
|
// Hover effects
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-button.js","sourceRoot":"","sources":["../../../src/components/text-button/text-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,KAAK,GAON,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"text-button.js","sourceRoot":"","sources":["../../../src/components/text-button/text-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,KAAK,GAON,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AA+C/D,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,WAAW,CAAC,SAAS;IACnD,2CAA2C;IACpC,gBAAgB,CAAsB;IAC7C,uCAAuC;IAChC,YAAY,CAAsB;IACzC,qCAAqC;IAC9B,UAAU,CAA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EAAE,SAAS,CAAC,KAAK;gBACzB,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YACzC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;gBACpB,OAAO,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC;gBACjD,CAAC,EAAE,CAAC;gBACJ,QAAQ,EAAE,SAAS,CAAC,KAAK;gBACzB,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH,OAAO,EAAE,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -154,7 +154,7 @@ describe('TextButton', () => {
|
|
|
154
154
|
x: 100,
|
|
155
155
|
y: 100,
|
|
156
156
|
text: 'Custom Button',
|
|
157
|
-
|
|
157
|
+
fontSize: 'lg',
|
|
158
158
|
backgroundColor: 'red',
|
|
159
159
|
textColor: 'white',
|
|
160
160
|
borderRadius: 'lg',
|
|
@@ -172,7 +172,7 @@ describe('TextButton', () => {
|
|
|
172
172
|
});
|
|
173
173
|
const result = textButton
|
|
174
174
|
.setText('Chained')
|
|
175
|
-
.
|
|
175
|
+
.setFontSize('lg')
|
|
176
176
|
.setBackgroundColor('green')
|
|
177
177
|
.setBorderRadius('lg')
|
|
178
178
|
.setMargin('4');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-button.spec.js","sourceRoot":"","sources":["../../../src/components/text-button/text-button.spec.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,2CAA2C;AAC3C,qCAAqC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAElD,mBAAmB;AACnB,EAAE,CAAC,IAAI,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,IAAI,CAAC;aACjB,kBAAkB,CAAC,OAAO,CAAC;aAC3B,eAAe,CAAC,IAAI,CAAC;aACrB,SAAS,CAAC,GAAG,CAAC,CAAC;QAElB,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;QAE1B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC;YAChC,KAAK;YACL,CAAC,EAAE,GAAG;YACN,CAAC,EAAE,GAAG;YACN,IAAI,EAAE,kBAAkB;YACxB,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC;QAEH,MAAM,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QAE9C,mCAAmC;QACnC,MAAM,MAAM,GAAG,UAAU,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Scene } from "phaser";
|
|
2
|
+
import { BaseThemeConfig } from "phaser-wind";
|
|
3
|
+
import { HudiniPlugin } from '../plugin/plugin';
|
|
4
|
+
export declare const getHudini: <T extends BaseThemeConfig = BaseThemeConfig>(scene: Scene) => HudiniPlugin<T>;
|
|
5
|
+
//# sourceMappingURL=get-hudini.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-hudini.d.ts","sourceRoot":"","sources":["../../src/utils/get-hudini.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,eAAe,GAAG,eAAe,EACjE,OAAO,KAAK,KACb,YAAY,CAAC,CAAC,CAEhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-hudini.js","sourceRoot":"","sources":["../../src/utils/get-hudini.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,SAAS,GAAG,CACrB,KAAY,EACG,EAAE;IACjB,OAAQ,KAAuC,CAAC,MAAM,CAAC;AAC3D,CAAC,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Scene } from 'phaser';
|
|
2
|
-
import {
|
|
3
|
-
import { HudiniPlugin } from '../plugin/plugin';
|
|
2
|
+
import { PhaserWindPlugin } from 'phaser-wind';
|
|
4
3
|
export declare const getPWFromScene: (scene: Scene) => PhaserWindPlugin<{}>;
|
|
5
|
-
export declare const getHudini: <T extends BaseThemeConfig = BaseThemeConfig>(scene: Scene) => HudiniPlugin<T>;
|
|
6
4
|
//# sourceMappingURL=get-pw-from-scene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-pw-from-scene.d.ts","sourceRoot":"","sources":["../../src/utils/get-pw-from-scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"get-pw-from-scene.d.ts","sourceRoot":"","sources":["../../src/utils/get-pw-from-scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,KAAG,gBAAgB,CAAC,EAAE,CAEhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-pw-from-scene.js","sourceRoot":"","sources":["../../src/utils/get-pw-from-scene.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-pw-from-scene.js","sourceRoot":"","sources":["../../src/utils/get-pw-from-scene.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAwB,EAAE;IACnE,OAAQ,KAA4C,CAAC,EAAE,CAAC;AAC1D,CAAC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
|
package/dist/utils/index.js
CHANGED
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
|