9Patch only draw at beginning of the scene

I’m working on a project right now where I’ve noticed that the 9patch sprite can cause significant lag if I have more than say 10 in the scene. The reason I’m using 9patch sprite in my project is for convenience, not having to make multiple object sizes and instead just using the 9patch makes it easy to just make stuff. For people like me, I think it would be nice to have an option under the 9patch to not update it during the game, saving resources for other things. Having it not worry about size changes during the game would certainly free up resources.

Of course I don’t know how the 9patch works, and if this isn’t an issue then feel free to correct me, but If it is, having this as a performance option would be unbelievably useful to people like, who don’t care about it updating in real time.

When is the lag happening, on your computer or on a mobile device?
Are the panel sprites moving or being resized?
What size is the texture(s)?
What else is happening in the scene? Can we see a screenshot of the game? Any behaviors?

I’ve been playing around with a Donkey Kong clone. All of the girders and ladders are instances of 2 panel sprites. On my PC, I haven’t noticed any lagging. The barrels are using the physics behavior.

But… The graphics are just placeholders, the image files are small (under 64x64), they don’t move or change size Even under heavy testing with a lot of barrels, I haven’t noticed any issues.

In the right side image, I’m using a shape painter to draw and debug the barrel movement.

You’re making me wonder if I’m going to have to change my technique when/if I improve the graphics.
IMG_20230119_222839

It seems that there is a general problem with the panel sprites:

1 Like