Save and load Sprite co-ordinates ?

Get help using Construct 2

Post » Wed Jun 06, 2012 9:34 pm

[QUOTE=ramones] Oh. Make sure you're viewing the localhost page when you open dev tools.[/QUOTE]

Ok thanks..its still a bit hard to read!
---------------------------------------------
vtrix

I couldn't incorp your example with my original capx, but I have put a smaller project together(because of the 'pin' behaviour)



Capx

Will keep you posted as it develops.
B
19
S
6
G
7
Posts: 1,203
Reputation: 7,294

Post » Thu Jun 07, 2012 12:16 am

hehe great! :) you could also make that the poses are saved to a button that has the json string as var, so when you go over the button it loads its pose (maybe i try it), i also thought about making a simple animation system with spritebank, if you save for example every 10 milliseconds to an array, you could have a frame by frame animation system, but i think its better to wait on Spriter plugin for the real deal :)

dont know what exactly didnt work, but its posible to do an action or function on each instance right after its loaded, you could for example
save usephysics=1 var to the instance and activate the physics on that object right when it loads

about the json difficult to read.., its harder because its a json from the hashtable with all poses, you can also save and write the json from 1 pose to a textfield(so you can copy the string) wich should be easyer to read

i've been meaning to ask @rexrainbow if it would be better to shorten the description names of spritebank to a minimum as it get big very fast with lots of objects..

------ example normal 1 object

{"head":[{"x":452,"y":103,"width":62,"height":72,"angle":0,"opacity":1,"visible":true,"cur_frame":0,"cur_anim_speed":5,"inst_vars":[],"layer":0,"z_order":8,"cur_anim_name":"Default"}]}

-----------shorten version

{"head":[{"X":452,"Y":103,"W":62,"H":72,"A":0,"O":1,"V":true,"C_F":0,"C_A_S":5,"VAR":[],"L":0,"Z":8,"C_A_N":"Default"}]}


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

Post » Thu Jun 07, 2012 12:57 am

I created a looping animation (see the disabled group 'play animation....not used in this project')

Its disabled in this capx, but it does actually work.

To be honest...a lot of this stuff is quite new to me, but if you have any examples ,amendments post them so I can learn!

B
19
S
6
G
7
Posts: 1,203
Reputation: 7,294

Post » Thu Jun 07, 2012 1:10 am

yeah cant see it, dont have the data :)

new version, its fun :)

index

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

Post » Thu Jun 07, 2012 1:20 am

Yeh...I like the 'objectselector' lots of possibilities?
B
19
S
6
G
7
Posts: 1,203
Reputation: 7,294

Post » Thu Jun 07, 2012 1:33 am

well you see what it does? it saves every pose to an objectselector (bad name) its better poseholder , and loads the pose when hover, its a more a direct feedback thing, instead of typing the pose
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Thu Jun 07, 2012 1:48 am

[QUOTE=vtrix] well you see what it does? it saves every pose to an objectselector (bad name) its better poseholder , and loads the pose when hover, its a more a direct feedback thing, instead of typing the pose[/QUOTE]

I used an event that triggered every 0.2 seconds to play a basic set of animations, but it was very slow...your method works better/faster.

Keep up the good work.

'shortening the description names of spritebank to a minimum' would be a good idea as well.chrisbrobs2012-06-07 01:50:57
B
19
S
6
G
7
Posts: 1,203
Reputation: 7,294

Previous

Return to How do I....?

Who is online

Users browsing this forum: cesisco and 16 guests