Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.85k stars 819 forks source link

Filter setters in Starling 2.0 should be chainable just like in 1.x #824

Closed matyasatfp closed 8 years ago

matyasatfp commented 8 years ago

This code throws an error in 2.0 beta:
myFilter = new ColorMatrixFilter().adjustBrightness(-0.5);

adjustBrightness (and all similar functions in Filters) were returning the Filter instance in Starling 1.x, allowing to easily chain properties.

PrimaryFeather commented 8 years ago

Sorry, I decided to remove those return values. I know it's a standard in some other programming languages, but they are neither used in the AS3 Standard Library, nor in the rest of the Starling Framework. So it always felt somewhat out of place to me, since it's just not consistent.

I'm aware that not everyone will happy about this change, and I apologize for the troubles — but I simply need to be consistent with my own set of rules, and not ignore them on a case-by-case basis. :neutral_face:

(Like I did in the old version.)