I have a game I’m building that relies on a moving object, controlled by physics. This object “deposits” trails behind it that currently I have as simple vector lines. Think of a pencil moving around the screen drawing a line. The trails works great, but at certain points I need to run display.capture() to capture the bkgd and current trails - and then behind this new capture, remove the old base and all the trails objects. This frees up memory and allows me to have nearly an unlimited # of trails on the screen - all thanks to being able to take a snapshot of a display group using display.capture().
All seems to be working well, but when display.capture happens, there’s a lag where literally everything stops - including animations. If this happens at the wrong time, placement of physics-powered objects now become off-place and some even try to run their animation again (looks really weird).
Now… with that said, I do understand that I am taking a snapshot of a complex display group and also immediately after, trying to remove lots of display objects (maybe a few hundred). All of this “works”, but there’s a performance hit…
I’ve tried to being animations to a stall so I can time this at the right point, but there’s no callback or ability to see if that display.capture() has completed. Also that the old group/objects removal completed too.
Does anyone have any suggestions on how to wait for a display.capture() to finish? Kinda like an onComplete() for a display.capture()…
Thanks! [import]uid: 131038 topic_id: 24803 reply_id: 324803[/import]