StarlingGraphics / Starling-Extension-Graphics

flash.display.Graphics style extension for the Starling Flash GPU rendering framework
https://github.com/StarlingGraphics/Starling-Extension-Graphics/wiki
MIT License
282 stars 89 forks source link

Fix a bug of using material. #120

Closed pwang08 closed 9 years ago

pwang08 commented 10 years ago

Hi, I'm using this extension to develop a game now.

It has no effect even color is set to material when I use TextureMaterial to draw a line. I read the code found that the color of material isn't set to the final color, so I did some changes and finally it works.

IonSwitz commented 10 years ago

Hello, pwang08, thank you for submitting this pull request.

The "material" variable can be null in the lineMaterial method, in fact, it is the default argument, and in that case, your submitted code will crash.

I hope I have some time this weekend to investigate what should be done in this scenario, but the pull request as it is submitted now will not be merged, for the reasons stated above.

pwang08 commented 10 years ago

Why not add a condition to check the "material" variable, if it's null, the set it to 0xFFFFFF, else use the color of material instead.

If the color isn't set, there isn't a way in which the given color blends with the texture.

IonSwitz commented 9 years ago

I have checked in the equivalent code, closing Pull Request