Adventure Creator  1.74.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2019
AC.BackgroundImage Class Reference
Inheritance diagram for AC.BackgroundImage:

Public Types

enum  BackgroundImageSource { Texture, VideoClip }
 

Public Member Functions

void SetImage (Texture2D _texture)
 Sets the background image to a supplied texture More...
 
void TurnOn ()
 
void TurnOff ()
 
void Shake (float _shakeIntensity, float _duration, AnimationCurve _shakeCurve=null)
 Shakes the background image (within the GUITexture) for an earthquake-like effect. More...
 
void CancelVideoPlayback ()
 

Public Attributes

BackgroundImageSource backgroundImageSource = BackgroundImageSource.Texture
 
VideoClip backgroundVideo
 
Texture backgroundTexture
 

Protected Member Functions

void Awake ()
 
void OnEnable ()
 
void Start ()
 
void OnDisable ()
 
void TurnOnUI ()
 
void TurnOffUI ()
 
void SetBackgroundCameraFarClipPlane (float value)
 
IEnumerator UpdateShake ()
 
void SetBackgroundTexture (Texture _texture)
 
IEnumerator PlayVideoCoroutine ()
 
void PrepareVideo ()
 

Protected Attributes

VideoPlayer videoPlayer
 
float shakeDuration
 
float startTime
 
float startShakeIntensity
 
float shakeIntensity
 
Rect originalPixelInset
 
AnimationCurve shakeCurve
 

Detailed Description

Controls a GUITexture for use in background images in 2.5D games.

Member Function Documentation

◆ SetImage()

void AC.BackgroundImage.SetImage ( Texture2D  _texture)

Sets the background image to a supplied texture

Parameters
_textureThe texture to set the background image to

◆ Shake()

void AC.BackgroundImage.Shake ( float  _shakeIntensity,
float  _duration,
AnimationCurve  _shakeCurve = null 
)

Shakes the background image (within the GUITexture) for an earthquake-like effect.

Parameters
_shakeIntensityHow intense the shake effect should be
_durationHow long the shake effect should last, in seconds

◆ TurnOff()

void AC.BackgroundImage.TurnOff ( )

Hides the background image from view.

◆ TurnOn()

void AC.BackgroundImage.TurnOn ( )

Displays the background image full-screen.

Member Data Documentation

◆ backgroundImageSource

BackgroundImageSource AC.BackgroundImage.backgroundImageSource = BackgroundImageSource.Texture

What type of asset is used as a background (Texture, VideoClip)

◆ backgroundTexture

Texture AC.BackgroundImage.backgroundTexture

The Texture to use as a background, if static

◆ backgroundVideo

VideoClip AC.BackgroundImage.backgroundVideo

The VideoClip to use as a background, if animated