Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hywax/phaser-font-plugin
Phaser 3 plugin to load fonts
https://github.com/hywax/phaser-font-plugin
font loader phaser-plugin phaser3 phaserjs plugin
Last synced: 4 months ago
JSON representation
Phaser 3 plugin to load fonts
- Host: GitHub
- URL: https://github.com/hywax/phaser-font-plugin
- Owner: hywax
- License: mit
- Created: 2024-04-24T14:23:23.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-05-28T19:04:35.000Z (8 months ago)
- Last Synced: 2024-05-29T10:14:01.717Z (8 months ago)
- Topics: font, loader, phaser-plugin, phaser3, phaserjs, plugin
- Language: JavaScript
- Homepage:
- Size: 1.77 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Phaser Font Plugin
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]Phaser Font Plugin is a lightweight plugin that allows you to load fonts in your Phaser 3 game.
## 🎯 Features
* 🚀️ Easy to use
* 📦️ Lightweight ~ 600 bytes
* 🌐️ XHRSettings support
* 0️⃣ Zero dependencies
* 🪄️ TypeScript support## ✨ Installation
```shell
# Using pnpm
pnpm add phaser-font-plugin# Using yarn
yarn add phaser-font-plugin# Using npm
npm install phaser-font-plugin
```## ⚡ Usage
### Load the plugin
Add the plugin to the list of global plugins in your game configuration.
```typescript
import { Game } from 'phaser'
import { FontPlugin } from 'phaser-font-plugin'export default new Game({
plugins: {
global: [
{
key: 'FontPlugin',
plugin: FontPlugin,
start: true,
},
],
},
})
```### Use the plugin
Use the plugin to load fonts in your scenes.
```typescript
import { Scene } from 'phaser'export default class Boot extends Scene {
preload() {
this.load.font('pixeloid', 'assets/fonts/pixeloid.ttf')
}
}
```## 🌟 Credits
A huge thank you to everyone who is helping to improve Phaser Font Plugin. Thanks to you, the project can evolve!
### Contributors
To become a contributor, please follow our [contributing guide](.github/CONTRIBUTING.md).
## 📝 License
Licensed under the [MIT License](./LICENSE.md).
[npm-version-src]: https://img.shields.io/npm/v/phaser-font-plugin/latest.svg?logo=hackthebox&color=00bcd4&logoColor=fff
[npm-version-href]: https://npmjs.com/package/phaser-font-plugin
[npm-downloads-src]: https://img.shields.io/npm/dm/phaser-font-plugin.svg?logo=simpleanalytics&colorB=00bcd4&logoColor=fff
[npm-downloads-href]: https://npmjs.com/package/phaser-font-plugin
[license-src]: https://img.shields.io/badge/License-MIT-00bcd4?logo=opensourceinitiative&logoColor=fff
[license-href]: https://npmjs.com/package/phaser-font-plugin