Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Centribo/RPG-Text-System
A system for displaying text in Unity like in old RPG games.
https://github.com/Centribo/RPG-Text-System
Last synced: about 1 month ago
JSON representation
A system for displaying text in Unity like in old RPG games.
- Host: GitHub
- URL: https://github.com/Centribo/RPG-Text-System
- Owner: Centribo
- License: cc0-1.0
- Created: 2015-12-04T23:28:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-20T00:03:38.000Z (about 9 years ago)
- Last Synced: 2024-08-02T05:13:13.863Z (5 months ago)
- Language: C#
- Homepage:
- Size: 184 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# RPG-Text-System
A system for displaying text in Unity like in old RPG games.## Usage
1. Add TextHandler prefab to your scene.
![Screenshot 1](Screenshots/s1.PNG?raw=true "Screenshot 1")
2. Or, create a new object and attach the TextHandler script, and a AudioSource in the inspector
![Screenshot 2](Screenshots/s2.PNG?raw=true "Screenshot 2")
2. Link the "Text Box" field in the TextHandler script to a textbox in the scene
![Screenshot 3](Screenshots/s3.PNG?raw=true "Screenshot 3")
3. In another script/object, or internally within TextHandler, create a new Voice().
Voice() takes 4 parameters for its constructor:
1. float rate: How time, in seconds, between each character reveal
2. float low: The pitch of the lowest possible note (Expressed as a pitch coefficient)
3. float high: The pitch of the highest possible note
4. AudioClip sound: A reference to a AudioClip to be played when revealing notes. (See Unity documentation)
4. Link the Voice to TextHandler using TextHandler.SetVoice(Voice v)
**For example: GetComponent().SetVoice(new Voice(0.1f, 1, 5, sound));**
5. Give TextHandler an array of strings to display using TextHandler.SetText(string[] newText)
6. Now, call TextHandler.AdvanceLine() to start advancing lines. (By default, this is set to OnMouseUp)## Example Scene
Included is a Example.unity scene is included to show how to properly load TextHandler and use it.
Within TextHandler.cs, Void Start(), uncomment these lines to try it out:```
AudioClip sound = Resources.Load("bleep") as AudioClip;
Voice v = new Voice(0.1f, 1, 3, sound);string [] examples = {"Hello world!", "Test text!"};
SetVoice(v);
SetText(examples);
```## License
CC0