To save created object while moving to diff layout

Get help using Construct 2

Post » Tue Jan 14, 2014 11:44 am

Hello every one.

I was trying to learn the create objects and then removing them one by one on click. every things go right (thanks to so many helpful topics in the forum). Then I created another layout and tried to go back and forth in two layouts. The problem started here. Every time i create some copies of my sprite and then go to the next layout and then come back, all of my copies are removed but just one.


I am trying to store the copies that I'v created in a layout. The copies should not remove when u go to next layout and come back again. My lack of programing is my weak point.

Thanks in Advance
B
2
Posts: 2
Reputation: 179

Post » Tue Jan 14, 2014 3:25 pm

Use Webstorage to record your X and Y values of your created objects and load them each time you visit a certain layout.

https://www.scirra.com/manual/120/webstorageKazaaMafia2014-01-14 15:26:09
Image
B
82
S
16
G
4
Posts: 503
Reputation: 8,978

Post » Tue Jan 14, 2014 4:20 pm

If you add the Persist behavior to your objects that you want to remain then you should be good.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,991

Post » Thu Jan 16, 2014 9:18 am

thank you all for your help. Special thanks to "Burvey" your idea worked like a charm. I even invented a non conventional method for doing the same. I made that object global and make it visible and invisible according to the layout. But I would prefer "Persist" Behaviour. @ Kazaa thanks for your reply I am sure that this would also work but I do not know how to use Webstorage.

Thanks again.
B
2
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests