is the image file 450x200?
This setup also defeats the purpose to scale9, as the 8 edge pieces here are 0x0, as in same to just use a Sprite with setScale.
Yes, it is a small size of 50x50 pixels. I am trying to display scoreboard, the scoreboard size based on players (450x200 is for 4 players and maximum of 6 players, minimum of 2 players).
On this case:
What would be the image file size?
And what suppose to be ‘rest’ and ‘capInsets’ sizes?
capInsets are relative to the texture you are using.
For example:
Let’s say I want this above image to be Scale9, to where I can have it in any size/aspect ratio…
The reason I would choose to do that, is that I would want to preserve the outer border to not stretch/distort… If I node->setScale(4,1); on that as a regular Sprite, the border on top and sides will not be uniform in width, they would be stretched, and the node would not have the visual I am shooting for that Scale9 can provide.
In that case, if this texture for example is 100x100, and the border is 2px wide, my capInsets would be something like Rect(2,2,96, 96);
Then if I set the Scale9 Size to be, say, 450x200, the inner part would scale uniformly, but the outer perimeter would keep its 2px width.
If I did a capInsets of greater than the original 100x100 texture, I would get the same error you posted above, as the texture does not extend that far.
Hope that clears some of it up… for one last visual, this is what you try to accomplish with Scale9: