I'm looking at this cool library that helps parse TileD map editor files.
I'm having one hell of a time trying to figure out how to grab the "Color" property and the values within it? It's sort of like properties within properties.
What I did was make a Tiled Project and added a "Text display" ("Hello World") and I'm trying to obtain the colors that it should parse, so I can set the fillColor of the text. I'm thinking this might have to do with me not being to familiar with std::any and casting around correctly with it (any_cast).
I have basically been doing anything I can with getProps("Color"/"Red"/Text"). When I look at the json file, it breaks down more at "text" so I thought maybe that was how I could get to color.
{
"height":19,
"id":27,
"name":"TextObject",
"rotation":0,
"text":
{
"color":"#00ff00",
"text":"Test Map",
"wrap":true
},
"type":"",
"visible":true,
"width":83,
"x":100.625,
"y":60
}],
and also trying getProperties() and even tried doing getProperties.get<tson::Colori>(). I'm assuming I'll have to read it into sf::Color as a Uint32? I'm really hoping someone has messed with this before. I'm sure it's really easy and I'm looking past the obvious.
Thanks.
https://github.com/SSBMTonberry/tileson#readme is the library project and they have some short examples, which I've been trying to pick at in accomplishing this.
I'm going to continue to look at the examples again and hope for the best. Have a great day.
EDIT: The parameters in TileD are just Color, which breaks down to Red, Green, Blue, Alpha variables.