FXGL icon indicating copy to clipboard operation
FXGL copied to clipboard

Automatically clean FXGL infinite animations if entity is not active

Open AlmasB opened this issue 1 year ago • 2 comments

Otherwise we end up with dead animations that still use resources

AlmasB avatar Jul 16 '24 07:07 AlmasB

Hi Almas,

In my case, what I did was tricky, but extensively powerful. One of the first change I did was using a set of Visibility conditions and mark entites not visible to setVisible(false). But in the end, it wasn't enough, far from it. The problem is that JavaFX continued to check if there was anything dirty in that not visible tree and continued to recheck bounds etc etc. So what truly helped was to remove the Nodes from the parent Node of the Entity. It basically changed everything. I hesitated months (no joke) to do it or not. It was tricky, but paid extensively!

DeathPhoenix22 avatar Dec 10 '24 20:12 DeathPhoenix22

Hia, thanks for keeping interest in the project alive. I seem to remember there are a few PRs I never got around to merging. Hope I can do that over the winter holidays. Cheers

On Tue, 10 Dec 2024, 8:30 pm DeathPhoenix22, @.***> wrote:

Hi Almas,

In my case, what I did was tricky, but extensively powerful. One of the first chance I did was using a set of Visibility conditions and mark entites not visible to setVisible(false). But in the end, it wasn't enough, far from it. The problem is that JavaFX continued to check if there was anything dirty in that not visible tree and continued to recheck bounds etc etc. So what truly helped was to remove the Nodes from the parent Node of the Entity. It basically changed everything. I hesitated months (no joke) to do it or not. It was tricky, but paid extensively!

— Reply to this email directly, view it on GitHub https://github.com/AlmasB/FXGL/issues/1377#issuecomment-2532820839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3NT5QG6H42XXLSYPKDONT2E5FONAVCNFSM6AAAAABK57RIM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZSHAZDAOBTHE . You are receiving this because you authored the thread.Message ID: @.***>

AlmasB avatar Dec 10 '24 20:12 AlmasB