arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Optimize HitBox Drawing

Open Cleptomania opened this issue 2 years ago • 1 comments

Arcade has the ability to draw hitboxes for a Sprite, SpriteList, or Scene. However, this function essentially loops on every sprite, and makes a call to arcade.draw_line_strip with the adjusted points for that Sprite's hitbox. This is incredibly inefficient and will completely destroy performance even with only 100-200 sprites.

There may be a better way to batch draw these, perhaps using Pyglet shapes is an opportunity. This will definitely need more investigation into the best ways to handle this.

Cleptomania avatar Apr 20 '23 22:04 Cleptomania

We can do a quick fix for 3.0 just looping and bulding a buffer of lines to improve this greatly. It's not a perfect solutuon, it will be dramatically faster.

einarf avatar Jun 09 '23 01:06 einarf