How would I define a spritesheet in-code?

*NOTE: Both of these were made with Cocos2d-x.
So, I would like to turn this (screenshot from my W.I.P fanmade Geometry Dash 2.2, NOTICE THE STRETCH):

But I would like it to look like this (screenshot from the real game Geometry Dash, NOTICE THE NON-STRETCH):
[](https://(LINK TO IMAGE))

I don’t understand your images.

You can make a sprite sheet using TexturePacker and call it in code.

Or you could make xml and parse it.

I could be way off base if your screenshots are telling more that I don’t acknowledge.

The effect you’re seeing has nothing to do with whether you use sprite sheets or not. If you need the borders of a sprite to remain the same scale while still stretching the inner section, then you need to use the ui::Scale9Sprite. The cpp-tests project has examples.