stretch Image to what you would like to be!

some of my friend had import DecoratedBox from cocos2d to cocos2d-x version!
i improve something
calculate DecoratedBox’s real width and height to be more accurate !

it’s easy to use like this

DecoratedBox* backGroundSprite = DecoratedBox::decoratedBoxWithFile(“60019.png”,440, 100);
backGroundSprite~~>setPosition);
this~~>addChild(backGroundSprite, 0);


DecoratedBox.zip (2.1 KB)

it’s the cocos2d-iphone version . you can take the resource image from this project for test!

NEW FEATURE FOR Opacity SETTING

thanks for your great work!

when I test it in cocos2d v2.0, I find there are some little errors.

so I fixed them and made it fit for the v2.0.