DeckStacker v1.0
A card manager plugin for Unity games.
 
Loading...
Searching...
No Matches
DeckStacker.DSCardFader Class Reference
Inheritance diagram for DeckStacker.DSCardFader:

Public Member Functions

void FadeToTargetAlpha (float fadeTarget_, float fadeSpeed_=_DEFAULT_FADE_SPEED)
 
void FadeOutFull (float fadeSpeed_=_DEFAULT_FADE_SPEED)
 
void FadeInFull (float fadeSpeed_=_DEFAULT_FADE_SPEED)
 
void ForceVisibilityState (DSVisibilityState forceState_)
 
float GetCurrentAlpha ()
 
DSVisibilityState GetVisibilityState ()
 
bool FadeActive ()
 

Properties

float fadeDefault [get, set]
 

Detailed Description

This script controls the opacity of a card, given that all card art is UGUI-compatible.

The opacity of a card is controlled with a Canvas Renderer, so if you are not using UGUI-compatible art and/or text, you'll need to adjust this script to compensate for it.

This script assumes you want the card to be either 100% or 0% opaque when idle. If you want to adjust a card to be partially opaque, you'll need to extend the functionality of this script.

Should be attached to a DSCard prefab.

Member Function Documentation

◆ FadeActive()

bool DeckStacker.DSCardFader.FadeActive ( )
inline

Returns whether the card is currently fading.

◆ FadeInFull()

void DeckStacker.DSCardFader.FadeInFull ( float fadeSpeed_ = _DEFAULT_FADE_SPEED)
inline

Call this to fade the card to 100% opacity.

fadeSpeed is a time multiplier.

If no fadeSpeed is input, than a _DEFAULT_FADE_SPEED constant is used.

◆ FadeOutFull()

void DeckStacker.DSCardFader.FadeOutFull ( float fadeSpeed_ = _DEFAULT_FADE_SPEED)
inline

Call this to fade the card to 0% opacity.

fadeSpeed is a time multiplier.

If no fadeSpeed is input, than a _DEFAULT_FADE_SPEED constant is used.

◆ FadeToTargetAlpha()

void DeckStacker.DSCardFader.FadeToTargetAlpha ( float fadeTarget_,
float fadeSpeed_ = _DEFAULT_FADE_SPEED )
inline

Call this method to change the card's opacity.

fadeSpeed is a time multiplier.

A fadeSpeed of 0 results in an instant change to the fadeTarget.

If no fadeSpeed is input, than a _DEFAULT_FADE_SPEED constant is used.

◆ ForceVisibilityState()

void DeckStacker.DSCardFader.ForceVisibilityState ( DSVisibilityState forceState_)
inline

Call this to instantly make the card visible or hidden with no gradual fade.

◆ GetCurrentAlpha()

float DeckStacker.DSCardFader.GetCurrentAlpha ( )
inline

Returns the CanvasGroup's current alpha value.

◆ GetVisibilityState()

DSVisibilityState DeckStacker.DSCardFader.GetVisibilityState ( )
inline

Returns a DSVisibilityState, a general describer of what visual state the card is in.

Property Documentation

◆ fadeDefault

float DeckStacker.DSCardFader.fadeDefault
getset

A default alpha value for the card. By default DSCard should have a CanvasGroup attached to control card fade.


The documentation for this class was generated from the following file: