[Solved]* How do I - Keep my sprites between all layouts?

Get help using Construct 2

Post » Tue Aug 11, 2015 12:16 am

How do I keep all of my code/sprite/objects working between layouts?

I made a new layout, and added in my most important unit. Half of its visuals are missing and needless to say its not working out so hot.

I'm pretty sure I need to "Copy and paste" every single object I have in the original layout to make sure it all works out, but is this really the answer?

Is there something I can do to "preload" everything into the other layouts I make? I checked the FAQ and tutorials, but I did not find anything directly related to the importance of keeping all the objects on screen.

tl;dr - how do I get all of my objects from my first layout, to all of my other layouts without copy pasting. - Is it possible? and is this the "correct" way to be doing this?

*Warning - Global objects are not destroyed on the end of layout.

This was causing me some crazy bugs, due to the way I coded my game. What I actually was hoping for was the ability to create a new layout, and copy paste some units into the layout that would run their programming automatically.

I've decided to just duplicate my entire first layout and modify it as needed for the rest.
Last edited by SwatHound on Tue Aug 11, 2015 8:25 pm, edited 3 times in total.
B
6
S
2
Posts: 60
Reputation: 1,242

Post » Tue Aug 11, 2015 12:49 am

For your sprites, make them <Global> so you could use them in any layouts.
https://www.scirra.com/manual/71/instances

For the code, create an event sheet with all the code that you want global and do an include on the others event sheets when you want to use the code.
https://www.scirra.com/manual/82/includes
B
15
S
6
Posts: 105
Reputation: 1,356

Post » Tue Aug 11, 2015 6:13 am

I never realized that "global" for sprites. I clicked on them and immediately saw it. Thank you VERY much for the links, I never knew about this.

Some older tutorials suggested copy pasting them and I thought this has to be a joke.

Thank you very much, I'm so relieved to see this.
B
6
S
2
Posts: 60
Reputation: 1,242


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests