Movie color property for basic tinting#93
Movie color property for basic tinting#93kpatelPro wants to merge 2 commits intotconkling:masterfrom
Conversation
|
I'm not sure about this. Why not just use a generic (Also, what happens when you have a Movie with a color that gets added as the child of another Movie with a different color?) |
|
Using a generic setColor method would not account for display objects being removed and added to a Layer as the timeline advances. The proposed implementation deep-dives all child layers and all layer-displays (including sub-movies) and sets their colors all at once. AFAICT this would only break if a child was added to a flump Movie programatically (i.e. from code external to flump.display) after set color was called. In this case the user would need to apply the tint manually (newChild.color = newParent.color;) when adding the new child. IMHO, that is an acceptable caveat. An alternative implementation of 'set color' that would automatically account for this possibility would set the local _color field and all current children's color, and then also apply color whenever a child was added (i.e. overriding addChild). I opted away from this solution as it would be slightly less performant for Movies which did not have a tint applied and it would also complicate handling of child tinting (tinting child elements differently than parent tint). --Ken p.s.: Good call checking for Quad rather than Image in the setColor/colorDisplay method. |
Add a color property to flump.display.Movie basic tinting.
Implemented by propagating color value to leaf Image nodes in Movie display hierarchy.