There is a / node texture with rounded edges, and it is necessary to change its width and height, but at the same time that the corners remain as they are, i.e. stretch the texture / node in the center, without touching the edges. There was an easy way to do this, but I can’t find it.
1 answer
You need resizableImageWithCapInsets:
Use something like this:
UIImage *myImage = [someImage resizableImageWithCapInsets:UIEdgeInsetsMake(1, 1, 1, 1)]; will create a new UIImage based on this, with a constant one pixel on each side and a center stretched.
- Also found under SpriteKit: developer.apple.com/library/content/documentation/… - xXxxX
|
