ShapePainter performance

Hello GDevs, I’m currently making an endless runner and I’m using shape painter to create a line (platform) and keep creating them as the players advances in the game. The thing is that I only see one line at the debugger and I don’t know if the performance can be affected after creating xs number of lines. I don’t know if shape painter only extends the same object or how’s it working. Any idea on how it works and how to avoid performance issues?

The Shape Painter works like a canvas. You can add shapes and clear it. It grows as you add to it. It’s not particularly efficient. I’ve experienced lag after drawing a lot of shapes onto it. I would use mostly images in one of the sprite object types. If you’re adding them are runtime, be sure to delete the ones that aren’t needed any more.

1 Like

Thanks for replying. I’m using 1 painter and I’m creating a line that extends as a platform when the user is on top of it. I tried to remove the lines that are no longer used, but when I go into debugger to check there’s only one ShapePainter item at scene, so I can’t really delete an specific line to avoid performance issues. Any idea why or how I can manage that ?

Are you drawing lines or are you adding shape painter objects? It sounds like you’re drawing lines so there would only be 1 shape painter.

Yes drawing lines, is it possible to delete those?

Yes. They call the action clear shapes
You can’t erase specific lines. You can only clear the entire image or draw over something.


**

1 Like

Oh my totally missed it. Thanks for your help :slight_smile:

1 Like