Save and load Sprite co-ordinates ?

Get help using Construct 2

Post » Sun Jun 03, 2012 6:24 pm

Could somebody please tell me the best method for saving (and loading)
sprite names, co-ordinates and angles....(similar to 'INI' files in C1)

I need a way to record and load 2 sets of info..

1, Start position and angle for multiple sprites.
2, End position and angle for multiple sprites.

An example of the app can be tested below-

Thanks in advance



Testchrisbrobs2012-06-03 18:25:45
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Jun 03, 2012 6:46 pm

Hash table in C1 (It's called Dictonary in C2, I guess since it does away with the underlying hash)
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sun Jun 03, 2012 7:16 pm

spritebank could be used, and combining the json data from spritebank with an array or hash, you can load multiple poses

very cool application you got there, nice!vtrix2012-06-03 19:18:33
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Jun 03, 2012 8:26 pm

Davioware@
Hash table in C1 (It's called Dictonary in C2, I guess since it does away with the underlying hash)

Can't seem to find anything re "Dictionary" in manual or tutorials.
Will search.
---------------------------------------------
vtrix@
spritebank could be used, and combining the json data from spritebank with an array or hash, you can load multiple poses.

I will check the spritebank plugin..see if i can make sense?

Do you know of any example's that have been posted?


B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Jun 03, 2012 8:44 pm

Dictionary was introduced in r91, so not a lot of documentation out yet. There are some details in the release notes.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jun 03, 2012 9:41 pm

[QUOTE=Nimtrix] Dictionary was introduced in r91, so not a lot of documentation out yet. There are some details in the release notes.[/QUOTE]

Thanks for the info Nimtrix...
I will have to experiment and wait for a tutorial!
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Jun 03, 2012 10:59 pm

@chrisbrobs

this is example spritebank + dictionary, you can save and load the sprites by "key" entered into textbox

example spritebank
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Jun 03, 2012 11:11 pm

Thanks vtrix
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Jun 03, 2012 11:45 pm

[QUOTE=vtrix] @chrisbrobs

this is example spritebank + dictionary, you can save and load the sprites by "key" entered into textbox

example spritebank[/QUOTE]

Your example is great...couple of questions ?

When I enter a 'name', and save/ load everything works.

After exiting/ restarting the Capx, can I enter a previously saved ref and open it again?
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Mon Jun 04, 2012 12:06 am

hmm im thinking maybe with the latest addition from dictionary > export to json and save this json in a webstorage key, then when reload the page, you load the webstorage key > the json string.. and import back into dictionary,

but i havent used this function yet, i see if i can make something
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Next

Return to How do I....?

Who is online

Users browsing this forum: Artpunk and 13 guests