I’m using data files in the json format as explained by JB’s excellent (but very brief) blog post.
How do I store screen coords like display.contentWidth*0.5
if I use “” around the values the json file is parsed OK but I get an error when using the values, something similar to ‘number expected, string given’ e.g.
{“companyFont”:{“native.systemFontBold”,16,{250,255,255},“display.contentWidth*0.5”,“display.contentHeight*0.025”}}
if I omit the quotes (as below) the json file isn’t parsed correctly
{“companyFont”:{“native.systemFontBold”,16,{250,255,255},display.contentWidth*0.5,display.contentHeight*0.025}}
I’m also getting a similar issue trying to handle nil values, if I use quotes then the values aren’t being treated as nil.
{ “companyLogo”:“nil”} or {“companyLogo”:nil} to make the lua table companyLogo = nil
The only solution I can think of is to create the data I need in a LUA table in the code, then encode into json and the upload to my server. So I’d be writing a separate app to create my data sets, one solution but not exactly what I’m after.
I know this maybe a bit obtuse but someone with more json experience may be able to help show the way. Thanks
[import]uid: 137150 topic_id: 34556 reply_id: 334556[/import]