Best way to maintenan cc.Layer under cc.scene

Best way to deal with cc.Layers is ‘delete and recreate’ or ‘hide and visible’ on demand (when ever layer is required).
which way is effect on, performance of a game?.
which one is best?.

Hiding when not needed would consume less resources than destroying and recreating.

Thanks for replay.
if one time use of sprite or node, what would be the best way (destroying or hiding) to handle.

A single time? Well can you change the texture and reuse it? Or is that not an option?

Okay, can you explain term resources.
Resources means in terms of what are they? And how they can affect game performance.

Memory for example. GPU cycles, rendering, etc

Everything you do when programming either uses resources from the system or frees resources to be used again.

Are you familiar with items like the call stack, heap, allocate, etc?

that means in programing number of iteration will effect on processor,
as like hear number of class (layer, sprite… etc.) destroying and recreating will effect on GPU and memory? right?

Sure among many other things.

Thanks :slightly_smiling_face: @slackmoehrle

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.