Hello there.
Imagine creating texts, rects parents to the texts and anohter display group as parent of all:
[lua]for i=0, 10 do
local letterRect = display.newRect(0,0, 38, 38 )
letterRect.touch = onObjectTouch
letterRect:addEventListener(“touch”, letterRect)
local letter = display.newText( harf, 0, 0, “Some-font.ttf”, 24 )
letterGroup = display.newGroup()
letterGroup:insert(1, letterRect)
letterGroup:insert(2, letter)
sceneGroup:insert(1, letterGroup )
end[/lua]
Here i assign a touch listener to every letter group created:
[lua]local function onObjectTouch( self, event )
if ( event.phase == “began” ) then
self.xScale = 1.30
self.yScale = 1.30
transition.scaleTo( self, { xScale = 1, yScale = 1, transition = easing.outElastic, time = 800 } )
end
return true
end[/lua]
Now, when a rect touched, it’is scaled but left and top rects are hierarchically(and visually) above the other ones.
In my opinion, [lua]sceneGroup:insert(1, letterGroup )[/lua] this must provide all rects being at the same z index level or am i terribly wrong?
Thanks.