phaser-wind 0.4.0 → 0.5.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/README.md +78 -360
- package/dist/components/column.d.ts +1 -0
- package/dist/components/column.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/scene/index.d.ts +2 -0
- package/dist/scene/index.d.ts.map +1 -0
- package/dist/scene/scene-with-phaser-wind.d.ts +11 -0
- package/dist/scene/scene-with-phaser-wind.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/components/column.js +0 -7
- package/dist/components/column.js.map +0 -1
- package/dist/core/color.js +0 -205
- package/dist/core/color.js.map +0 -1
- package/dist/core/color.spec.js +0 -243
- package/dist/core/color.spec.js.map +0 -1
- package/dist/core/font-size.js +0 -63
- package/dist/core/font-size.js.map +0 -1
- package/dist/core/font-size.spec.js +0 -85
- package/dist/core/font-size.spec.js.map +0 -1
- package/dist/core/font.js +0 -37
- package/dist/core/font.js.map +0 -1
- package/dist/core/font.spec.js +0 -80
- package/dist/core/font.spec.js.map +0 -1
- package/dist/core/index.js +0 -8
- package/dist/core/index.js.map +0 -1
- package/dist/core/palette.js +0 -292
- package/dist/core/palette.js.map +0 -1
- package/dist/core/radius.js +0 -38
- package/dist/core/radius.js.map +0 -1
- package/dist/core/radius.spec.js +0 -56
- package/dist/core/radius.spec.js.map +0 -1
- package/dist/core/shadow.js +0 -33
- package/dist/core/shadow.js.map +0 -1
- package/dist/core/shadow.spec.js +0 -21
- package/dist/core/shadow.spec.js.map +0 -1
- package/dist/core/spacing.js +0 -70
- package/dist/core/spacing.js.map +0 -1
- package/dist/core/spacing.spec.js +0 -38
- package/dist/core/spacing.spec.js.map +0 -1
- package/dist/exceptions.js +0 -2
- package/dist/exceptions.js.map +0 -1
- package/dist/font/index.js +0 -3
- package/dist/font/index.js.map +0 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +0 -1
- package/dist/plugin/index.js +0 -2
- package/dist/plugin/index.js.map +0 -1
- package/dist/plugin/plugin.js +0 -91
- package/dist/plugin/plugin.js.map +0 -1
- package/dist/theme/index.js +0 -3
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/theme-config.js +0 -159
- package/dist/theme/theme-config.js.map +0 -1
- package/dist/theme/theme-manager.js +0 -4
- package/dist/theme/theme-manager.js.map +0 -1
- package/dist/theme/type.js +0 -2
- package/dist/theme/type.js.map +0 -1
- package/dist/utils/index.js +0 -2
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/is-valid-color.js +0 -32
- package/dist/utils/is-valid-color.js.map +0 -1
- package/dist/utils/is-valid-color.spec.js +0 -82
- package/dist/utils/is-valid-color.spec.js.map +0 -1
package/README.md
CHANGED
|
@@ -199,7 +199,7 @@ Shadow.get('md');
|
|
|
199
199
|
|
|
200
200
|
---
|
|
201
201
|
|
|
202
|
-
## 🎨 Theming
|
|
202
|
+
## 🎨 Theming
|
|
203
203
|
|
|
204
204
|
Phaser Wind also provides a typed theme system via a Phaser plugin. You get the same API surface (`color`, `fontSize`, `spacing`, `radius`, `font`, `shadow`) but narrowed to your custom tokens.
|
|
205
205
|
|
|
@@ -259,386 +259,112 @@ new Phaser.Game({
|
|
|
259
259
|
});
|
|
260
260
|
```
|
|
261
261
|
|
|
262
|
-
### 3)
|
|
262
|
+
### 3) How to get strong types in your scene
|
|
263
|
+
|
|
264
|
+
#### 3.1 Lazy way. Define a module and all scenes should be have the "pw" instance
|
|
263
265
|
|
|
264
266
|
```ts
|
|
265
|
-
//
|
|
267
|
+
// src/my-theme.ts
|
|
266
268
|
import 'phaser';
|
|
267
269
|
import type { PhaserWindPlugin } from 'phaser-wind';
|
|
268
270
|
import type { ThemeType } from './theme';
|
|
269
271
|
|
|
270
|
-
|
|
271
|
-
interface Scene {
|
|
272
|
-
pw: PhaserWindPlugin<ThemeType>;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
### 4) Typed usage in scenes
|
|
278
|
-
|
|
279
|
-
```ts
|
|
280
|
-
export class GameScene extends Phaser.Scene {
|
|
281
|
-
create() {
|
|
282
|
-
const { color, fontSize, spacing, radius, font, shadow } = this.pw;
|
|
283
|
-
|
|
284
|
-
// ✅ Type-narrowed to your theme
|
|
285
|
-
color.rgb('primary');
|
|
286
|
-
fontSize.css('lg');
|
|
287
|
-
spacing.px('gutter');
|
|
288
|
-
radius.css('card');
|
|
289
|
-
font.family('display');
|
|
290
|
-
shadow.get('glow');
|
|
291
|
-
|
|
292
|
-
// ❌ Compile-time errors
|
|
293
|
-
// color.rgb('blue-501');
|
|
294
|
-
// spacing.px('unknown');
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
> Note: The old `ThemeManager` API is deprecated and has been removed from the docs.
|
|
300
|
-
|
|
301
|
-
### 🎮 **Real Game Example**
|
|
302
|
-
|
|
303
|
-
```typescript
|
|
304
|
-
export class GameScene extends Phaser.Scene {
|
|
305
|
-
create() {
|
|
306
|
-
// Player health bar with theme colors
|
|
307
|
-
const healthWidth = Spacing.px('24'); // 96px
|
|
308
|
-
const healthHeight = Spacing.px('4'); // 16px
|
|
309
|
-
|
|
310
|
-
this.add.rectangle(
|
|
311
|
-
50,
|
|
312
|
-
50,
|
|
313
|
-
healthWidth,
|
|
314
|
-
healthHeight,
|
|
315
|
-
Color.hex('player-health')
|
|
316
|
-
); // Green from theme
|
|
317
|
-
|
|
318
|
-
// Game title with theme typography
|
|
319
|
-
this.add
|
|
320
|
-
.text(400, 50, 'CYBER QUEST', {
|
|
321
|
-
fontSize: FontSize.css('4xl'),
|
|
322
|
-
fontFamily: Font.family('display'),
|
|
323
|
-
color: Color.rgb('primary'), // Purple from theme
|
|
324
|
-
})
|
|
325
|
-
.setOrigin(0.5);
|
|
326
|
-
|
|
327
|
-
// UI button with consistent spacing and colors
|
|
328
|
-
this.createButton(
|
|
329
|
-
400,
|
|
330
|
-
400,
|
|
331
|
-
'START GAME',
|
|
332
|
-
Spacing.px('16'), // 64px width
|
|
333
|
-
Spacing.px('6') // 24px height
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
createButton(
|
|
338
|
-
x: number,
|
|
339
|
-
y: number,
|
|
340
|
-
text: string,
|
|
341
|
-
width: number,
|
|
342
|
-
height: number
|
|
343
|
-
) {
|
|
344
|
-
const button = this.add
|
|
345
|
-
.rectangle(x, y, width, height, Color.hex('ui-background'))
|
|
346
|
-
.setInteractive()
|
|
347
|
-
.on('pointerover', () => button.setFillStyle(Color.hex('secondary')))
|
|
348
|
-
.on('pointerout', () => button.setFillStyle(Color.hex('ui-background')));
|
|
349
|
-
|
|
350
|
-
this.add
|
|
351
|
-
.text(x, y, text, {
|
|
352
|
-
fontSize: FontSize.css('base'),
|
|
353
|
-
fontFamily: Font.family('primary'),
|
|
354
|
-
color: Color.rgb('primary'),
|
|
355
|
-
})
|
|
356
|
-
.setOrigin(0.5);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
### 🎨 **Pre-built Themes**
|
|
362
|
-
|
|
363
|
-
```typescript
|
|
364
|
-
import { defaultLightTheme, defaultDarkTheme } from 'phaser-wind';
|
|
365
|
-
|
|
366
|
-
// Light theme with professional colors
|
|
367
|
-
ThemeManager.init(defaultLightTheme);
|
|
368
|
-
|
|
369
|
-
// Dark theme perfect for games
|
|
370
|
-
ThemeManager.init(defaultDarkTheme);
|
|
371
|
-
|
|
372
|
-
// Create variations
|
|
373
|
-
const winterTheme = ThemeManager.extendCurrentTheme({
|
|
374
|
-
'colors.primary': 'blue-400',
|
|
375
|
-
'colors.secondary': 'cyan-300',
|
|
376
|
-
'colors.accent': 'white',
|
|
377
|
-
});
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### 🔗 **Smart Token References**
|
|
381
|
-
|
|
382
|
-
Themes can reference other tokens using dot notation:
|
|
383
|
-
|
|
384
|
-
```typescript
|
|
385
|
-
const theme = createTheme({
|
|
272
|
+
const theme = const theme = createTheme({
|
|
386
273
|
colors: {
|
|
387
274
|
brand: 'purple-600',
|
|
388
275
|
danger: 'red-500',
|
|
389
|
-
},
|
|
390
|
-
typography: {
|
|
391
|
-
title: {
|
|
392
|
-
fontSize: '4xl',
|
|
393
|
-
fontFamily: 'fonts.display', // 🔗 Auto-resolves to fonts.display
|
|
394
|
-
color: 'colors.brand', // 🔗 Auto-resolves to purple-600
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
effects: {
|
|
398
|
-
'brand-glow': {
|
|
399
|
-
color: 'colors.brand', // 🔗 Auto-resolves to purple-600
|
|
400
|
-
blur: 8,
|
|
401
|
-
},
|
|
402
|
-
},
|
|
403
|
-
});
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
---
|
|
407
|
-
|
|
408
|
-
## 💡 Real-World Examples
|
|
409
|
-
|
|
410
|
-
### Game UI Components
|
|
411
|
-
|
|
412
|
-
```typescript
|
|
413
|
-
import { Color, FontSize } from 'phaser-wind';
|
|
414
|
-
|
|
415
|
-
export class GameScene extends Phaser.Scene {
|
|
416
|
-
create() {
|
|
417
|
-
// Main title
|
|
418
|
-
this.add
|
|
419
|
-
.text(400, 100, 'SPACE RAIDERS', {
|
|
420
|
-
fontSize: FontSize.css('5xl'),
|
|
421
|
-
fill: Color.rgb('yellow-400'),
|
|
422
|
-
stroke: Color.rgb('yellow-800'),
|
|
423
|
-
strokeThickness: 2,
|
|
424
|
-
})
|
|
425
|
-
.setOrigin(0.5);
|
|
426
|
-
|
|
427
|
-
// Score display
|
|
428
|
-
this.add.text(50, 50, 'Score: 12,500', {
|
|
429
|
-
fontSize: FontSize.css('xl'),
|
|
430
|
-
fill: Color.rgb('green-400'),
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
// Health bar background
|
|
434
|
-
const healthBg = this.add.graphics();
|
|
435
|
-
healthBg.fillStyle(Color.hex('red-900'));
|
|
436
|
-
healthBg.fillRect(50, 100, 200, 20);
|
|
437
|
-
|
|
438
|
-
// Health bar fill
|
|
439
|
-
const healthFill = this.add.graphics();
|
|
440
|
-
healthFill.fillStyle(Color.hex('red-500'));
|
|
441
|
-
healthFill.fillRect(52, 102, 156, 16); // 80% health
|
|
442
|
-
|
|
443
|
-
// Game over screen
|
|
444
|
-
this.add.rectangle(400, 300, 600, 400, Color.hex('slate-900'), 0.9);
|
|
445
|
-
|
|
446
|
-
this.add
|
|
447
|
-
.text(400, 250, 'GAME OVER', {
|
|
448
|
-
fontSize: FontSize.css('4xl'),
|
|
449
|
-
fill: Color.rgb('red-500'),
|
|
450
|
-
})
|
|
451
|
-
.setOrigin(0.5);
|
|
452
|
-
|
|
453
|
-
this.add
|
|
454
|
-
.text(400, 320, 'Final Score: 12,500', {
|
|
455
|
-
fontSize: FontSize.css('2xl'),
|
|
456
|
-
fill: Color.rgb('slate-300'),
|
|
457
|
-
})
|
|
458
|
-
.setOrigin(0.5);
|
|
459
276
|
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
### Button System
|
|
277
|
+
});
|
|
278
|
+
export type ThemeType = typeof theme;
|
|
464
279
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
scene: Phaser.Scene,
|
|
469
|
-
x: number,
|
|
470
|
-
y: number,
|
|
471
|
-
text: string,
|
|
472
|
-
variant: 'primary' | 'secondary' | 'danger' = 'primary'
|
|
473
|
-
) {
|
|
474
|
-
const colors = {
|
|
475
|
-
primary: {
|
|
476
|
-
bg: Color.hex('blue-600'),
|
|
477
|
-
bgHover: Color.hex('blue-700'),
|
|
478
|
-
text: Color.rgb('white'),
|
|
479
|
-
},
|
|
480
|
-
secondary: {
|
|
481
|
-
bg: Color.hex('slate-600'),
|
|
482
|
-
bgHover: Color.hex('slate-700'),
|
|
483
|
-
text: Color.rgb('slate-100'),
|
|
484
|
-
},
|
|
485
|
-
danger: {
|
|
486
|
-
bg: Color.hex('red-600'),
|
|
487
|
-
bgHover: Color.hex('red-700'),
|
|
488
|
-
text: Color.rgb('white'),
|
|
489
|
-
},
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
const style = colors[variant];
|
|
493
|
-
|
|
494
|
-
// Background
|
|
495
|
-
this.background = scene.add
|
|
496
|
-
.rectangle(x, y, 200, 50, style.bg)
|
|
497
|
-
.setInteractive()
|
|
498
|
-
.on('pointerover', () => this.background.setFillStyle(style.bgHover))
|
|
499
|
-
.on('pointerout', () => this.background.setFillStyle(style.bg));
|
|
500
|
-
|
|
501
|
-
// Text
|
|
502
|
-
this.text = scene.add
|
|
503
|
-
.text(x, y, text, {
|
|
504
|
-
fontSize: FontSize.css('lg'),
|
|
505
|
-
fill: style.text,
|
|
506
|
-
})
|
|
507
|
-
.setOrigin(0.5);
|
|
280
|
+
declare module 'phaser' {
|
|
281
|
+
interface Scene {
|
|
282
|
+
pw: PhaserWindPlugin<ThemeType>;
|
|
508
283
|
}
|
|
509
284
|
}
|
|
510
285
|
|
|
511
|
-
//
|
|
512
|
-
const playButton = new GameButton(this, 400, 200, 'PLAY', 'primary');
|
|
513
|
-
const settingsButton = new GameButton(this, 400, 280, 'SETTINGS', 'secondary');
|
|
514
|
-
const quitButton = new GameButton(this, 400, 360, 'QUIT', 'danger');
|
|
515
|
-
```
|
|
516
|
-
|
|
517
|
-
### Particle Effects with Color Harmony
|
|
286
|
+
// In your scene
|
|
518
287
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
this.
|
|
522
|
-
speed: { min: 50, max: 100 },
|
|
523
|
-
tint: [
|
|
524
|
-
Color.hex('blue-400'),
|
|
525
|
-
Color.hex('blue-500'),
|
|
526
|
-
Color.hex('blue-600'),
|
|
527
|
-
Color.hex('cyan-400'),
|
|
528
|
-
Color.hex('cyan-500'),
|
|
529
|
-
],
|
|
530
|
-
lifespan: 1000,
|
|
531
|
-
});
|
|
288
|
+
class MyCustomScene extends Phaser.Scene {
|
|
289
|
+
create(): void {
|
|
290
|
+
this.pw // <-- Valid instance in your ts file
|
|
532
291
|
```
|
|
533
292
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
## 🎮 Integration with Phaser (no theme)
|
|
537
|
-
|
|
538
|
-
### Scene Setup
|
|
293
|
+
#### 3.1 - Cast way
|
|
539
294
|
|
|
540
|
-
|
|
541
|
-
import { Color, FontSize } from 'phaser-wind';
|
|
295
|
+
The original `Phaser.Scene` does not know the `pw` from Phaser-wind. You can make a simple cast to solve this problem
|
|
542
296
|
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
297
|
+
```ts
|
|
298
|
+
import Phaser from 'phaser';
|
|
299
|
+
import { type ThemeType } from 'src/theme.ts' // In your project
|
|
300
|
+
|
|
301
|
+
class MyCustomScene extends Phaser.Scene {
|
|
302
|
+
create(): void {
|
|
303
|
+
const { pw } = (this as unknown as SceneWithPhaserWind<Theme>); // cast to get the pw property
|
|
304
|
+
this.cameras.main.setBackgroundColor(pw.color.slate(900));
|
|
305
|
+
|
|
306
|
+
this.add
|
|
307
|
+
.text(300, 100, 'Primary color', {
|
|
308
|
+
fontSize: pw.fontSize.css('2xl'), // use the pw property to get the font size
|
|
309
|
+
color: pw.color.rgb('primary'), // use the pw property to get the color with type safety
|
|
310
|
+
})
|
|
311
|
+
.setOrigin(0.5);
|
|
312
|
+
```
|
|
547
313
|
|
|
548
|
-
|
|
549
|
-
// Background gradient effect
|
|
550
|
-
const bg = this.add.graphics();
|
|
551
|
-
bg.fillGradientStyle(
|
|
552
|
-
Color.hex('slate-900'), // top-left
|
|
553
|
-
Color.hex('slate-800'), // top-right
|
|
554
|
-
Color.hex('slate-800'), // bottom-left
|
|
555
|
-
Color.hex('slate-700') // bottom-right
|
|
556
|
-
);
|
|
557
|
-
bg.fillRect(0, 0, this.cameras.main.width, this.cameras.main.height);
|
|
558
|
-
|
|
559
|
-
// Consistent UI elements
|
|
560
|
-
this.createTitle();
|
|
561
|
-
this.createMenu();
|
|
562
|
-
}
|
|
314
|
+
#### 3.2 - Inheritance way
|
|
563
315
|
|
|
564
|
-
|
|
565
|
-
this.add
|
|
566
|
-
.text(this.cameras.main.centerX, 150, 'MY AWESOME GAME', {
|
|
567
|
-
fontSize: FontSize.css('4xl'),
|
|
568
|
-
fill: Color.rgb('yellow-400'),
|
|
569
|
-
stroke: Color.rgb('yellow-700'),
|
|
570
|
-
strokeThickness: 3,
|
|
571
|
-
})
|
|
572
|
-
.setOrigin(0.5);
|
|
573
|
-
}
|
|
316
|
+
Phaser-wind export an abstract class to type the `Phaser.Scene` and add the attribute `pw`.
|
|
574
317
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
}
|
|
318
|
+
```ts
|
|
319
|
+
import Phaser from 'phaser';
|
|
320
|
+
import { type ThemeType } from 'src/theme.ts' // In your project
|
|
321
|
+
|
|
322
|
+
class PreviewScene extends SceneWithPhaserWind<ThemeType> { // Inherit from SceneWithPhaserWind to get the pw property
|
|
323
|
+
create(): void {
|
|
324
|
+
const { color, fontSize, spacing, radius, font, shadow } = this.pw; // Don't need to cast because we're using the generic type
|
|
325
|
+
|
|
326
|
+
// ✅ Type-narrowed to your theme
|
|
327
|
+
color.rgb('primary');
|
|
328
|
+
fontSize.css('lg');
|
|
329
|
+
spacing.px('gutter');
|
|
330
|
+
radius.css('card');
|
|
331
|
+
font.family('display');
|
|
332
|
+
shadow.get('glow');
|
|
333
|
+
|
|
334
|
+
// ❌ Compile-time errors
|
|
335
|
+
// color.rgb('blue-501');
|
|
336
|
+
// spacing.px('unknown');
|
|
595
337
|
```
|
|
596
338
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
## 🔧 Advanced Usage
|
|
339
|
+
### 🎮 **Real Game Example**
|
|
600
340
|
|
|
601
|
-
|
|
341
|
+
You can check some examples in our [Storybook in this clicking here](https://renatocassino.github.io/phaser-toolkit).
|
|
602
342
|
|
|
603
|
-
|
|
604
|
-
// Create consistent themes
|
|
605
|
-
const darkTheme = {
|
|
606
|
-
background: Color.hex('slate-900'),
|
|
607
|
-
surface: Color.hex('slate-800'),
|
|
608
|
-
primary: Color.hex('blue-500'),
|
|
609
|
-
secondary: Color.hex('slate-600'),
|
|
610
|
-
text: Color.rgb('slate-100'),
|
|
611
|
-
textMuted: Color.rgb('slate-400'),
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
const lightTheme = {
|
|
615
|
-
background: Color.hex('slate-50'),
|
|
616
|
-
surface: Color.hex('white'),
|
|
617
|
-
primary: Color.hex('blue-600'),
|
|
618
|
-
secondary: Color.hex('slate-200'),
|
|
619
|
-
text: Color.rgb('slate-900'),
|
|
620
|
-
textMuted: Color.rgb('slate-600'),
|
|
621
|
-
};
|
|
622
|
-
```
|
|
343
|
+
### 🎨 **Pre-built Themes**
|
|
623
344
|
|
|
624
|
-
|
|
345
|
+
```ts
|
|
346
|
+
import {
|
|
347
|
+
PhaserWindPlugin,
|
|
348
|
+
PHASER_WIND_KEY,
|
|
349
|
+
defaultLightTheme,
|
|
350
|
+
// or defaultDarkTheme
|
|
351
|
+
} from 'phaser-wind';
|
|
352
|
+
import { theme } from './theme';
|
|
625
353
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
354
|
+
new Phaser.Game({
|
|
355
|
+
plugins: {
|
|
356
|
+
global: [
|
|
357
|
+
{
|
|
358
|
+
key: PHASER_WIND_KEY,
|
|
359
|
+
plugin: PhaserWindPlugin,
|
|
360
|
+
mapping: PHASER_WIND_KEY, // scene.pw
|
|
361
|
+
data: { theme: defaultLighTheme }, // or { theme: defaultDarkTheme }
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
},
|
|
637
365
|
});
|
|
638
366
|
```
|
|
639
367
|
|
|
640
|
-
---
|
|
641
|
-
|
|
642
368
|
## 🤝 Why "Wind" instead of "Tailwind"?
|
|
643
369
|
|
|
644
370
|
We love Tailwind CSS, but we're not affiliated with them. "Phaser Wind" captures the essence:
|
|
@@ -666,16 +392,6 @@ Plus, `phaser-wind` is way easier to type than `phaser-tailwind-css-design-token
|
|
|
666
392
|
|
|
667
393
|
---
|
|
668
394
|
|
|
669
|
-
## 🔮 Coming Soon
|
|
670
|
-
|
|
671
|
-
- 📐 **Layout Utilities** - Flexbox-inspired alignment helpers
|
|
672
|
-
- 📱 **Responsive Utilities** - Breakpoint-based design tokens
|
|
673
|
-
- ⚡ **Animation Presets** - Smooth, consistent transitions
|
|
674
|
-
- 🎮 **Component Library** - Pre-built Phaser components with theme support
|
|
675
|
-
- 🔧 **CLI Tool** - Generate themes and components from the command line
|
|
676
|
-
|
|
677
|
-
---
|
|
678
|
-
|
|
679
395
|
## 🤝 Contributing
|
|
680
396
|
|
|
681
397
|
We'd love your help making Phaser Wind even better!
|
|
@@ -692,6 +408,8 @@ We'd love your help making Phaser Wind even better!
|
|
|
692
408
|
|
|
693
409
|
MIT © [CassinoDev](https://github.com/cassinodev)
|
|
694
410
|
|
|
411
|
+
Do you want to play? Go to [games.cassino.dev](https://games.cassino.dev).
|
|
412
|
+
|
|
695
413
|
---
|
|
696
414
|
|
|
697
415
|
## 🌟 Show Your Support
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../src/components/column.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../src/components/column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scene/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PhaserWindPlugin } from '../plugin/plugin';
|
|
2
|
+
import { BaseThemeConfig } from '../theme';
|
|
3
|
+
export declare abstract class SceneWithPhaserWind<T extends BaseThemeConfig = BaseThemeConfig> extends Phaser.Scene {
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param config The scene key or scene specific configuration settings.
|
|
7
|
+
*/
|
|
8
|
+
constructor(config?: string | Phaser.Types.Scenes.SettingsConfig);
|
|
9
|
+
pw: PhaserWindPlugin<T>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=scene-with-phaser-wind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-with-phaser-wind.d.ts","sourceRoot":"","sources":["../../src/scene/scene-with-phaser-wind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,8BAAsB,mBAAmB,CACvC,CAAC,SAAS,eAAe,GAAG,eAAe,CAC3C,SAAQ,MAAM,CAAC,KAAK;IACpB;;;OAGG;gBACS,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc;IAIzD,EAAE,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phaser-wind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Wind theme like Tailwind CSS for Phaser games",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
|
-
"build": "tsc --build",
|
|
61
|
+
"build": "tsc --build --force",
|
|
62
62
|
"dev": "tsc --build --watch",
|
|
63
63
|
"clean": "rm -rf dist",
|
|
64
64
|
"test": "vitest run",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// export class Column extends Phaser.GameObjects.Container {
|
|
3
|
-
// constructor(scene: Scene, x: number, y: number, width: number, height: number, children: GameObjects.Container[]) {
|
|
4
|
-
// super(scene, x, y, width, height);
|
|
5
|
-
// }
|
|
6
|
-
// }
|
|
7
|
-
//# sourceMappingURL=column.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column.js","sourceRoot":"","sources":["../../src/components/column.ts"],"names":[],"mappings":";AAAA,6DAA6D;AAC7D,wHAAwH;AACxH,yCAAyC;AACzC,MAAM;AACN,IAAI"}
|