Skip to content

Website/Docs: "Making your dev life easier" page references nonexistent fields __cx & __cy #1208

@weslord

Description

@weslord

https://ldtk.io/docs/game-dev/json-overview/making-your-dev-life-easier/

{
  "__identifier" : "Mob",
  "__cx" : 3,
  "__cy" : 5,
  "defUid" : 2,
  "x" : 56,
  "y" : 96,
  "fieldInstances" : []
},

...

Same goes for the grid based coordinates (__cx and __cy) which normally depend on the Layer definition which contains the grid size making an overly complicated task for a simple info.

The actual JSON for this entity looks more like this:

{
	"__identifier" : "Mob",
	"__grid": [3, 5],
	"defUid" : 2,
	"px" : [56, 96],
	"fieldInstances" : [],
	"__worldX": 56,
	"__worldY": 96,
},

This might be deliberate, since the relationship between x, y, __cx & __cy is a little more direct than px & __grid, and clearly illustrates what double underscore fields are for.

But it did make me second-guess my understanding for a moment or two when __cx wasn't in the search results in my own LDtk file.

(Similar references to x, y, __cx, & __cy on https://ldtk.io/docs/game-dev/json-overview/layer-instances/#entity-layer-instances)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions