Is there any way in cocos2d-x to implement stretchable Image effect?

Is there any way in cocos2d-x to implement stretchable Image effect?
0.0 0

#1

hello guys,

the following code snippet gives a stretchable image effect when button content is variable.

UIImage *buttonImage = [[UIImage imageNamed:@“Button”] stretchableImageWithLeftCapWidth:15 topCapHeight:0];
[self setBackgroundImage:buttonImage forState:UIControlStateNormal];

Is there any method to implement this in cocos2d-X?

thanks.


#2

Can you show a pic of what you want to achieve, please.


#3

Sorry to give the images presentation. Please look following.

before image : http://postfiles6.naver.net/20091019_85/jun0683_1255941958601C1KQo_png/green_jun0683.png?type=w2

after image : http://postfiles5.naver.net/20091019_84/jun0683_12559419613787bC6n_png/green4_jun0683.png?type=w2


#4

Referral Denied
You don’t have permission to access
"http://postfiles5.naver.net/20091019_84/jun0683_12559419613787bC6n_png/green4_jun0683.png?"
on this server.
Reference #24.55d11597.1510480634.6bebf593

the correct links are:


#5

I can’t see the pictures, but I’m going to tab a wild stab and ask if Scale9Sprite is what you are after.

Can’t find a better picture than that. But basically a sprite the can be stretched, while maintaining the corners and only stretching the borders along one axis.