Closed pylvain closed 3 years ago
Well... its not possible in that way ^^ You actually can create entities from json, but in another way... https://github.com/junkdog/artemis-odb/wiki/Prefabs
Another way im currently using is to use LibGdx to serialize/deserialize components. This way we can easily store a array of serialized components in an json file and then we load them, deseralize them and attach them to some entity.
Hello ! I want to allow an entity, its components, and their values to be described from a json file, with a specific syntax of my own. Let's say I have the following basic component :
and the following json string :
I could not find in the documentation an obvious way to what this fictive function would do :
Of course I can use something like Gson to instantiate a Component from json, but i cannot find a way to copy the component, excepted by hand, onto the newly created component. I also read about prefabs, but that doesn't seam to be flexible enough, I really want to be able to create components one by one.
Thank you for your attention !