Save and load Sprite co-ordinates ?

0 favourites
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • 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

    <img src="https://dl.dropbox.com/u/22173473/animatesplash.png" border="0">

    Test

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

  • 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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

    <img src="smileys/smiley9.gif" border="0" align="middle" />

  • Dictionary was introduced in r91, so not a lot of documentation out yet. There are some details in the release notes.

  • Dictionary was introduced in r91, so not a lot of documentation out yet. There are some details in the release notes.

    Thanks for the info Nimtrix...

    I will have to experiment and wait for a tutorial! <img src="smileys/smiley9.gif" border="0" align="middle">

  • chrisbrobs

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

    example spritebank

  • Thanks vtrix <img src="smileys/smiley2.gif" border="0" align="middle" />

  • chrisbrobs

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

    example spritebank

    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?

    <img src="smileys/smiley9.gif" border="0" align="middle">

  • 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

  • you can only download the jsonstring, and the import gives me troubles,

    much better would be like dictionarytostring and save this in var or webstorage

    edit: maybe use rexrainbow hashtable, its almost the same

  • yes it works,

    example

    so now when added a couple of "states" when pressing savetowebstorage

    it will safe the hashtable with all states to webstorage

    when page refresh it reloads the hashtable from webstorage

  • yes it works,

    example

    so now when added a couple of "states" when pressing savetowebstorage

    it will safe the hashtable with all states to webstorage

    when page refresh it reloads the hashtable from webstorage

    Just tested your example....brilliant.

    I will update post tomorrow(?) after trying to implement into the project.

    Thanks for your help.

    <img src="smileys/smiley4.gif" border="0" align="middle">

  • vtrix...thanks for helping me with this project...

    I have a couple more questions regarding local storage?

    Your 'hashtoweb storage' saves the sprite details in the folder-

    C:\Users\Administrator\Local Settings\Application Data\Google\Chrome\User Data\Profile 7\Local Storage

    The file is named-

    http_localhost_50000.localstorage (on my system anyway)

    My question is...can this file be opened/edited in any text editor?

    I have tried using word, notepad, ultraedit and others?

  • You can edit the local storage directly in Chrome with the Developer Tools. CTRL-SHIFT-I then click on Resources.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)