Child x and y

Hi Coronaville!

I have 9 invisble dots (basically circles).

I made them via display.newCircle function.

Dots are inserted in myDots displayGroup in order they are created:

myDots = display.newGroup

How to get x and y position of every single dot?

If I call

myDots[4].x = centerX

I get an error saying that “index is a number”…

Many thanks  :slight_smile:

Ivan

Hey ivan,

what you’re is basically right.

It would help if you could post the whole code you are using (preferably reduced to: group creation, dot creation, insertion, setting position) that produces the error.

Because this works fine for me:

local group = display.newGroup() local circle = display.newCircle(0, 0, 10) group:insert(circle) group[1].x = 100

Hi torbenratzlaff,

I messed up… and solved it!

I apologize, and thanks!  :smiley:

Hey ivan,

what you’re is basically right.

It would help if you could post the whole code you are using (preferably reduced to: group creation, dot creation, insertion, setting position) that produces the error.

Because this works fine for me:

local group = display.newGroup() local circle = display.newCircle(0, 0, 10) group:insert(circle) group[1].x = 100

Hi torbenratzlaff,

I messed up… and solved it!

I apologize, and thanks!  :smiley: