Colortransform

author:
Romain Théry
description:
A MeshStyle for Starling 2 to emulate flash.display.ColorTransform
compatible:
v2.3
tag:
MeshStyle, Style
homepage:
https://github.com/rthery/starling-colortransform

Overview

The use of this style is almost exactly similar to the native flash.displayColorTransform.

Here's a simple example on how to turn a fuchsia texture to blue.

var image : Image = new Image(Texture.fromColor(256, 256, 0xFF00FF));
image.style = new ColorTransformStyle(0, 0, 1);
addChild(image);

You can play with this comparaison demo as well:

The Adobe Flash Plugin is needed to display this content.

However, please note that currently the DisplayObject alpha will be ignored, you'll need to use exclusively the alpha multiplier of the ColorTransformStyle for now. Regarding the Mesh color property, it will act the same as setting the color property on a ColorTransform (because setting the color on a Starling Mesh will actually applies it to its style)

Changelog

  • 2018/05/09 13:03: First public version

Source Code

User Comments

Please use this forum thread

  extensions/colortransform.txt · Last modified: 2018/05/12 16:40 by romain
 
Powered by DokuWiki