Skip to content

Changing the ColorTransform of a LWF.Movie #148

Description

@DelSystem32

I have a MovieClip in my flash that is tinted 100% blue. When I in Unity run the following code:

LWF.Movie m = lwf.SearchMovieInstance ("mymovieclipinstancename");

LWF.ColorTransform ct = m.colorTransform;
Debug.Log(ct.multi.red+","+ct.multi.green+","+ct.multi.blue+","+ct.multi.alpha);
Debug.Log(ct.add.red+","+ct.add.green+","+ct.add.blue+","+ct.add.alpha);

ct = new LWF.ColorTransform(0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f);
m.SetColorTransform(ct);
lwf.ForceExecWithoutProgress();

ct = m.colorTransform;
Debug.Log(ct.multi.red+","+ct.multi.green+","+ct.multi.blue+","+ct.multi.alpha);
Debug.Log(ct.add.red+","+ct.add.green+","+ct.add.blue+","+ct.add.alpha);

The MovieClip does indeed change color correctly. However, I'm not getting the correct console output:

0,0,0,1
0,0,0.9960938,0
1,1,1,1
0,0,0,0

Here is what the output should be like:

0,0,0,1
0,0,0.9960938,0
0.5,0.5,0.5,0.5
0.5,0.5,0.5,0.5

It looks like the SetColorTransform() method of LWF.Movie does not update its colorTransform field properly after it has reflected any changes (it just resets it). This is probably a bug, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions