Hello, I made a mistake :
I’ve forgotted that we can make group to insert object in there,
So I’ve tried with the group and It worked !
Sorry for the useless topic.
By the way, here is the code :
[lua]
---------- Graphic Representation trying to make a Curve ----------
local background = display.newImageRect( “Background.png”, 1280, 720)
background.x = display.contentCenterX
background.y = display.contentCenterY
local upTop = display.newImageRect(“testTop.png”, 720, 164)
upTop.x = display.contentCenterX
upTop.y = display.contentCenterY
upTop.rotation = 270
local group = display.newGroup()
local star = display.newLine( 1280, 90, 1280, 90 )
star.strokeWidth = 8
local star2 = display.newLine( 1285, 95, 1285, 95 )
star2.strokeWidth = 8
star2:setStrokeColor( 1, 1, 1, 0.3 )
group:insert(background)
group:insert(star)
group:insert(star2)
group:insert(upTop)
local number = 1
function addNewLine()
varNum = math.random (50, 700)
varX = (1280 + 5*number)
varY = varNum
varY2 = varY+5
star:append(varX, varY)
star2:append(varX+5, varY2)
local simpleTransition = transition.to( star, {time = 600, x = star.x - 50} )
local simpleTransition = transition.to( star2, {time = 600, x = star2.x - 50} )
number = number + 1
end
timer.performWithDelay( 500, addNewLine , -1 )
[/lua]
Thanks for the answer.