font-awesome-for-phaser 0.3.7 → 0.4.0
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 +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,9 +60,16 @@ const iconText = scene.add.text(0, 0, char, {
|
|
|
60
60
|
color: '#ffffff',
|
|
61
61
|
});
|
|
62
62
|
iconText.setOrigin(0.5);
|
|
63
|
+
scene.add.existing(iconText);
|
|
63
64
|
|
|
64
65
|
// Or you can use our component
|
|
65
66
|
import { IconText } from 'font-awesome-for-phaser';
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
// PS: `this` is the scene
|
|
69
|
+
const icon = new IconText(this, 90, 90, 'gamepad', 64, {
|
|
70
|
+
color: '#0066cc',
|
|
71
|
+
});
|
|
72
|
+
this.add.existing(icon); // Don't forget to add in scene
|
|
68
73
|
```
|
|
74
|
+
|
|
75
|
+
<img src="data/image.png" alt="example of button">
|