ButtonFadeDisplay.cs - MitchOSully/Visualising-the-DFN-Dataset GitHub Wiki
Summary
Takes care of displaying the error message for the date input box, and fading it away. Shows the error message in a button object on the screen.
To do: show an image of the error button.
List of Functions
void Display(string message)
IEnumerator DisplayRoutine(string message)
Public Global Variables
float displayTime = 1
Time that the message is displayed before the fade commences. Default is 1 seconds.
float fadeOutTime = 0.5
Time taken to fade out. Default is 0.5 seconds.
GameObject messageButton
The button that we will display the text on.
void Display(string message)
Makes the button visible on the screen. Then begins the display routine, which will delete it after a given amount of time.
Params
Name | Type | Description |
---|---|---|
message |
string |
The text that is shown in the button in red text. |
Returns
None
Calls
Called By
IEnumerator DisplayRoutine(string message)
While this routine runs, the program can do general running simultaneously. It firstly does nothing for displayTime
seconds. Then fades the button into transparency over a time period fadeOutTime
seconds. Finally, it deletes the button.
Params
Name | Type | Description |
---|---|---|
message |
string |
The text that is shown in the button in red text. |
Returns
None
Calls
None