Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netgfx/Phaser-typewriter
A phaser helper for the typewriter effect
https://github.com/netgfx/Phaser-typewriter
Last synced: about 1 month ago
JSON representation
A phaser helper for the typewriter effect
- Host: GitHub
- URL: https://github.com/netgfx/Phaser-typewriter
- Owner: netgfx
- License: mit
- Created: 2015-12-27T08:08:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-03T09:53:04.000Z (over 7 years ago)
- Last Synced: 2024-08-02T12:23:38.371Z (4 months ago)
- Language: JavaScript
- Size: 871 KB
- Stars: 39
- Watchers: 3
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-web-effect - Phaser-typewriter - A phaser helper for the typewriter effect (🚀 A series of exquisite and compact web page cool effects / Input Effect)
- fucking-awesome-web-effect - Phaser-typewriter - A phaser helper for the typewriter effect (🚀 A series of exquisite and compact web page cool effects / Input Effect)
README
[![forthebadge](http://forthebadge.com/images/badges/uses-js.svg)](http://forthebadge.com)
# Phaser-typewriter
A typewriter effect wrapper for Phaser.io Javascript libraryInitialize the typewriter anywhere in your game
```
var typewriter = new Typewriter();
typewriter.init(gameInstance, options);
```pass necesery options like: context (the object that launches the typewriter)
```
typewriter.init(gameInstance, {
x: 290,
y: 40,
fontFamily: "chillerBlack",
fontSize: 26,
maxWidth: 300,
sound: reg.track,
text: "Some text to be typed!"
});
typewriter.start();
```
View example: Complete example (make sure to listen to the writing sound playing in the background ;) )
Game Instance
The game instance that we want the tooltips to appear to, such as "game"General Options:
-
text: The text to be written automatically -
x The x position of the text (default: 100) -
y The y position of the text (default: 100) -
writerObj A Phaser.Text or Phaser.BitmapText object, pre-created -
writerFn: The function to call when writing the text (default: null) -
endFn: The function to call when the writing ends (defailt: null) -
time: The duration of the animation effect writing each letter (default: 100ms) -
maxWidth: The maximum width where the text will wrap (default: 200) -
fontFamily: The font family for the text to be writen (default: Arial) -
fontSize: The font size for the text (default: 28) -
sound: The sound effect to play during the typewriter effect, it auto-stops when typing ends (default: null)
API Functions
-
init: Adds the options and game object to the Typewriter constructor -
start: Enables and starts the typewriter effect -
destroy: Destroys the typewriter object -
hideText: Hide the text -
showText: Show the text -
moveToTop: Move the text to the top
>The TODO list is diminising!
>Please let me know if you come across some bug or have something to contribute