Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read Custom Properties from Object Layer #41

Open
Bob997 opened this issue Jan 22, 2016 · 1 comment
Open

How to read Custom Properties from Object Layer #41

Bob997 opened this issue Jan 22, 2016 · 1 comment

Comments

@Bob997
Copy link

Bob997 commented Jan 22, 2016

Hi,

I'm trying to access some custom properties under Object Layer.
I tried to use something like:
let dx = tmxObjectGroup.propertyNamed("DestinationPointX")
print (dx)
but I get a nil form dx.

here is a TMX snippet:





Thanks for any help.

@riklowe
Copy link

riklowe commented Mar 26, 2016

Hi - try this

    var objectsCount = 0
    var objectGroup = tileMap.groupNamed("Object Layer 1")

    for object in objectGroup.objects {

        objectsCount += 1
        print ("OBJECT :\(objectsCount)")

        print (object)

    }

Output
OBJECT :1
{
polygonPoints = "0,0 343,-44 343,3";
x = 331;
y = 194;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants