How do I use the LocalStorage Plugin?

Get help using Construct 2

Post » Sat May 09, 2015 12:31 pm

I made a little tutorial to explain the use of the LocalStorage plugin.
https://www.scirra.com/tutorials/1461/h ... age-plugin

Let me know if I missed something ;)
Image Image iTunes: Match3 | Google Play: Match3
B
93
S
32
G
30
Posts: 1,095
Reputation: 27,510

Post » Sat May 09, 2015 10:15 pm

Oleeeee!!!!
Thankssss
B
7
S
1
Posts: 14
Reputation: 453

Post » Sun May 10, 2015 6:35 am

loliur wrote:Oleeeee!!!!
Thankssss


You're welcome ;)
Image Image iTunes: Match3 | Google Play: Match3
B
93
S
32
G
30
Posts: 1,095
Reputation: 27,510

Post » Fri Jun 12, 2015 8:18 pm

sorry but... where i can download the plugin?

Also which is the difference between webstorage and localstorage?
B
31
S
13
G
5
Posts: 355
Reputation: 4,558

Post » Sat Jun 13, 2015 11:21 am

The plugin is included in the latest version automatically. So just download the latest stable version of C2 and you have the plugin included.

WebStorage has been deprecated at the ChromeStore. That's why scirra added the new LocalStorage plugin.

Regards
Image Image iTunes: Match3 | Google Play: Match3
B
93
S
32
G
30
Posts: 1,095
Reputation: 27,510

Post » Thu Jun 18, 2015 12:55 pm

Hello,

I practice a little and i could create a program that when push a button add one to a text then i change to layer2 save to local and when i go back to layer 1 stay the same value, but... if i close the page and play it again starts from 0 why?

screenshot:
Image
B
31
S
13
G
5
Posts: 355
Reputation: 4,558

Post » Thu Jun 18, 2015 1:06 pm

First, if you not reset a layer, the globel variable stay alive.

If I see right you never save to LocalStorage.

Or I miss, everything is a little messed up.
In first you save only the 0.
In second you never get it, so you never can save.

Clean up and try again.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Thu Jun 18, 2015 5:01 pm

Ok let me see if im correct.
Layout 1
1. check if the key exist.
2. if exist get it and show it in the text.
3. if not creat the key
4. on click add one to text.
5 on click go to layout 2

Layout 2
1. on start show the number on text2
2. save the key to localstorage
3. on click go to layout 1.

is this correct or im missing something?

Thanks death for the help.
B
31
S
13
G
5
Posts: 355
Reputation: 4,558

Post » Thu Jun 18, 2015 5:13 pm

we talk about two different layer, the eventsheets are seperat, true? (not includet)
So how should the On item get condition in sheet 2 ever will triggert if the action is only in sheet 1?
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Thu Jun 18, 2015 6:13 pm

Yes, layers are separated.

Sorry i don't understand, so i need to add in layer 2 On item "key" exist - localstorage get item.

Or in layer 2 i need to change get to set?
B
31
S
13
G
5
Posts: 355
Reputation: 4,558

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], ksiads, Rudi55 and 2 guests