How do I interpret a JSON string of an object ?

  • Lets say i have the following JSON string of a simple object.

    {"c2":true,"w":{"x":7093.726399997016,"y":204,"w":151,"h":151,"l":8722530541249526,"zi":0,"hX":0.503311276435852,"hY":0.503311276435852},"behs":{"8274350867031877":{"acc":0,"g":0,"dx":400,"dy":0,"lx":7087.059999998659,"ly":204,"lka":0,"t":6879.726399997016,"e":true},"4769858671535691":{"r":10000,"c":6.283185307179586,"t":[]}},"data":{"a":5940657200540929,"f":0,"cas":5,"fs":0,"ar":0,"at":0,"rt":0}}

    What do al those tags mean ? What info do they give ?

    I looked for a reference doc. Cant find it.

    Ty.

  • Lets say i have the following JSON string of a simple object.

    this is the Sprite with bullet behavior?

  • Yes Sir !

    (you have no idea how impressed that i am that you see that)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Don't be...

    I do not know the meaning of all tags..and it is not very complicated

    [quote:3s3q6sxs]{"c2":true,"w":{"x":7093.726399997016,"y":204,"w":151,"h":151,"l":8722530541249526,"zi":0,"hX":0.503311276435852,"hY":0.503311276435852},

    "behs":{"8274350867031877":{"acc":0,"g":0,"dx":400,"dy":0,"lx":7087.059999998659,"ly":204,"lka":0,"t":6879.726399997016,"e":true},"4769858671535691":{"r":10000,"c":6.283185307179586,"t":[]}},

    "data":{"a":5940657200540929,"f":0,"cas":5,"fs":0,"ar":0,"at":0,"rt":0}}

    "x"=X

    "y"=Y

    "w"=Width

    "h"=Height

    "l"=?

    "zi"= Z Index

    "hX"=OriginX

    "hY"=OriginX

    .....

    "behs"=Behavior

    "acc"=Acceleration

    "g"=Gravity

    "dx"=SpeedX

    "dy"=SpeedY

    ........

    "data"(Animation)

    "f"=Frame

    "cas"Animation speed

    "rt"=Reapet to

  • I wonderd if those data are usefull, but all are accessable in the expressions.

  • It gives the entire state of an object. You can look at the plugin's source to see what they are without the abbriviations. It's all abbriviated to save on space and because it's just data that's not meant to be modified.

  • If its abbreviated do we really need decimals to the 15th digit?

  • The names are abbriviations but the values need to be precise. This is to save/load objects and you don't want rounding to occur.

  • So, they are in fact all accessable expressions, and some expressions are calculated with one of more of those tags?

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