> For the complete documentation index, see [llms.txt](https://spectrexr.gitbook.io/octoxr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spectrexr.gitbook.io/octoxr/general/screenfader.md).

# ScreenFader

* Creates a canvas as a child of Camera which will be used to fade in and out
* Requires component of type Camera

### Public Fields

float FadeInSpeed

float FadeOutSpeed

bool IsFadeInProgress

UnityEvent onFadeInStart

UnityEvent onFadeInEnd

UnityEvent onFadeOutStart

UnityEvent onFadeOutEnd

### Public Methods

void DoFadeIn()

void DoFadeOut()

float GetCanvasGroupAlphaValue()

### Example

```csharp
private IEnumerator DoTeleport()
{
    screenFader.DoFadeIn();
            
    while (screenFader.GetCanvasGroupAlphaValue() != 1f)
    {
        yield return new WaitForEndOfFrame();
    }
    
    Teleport();
    screenFader.DoFadeOut();
}
```
