cocos2d-objc
cocos2d-objc copied to clipboard
Setting colorRGBA does not set alpha
Setting colorRGBA on CCNodeColor does not set color correctly, unless cascade opacity is enabled.
I honestly don't really understand why color and colorRGBA are separated. Maybe for cascading purposes, I didn't look into that yet. Will see what we can do about it.
I also don't understand why we still maintain types like ccColor4F
. The whole color things must be refactored I guess.
The ccColor4F guff was due to die in 4.0 wasn't it?. Suspect it was considered too much of (another) major back compatibility break during the 2.x to 3.x process. Pain though isn't it?
The whole cascade colour/opacity has some serious issues as well. Will try and dig them out and file issues/PRs now this is active again.
CCColor was created to bridge all the different color types. Personally I voted that it should be a simple struct (and work more like CGPoint), and I have always hated that CCColor is immutable.
color just sets the color, and not opacity. This is how cocos2d always worked. colorRGBA was added to be able to set a color including opacity.
As mentioned, the cascade functionality has some issues, like the one I just reported.
Making it a struct would be much better, but Obj-C doesn't have methods for structs as Swift has :(