These are chat archives for pixijs/pixi.js

21st
Jun 2015
Steven Dale
@lifeinchords
Jun 21 2015 12:33
hi .. im reading about how to destroy objects to keep memory tidy
this is helpful, but unfort not in context: http://www.html5gamedevs.com/topic/1189-pixi-how-to-destroy-cleanup/
it would be great if the tutorials, examples were each updated with best practice of what/how to destroy/cleanup..
Chad Engler
@englercj
Jun 21 2015 14:54
The idea is that anything you are done with, you should destroy.
If you plan to not use a sprite anymore, call destroy on it and lose your references
same for everything else
Steven Dale
@lifeinchords
Jun 21 2015 16:14
in sound, like Flocking.js, the environment is something that is better to leave open.. and use/render sounds as needed
if Im using Pixi not like a game engine, but more of an fx processor, laid under the DOM, is the idea to keep RAF going? and only add/remove obj as needed?
or start/stop only when needed, say user takes an action that our app requires some Fx
(im very new btw to pixi, jus reading through docs now and starting with examples for first time)
if there are specific examples or ref that you recommend, any thoughts appreciated
Chad Engler
@englercj
Jun 21 2015 16:19
if you don't need to run the RAF loop, then I wouldn't. You can add/remove objects as needed and start/stop the loop when it is idle to save cpu resources
whatever works best for your project :)
Steven Dale
@lifeinchords
Jun 21 2015 16:21
cool.. jus curious what general patterns are.. will dig in.
thanks!
Chad Engler
@englercj
Jun 21 2015 16:22
the pattern depends on the app, honestly. Pixi is just a rendering engine, how you use it depends on what you are doing
for a game, usually you are animating and doing things all the time so it is easier to keep the RAF loop going
for non-game applications it often makes sense to stop the loop when idle
OR even not use a loop at all
and just call render when things have changed, or loop only when animations are happening
Steven Dale
@lifeinchords
Jun 21 2015 16:23
ya, seems the latter is what makes most sense..
https://makeparallels.herokuapp.com.. <- our app. We want to add an effect like this:
when making connections between images.. slicing and dicing, animating with a wave. But we dont need 3D perspect, just looking to do orthogonal