Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samme/phaser-teletype
Simple typing animation
https://github.com/samme/phaser-teletype
phaser
Last synced: 28 days ago
JSON representation
Simple typing animation
- Host: GitHub
- URL: https://github.com/samme/phaser-teletype
- Owner: samme
- Created: 2017-02-26T22:11:15.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T04:21:31.000Z (almost 8 years ago)
- Last Synced: 2024-12-17T01:19:57.058Z (about 2 months ago)
- Topics: phaser
- Language: CoffeeScript
- Homepage: https://samme.github.io/phaser-teletype/
- Size: 429 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Screenshot](https://samme.github.io/phaser-teletype/screenshot.png)
[Demo](https://samme.github.io/phaser-teletype/)
Use
---```javascript
var teletype = game.add.teletype({
autoStart: true,
cursorChar: "_",
rate: 20,
text: "Amazingly few discotheques provide jukeboxes",
textTarget: textOrBitmapTextObject
});// Without `autostart`:
teletype.start();
// Events:
teletype.onComplete.add(function (){
// …
});
```Options
-------Options must include `text`, `textTarget`, and either `rate` or `duration`.
- `autoStart`: start immediately (default: `false`)
- `rate`: typing speed (characters/second); 10–30 is typical
- `duration`: length of the entire animation (ms)
- `cursorChar`: character placed at the end of `text` (default: empty string)
- `text`
- `textTarget`: a [BitmapText](http://phaser.io/docs/2.6.2/Phaser.BitmapText.html) or [Text](http://phaser.io/docs/2.6.2/Phaser.Text.html) object