How do I create this...

Get help using Construct 2

Post » Thu Feb 02, 2017 3:12 am

how can i create a line graph from localstorage? any idea?
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Thu Feb 02, 2017 11:44 am

Store values that represent the line on an array, store the Array.AsJSON in a localstorage value. When you re-load the data into the array, draw the line :)
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 245
Reputation: 2,314

Post » Fri Feb 03, 2017 1:47 am

mrtumbles wrote:Store values that represent the line on an array, store the Array.AsJSON in a localstorage value. When you re-load the data into the array, draw the line :)


You have sample capx there? :D Because I don't know how to use Array.Json :D
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Fri Feb 03, 2017 10:58 am

Array.AsJSON is a string of text in JSON format that described the data in an array. You can download a JSON of an array using the Array's action 'Download'. You can store the JSON by storing Array.AsJSON. You can load data into an array by using the Array's 'Load' action, in which you must specify a string of data in JSON format.

So to save data simply set a localstorage value to Array.AsJSON
And to load data, get the localstorage value, and pass it to Array>Load

No sample capx as no upload capability, sorry :(

https://www.scirra.com/manual/108/array
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 245
Reputation: 2,314


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 20 guests