this is just a general question that I can't seam to find a conclusive answer to.
I was under the impression that every layout had to have the objects it will be using, so in my project each layout has a hidden AssetsLayer for this purpose - no problems.
However I have decided to add a particle object to my game and was about to go through and add this object to each layout - again no problem.
So I tested this new particle object on the first layout to get the settings happening to my liking and I just thought I would see what happens on a layout that doesn't have the object added yet - and it works!
So this has prompted this topic.
While I am more than happy to add the object to each layout if I have to, the project has 40 levels so I'm just wondering if I do need to do it.
Thanks for any input...
i keep all my assets in one layout then create each level on its own layout, copying the required assets into each level.
Anything which is spawned in the level and not placed at the design sstage just remains in the asset layout. No need to copy to each level.
Develop games in your browser. Powerful, performant & highly capable.
Yeah, that is similar to what I have been doing.
I was just curious as to the fact that the layouts that I have not added the object to still created the particle anyway....
Create an Asset layout.
Never load the Asset layout ever.
using System.CreateObject or Object.SpawnObject. It will create the object on the current layout. The requirement of having created assets like sprites on a layout is an old formality of the system design. I hear it's on the way out.
At some point you can add Objects without them being on any layout. Similar to how Diction/Array and similar plugins work.
So you don't need to add the particles to the layout until you actually need them at run time(or if you actually need them for things like flickering flames...)
Object types are actually global. You can create any object from any layout on any other layout.
Note if an object is placed on any layer in a layout, Construct 2 will pre-load the images for the object when the layout starts. So make sure you avoid placing objects the layout doesn't need, otherwise it may waste memory.
OK, sorry to labour this.
In my project each of the 40 levels(layouts)use some objects all the time - like background, players etc. Obviously these should be present on each layout, and thus can be easily arranged as required.
In addition I have several Particle objects(for various effects) and Sprite objects(bullets etc) that each layout uses periodically, but they are always created\destroyed when required. These all have the Destroy Outside Layout behaviour. - So would it be best practice to just have these on an AssetsLayout only and just create them when required in each LevelLayout for the game.
If they aren't placed in the layout, then the object is not pre-loaded when the layout starts. This means if you create an object not placed on the layout, Construct 2 will load its images at the moment you create it. This can cause a noticeable pause, especially on mobile. So if you intend to use an object on a layout, it should be placed on that layout, even if it is destroyed immediately on startup.
Ashley - got it - thanks for the clarification. <img src="smileys/smiley20.gif" border="0" align="middle" />