cocos2d-objc
cocos2d-objc copied to clipboard
CCSprite9Slice interface changes
Hi! I propose to introduce margins property for CCScale9Sprite which allows to set all margins at one time. It is really better in some cases. For example:
// I want to set left margin to 0.8 and right margin to 0.1. I write such code:
CCSprite9Slice* ninepatch = ...;
ninepatch.marginLeft = 0.8; // NSAssert in `setMarginLeft:` is triggered, because default margin is 0.(3) and (0.8 + 0.(3)) > 1.0
ninepatch.marginRight = 0.1;
Yes, I can swap two lines and it will work as properly, but it is really annoying. New property margins allows to avoid such problems.