How do I can save sprite properties in JSON?

0 favourites
  • 5 posts
From the Asset Store
Weapon System
$19.99 USD
Weapon System is a Construct behavior that serves as manager of weapons and their properties.
  • I'm doing a program based on sprites editing(Like editor in GeometryDash).

    I'm looking how to save all the sprites properties like: Name, X/y position, instance values, opacity,effect parameters,etc... in a file and after in a new runing load that file that create all the sprites with their properties to regenerate the same composition.

    How i can save/load sprite properties in Array?

    Tagged:

  • Almost every object in Construct has AsJSON expression and "Set from JSON" action - you can use these. JSON will contain all object properties.

    You can put all JSON strings into an array if you want, for easier storage.

    .

    If you need to re-create the entire scene with lots of objects, it may be easier to use System Save/Load actions. After saving, you can get SaveStateJSON expression and saving it to a file - it will contain properties for all objects on the layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Almost every object in Construct has AsJSON expression and "Set from JSON" action - you can use these. JSON will contain all object properties.

    You can put all JSON strings into an array if you want, for easier storage.

    .

    If you need to re-create the entire scene with lots of objects, it may be easier to use System Save/Load actions. After saving, you can get SaveStateJSON expression and saving it to a file - it will contain properties for all objects on the layout.

    I also need a way to store the sprite data into an array!

    Can you explain this in more detail?

    It is necessary that the data be saved in json in the files below.

    And export them

  • Here is a very simple demo:

    dropbox.com/s/6sm8wpt9820bo4c/SaveSpritesToArray.c3p

    You can save the array itself in Local Storage, use Array.AsJSON expression.

  • Here is a very simple demo:

    https://www.dropbox.com/s/6sm8wpt9820bo4c/SaveSpritesToArray.c3p?dl=0

    You can save the array itself in Local Storage, use Array.AsJSON expression.

    I will look, thx)

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