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);

Have a look at this comparison demo, as well:

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

%gist(30a7308b6384a0290a2cb0566c1f23f4)%

User Comments

Please use this forum thread

  extensions/colortransform.txt · Last modified: 2021/01/07 15:55 by daniel
 
Powered by DokuWiki