displaygroup:scale() and wiki lies?

https://docs.coronalabs.com/api/type/DisplayObject/scale.html

Effectively multiplies the size of a display object by xScale and yScale respectively. The scaling occurs around the object’s anchor point.`

				mapGroup.achorX = 0.5
				mapGroup.achorY = 0.5
				
				mapGroup:scale(1.1, 1.1)

Everything is shifted down and to the right, as if the anchor was at the top left. Am I doing something wrong or is the wiki telling lies to me?
(haha)

it needs to be anchorX and anchorY, what you posted is misspelled.

oops my bad, but it still doesnt work. I even changed the anchors for all the display objects inside of it.

Hi @agentjtoo7,

The display group don’t respect anchor point by default. To change this behavior set anchorChildren property to true.

local myGroup = display.newGroup()
myGroup.anchorChildren = true

See object.anchorChildren

Have a nice day:)
ldurniat

2 Likes