chrisgregan
11 years ago
9 changed files with 50 additions and 80 deletions
@ -0,0 +1,36 @@
|
||||
Using Sprites |
||||
============= |
||||
|
||||
# How do I control sprite visibility? |
||||
|
||||
1. Add a public SpriteRenderer property to your Room script and setup a reference to your SpriteRenderer object in the inspector. |
||||
2. Use the [ShowSprite](@ref Fungus.GameController.ShowSprite) command to make a sprite visible instantly. |
||||
3. Use the [HideSprite](@ref Fungus.GameController.HideSprite) command to make a sprite invisible instantly. |
||||
4. Use the [FadeSprite](@ref Fungus.GameController.FadeSprite) command to fade a sprite in or out over a period of time. |
||||
|
||||
## C# Code Example |
||||
~~~~~~~~~~~~~~~~~~~~ |
||||
using UnityEngine; |
||||
using System.Collections; |
||||
using Fungus; |
||||
|
||||
public class MyRoom : Room |
||||
{ |
||||
public SpriteRenderer mySprite; |
||||
|
||||
void OnEnter() |
||||
{ |
||||
HideSprite(mySprite); // Sets sprite alpha to 0 (invisible) |
||||
Wait(5); |
||||
ShowSprite(mySprite); // Sets sprite alpha to 1 (fully visible) |
||||
Wait(5); |
||||
FadeSprite(mySprite, 0f, 5f); // Fades sprite alpha to 0 over 5 seconds |
||||
} |
||||
} |
||||
~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
## Notes |
||||
- The [FadeSprite](@ref Fungus.GameController.FadeSprite) command does not pause command execution. This allows for fading multiple sprites simultaneously. |
||||
- Use a [Wait](@ref Fungus.GameController.Wait) command if you need to wait for a sprite fade to finish before continuing. |
||||
|
||||
- - - |
@ -1,4 +1,4 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 9fbec5fce88b84a7db29d72d3aefddc4 |
||||
guid: dc24541bca65e4768a8cd00cf7e8f77f |
||||
DefaultImporter: |
||||
userData: |
@ -1,40 +0,0 @@
|
||||
Planned Features |
||||
================ |
||||
|
||||
# Cross Fade |
||||
- Fade a sprite over time to use a different texture. |
||||
|
||||
~~~~~~~~~~~~~~~~~~~~ |
||||
CrossFade(SpriteRenderer spriteRenderer, Texture2D texture2D, float duration); |
||||
~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
# Page Icons |
||||
- Set a sprite icon on left or right side of the active page |
||||
- Size is specified as a fraction of screen height for consistent display on different device types |
||||
|
||||
~~~~~~~~~~~~~~~~~~~~ |
||||
SetLeftIcon(Texture2D texture2D, float iconScale); |
||||
SetRightIcon(Texture2D texture2D, float iconScale); |
||||
SetNoIcon(); |
||||
~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
# More examples |
||||
- Examples Rooms showing usage for common game types (RPG, Visual Novel, Comic Strip, ...) |
||||
|
||||
# Fixed Page |
||||
- Option to clamp page to bottom or top section of screen (standard Visual Novel layout) |
||||
|
||||
# Comic Strip Bubbles |
||||
- Comic strip style bubbles |
||||
- Automatic fitting for bubble text |
||||
|
||||
# Button Hover |
||||
- Highlight buttons on mouse hover |
||||
|
||||
# New Unity GUI Support |
||||
- Complete rewrite Page system to use new Unity GUI system (when it's released!) |
||||
- Support checkboxes, scroll boxes, sliders, advanced font rendering, ... |
||||
|
||||
# Dice Roll Page |
||||
- Simple combat system via visual dice roll |
||||
|
Binary file not shown.
Loading…
Reference in new issue