What does gid refer to?

So here’re the codes below from json map file generated from tiled map editor. So my

question is what the gids in objects table refer to.

{ “height”:25,

“infinite”:false,

“layers”:[

{

“draworder”:“topdown”,

“name”:“Object Layer 1”,

“objects”:[

{

“gid”:1,

“height”:477,

“id”:1,

“name”:"",

“rotation”:0,

“type”:"",

“visible”:true,

“width”:798,

“x”:9,

“y”:481

},

{

“gid”:2,

“height”:50,

“id”:2,

“name”:"",

“rotation”:0,

“type”:"",

“visible”:true,

“width”:98,

“x”:809,

“y”:148

}],

“opacity”:1,

“type”:“objectgroup”,

“visible”:true,

“x”:0,

“y”:0

}],

“nextobjectid”:3,

“orientation”:“orthogonal”,

“renderorder”:“right-down”,

“templategroups”:[],

“tiledversion”:“2017.10.11”,

“tileheight”:20,

“tilesets”:[

{

“firstgid”:1,

“source”:“untitled.tsx”

},

{

“firstgid”:2,

“source”:“untitled2.tsx”

}],

“tilewidth”:40,

“type”:“map”,

“version”:1,

“width”:25

}

** UPDATED** 

I remembered this wrongly, but saifuls posted back later with a self-answer, so please keep reading.

The id of the image used.

That is a Tiled output file right?

Got the answer already. It’s actually the global id of the object.

Plz. check out the topic: "https://forums.coronalabs.com/topic/70883-blank-screen-shows-up-after-loading-the-lua-map-file/?hl=%2Bblank+%2Bscreen+%2Bshows+%2Bup". will be appreciated if any one can come up with a solution.

Yep, the gid is a lookup for what tile or object gets placed in a layer. So, that “firstgid” is basically the offset of where the rest of the gids start in that external tileset.

This is the issue with external tilesets. Those .tsx files are XML and I haven’t had much luck writing a parser that can accurately open them. If you embed the tileset when you create it, you will see a list of “tiles” each having it’s own gid and each set having a firstgid for its offset.

Roger that.  My memory is a bit faulty.  Sorry for the misdirect.

** UPDATED** 

I remembered this wrongly, but saifuls posted back later with a self-answer, so please keep reading.

The id of the image used.

That is a Tiled output file right?

Got the answer already. It’s actually the global id of the object.

Plz. check out the topic: "https://forums.coronalabs.com/topic/70883-blank-screen-shows-up-after-loading-the-lua-map-file/?hl=%2Bblank+%2Bscreen+%2Bshows+%2Bup". will be appreciated if any one can come up with a solution.

Yep, the gid is a lookup for what tile or object gets placed in a layer. So, that “firstgid” is basically the offset of where the rest of the gids start in that external tileset.

This is the issue with external tilesets. Those .tsx files are XML and I haven’t had much luck writing a parser that can accurately open them. If you embed the tileset when you create it, you will see a list of “tiles” each having it’s own gid and each set having a firstgid for its offset.

Roger that.  My memory is a bit faulty.  Sorry for the misdirect.