Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the ColorTransform of a LWF.Movie #148

Open
DelSystem32 opened this issue Oct 25, 2015 · 1 comment
Open

Changing the ColorTransform of a LWF.Movie #148

DelSystem32 opened this issue Oct 25, 2015 · 1 comment

Comments

@DelSystem32
Copy link
Contributor

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?

@DelSystem32
Copy link
Contributor Author

There does also seem to be some problem between using SetAlpha() and then getting the colorTransform of a LWF.Movie. SetAlpha() doesn't update the alpha value of LWF.Movie's colorTransform so you may end up changing the alpha during the SetColorTransform().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant