Skip to content

Extension for Feathers library that enables alpha transition between different component state skins.

License

Notifications You must be signed in to change notification settings

marpies/feathers-fadeimageskin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

FadeImageSkin for Feathers

Extension for Feathers library that enables alpha transition between different component state skins.

Overview

Usage is identical to the original ImageSkin:

import feathers.extensions.FadeImageSkin;
...
var skin:FadeImageSkin = new FadeImageSkin( upTexture );
skin.setTextureForState( ButtonState.DOWN, downTexture );
skin.setTextureForState( ButtonState.DISABLED, disabledTexture );
skin.scale9Grid = scale9Grid;
button.defaultSkin = skin;

You can specify duration and transition for fade in and fade out Tweens.

// These are all default values
skin.fadeInDuration = 0.5;
skin.fadeInTransition = Transitions.EASE_OUT;
skin.fadeOutDuration = 0.5;
skin.fadeOutTransition = Transitions.EASE_IN;

As with the original ImageSkin, you can set a color for each state:

skin.setColorForState( ButtonState.UP, 0x0000FF );
skin.setColorForState( ButtonState.DOWN, 0xFF0000 );

Furthermore, you can enable tweening of the color between each state which is useful if you are using a single texture.

var skin:FadeImageSkin = new FadeImageSkin( defaultTexture );
skin.setColorForState( ButtonState.UP, 0x0000FF );
skin.setColorForState( ButtonState.DOWN, 0xFF0000 );
skin.tweenColorChange = true;
skin.colorTweenDuration = 0.5;
skin.colorTweenTransition = Transitions.EASE_OUT;
button.defaultSkin = skin;

Requirements

Author

Marcel Piestansky

About

Extension for Feathers library that enables alpha transition between different component state skins.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published