Ciao,
yesterday I just buy my first Mac, just to try Corona.
This evening I try some code but I’m stuck, now.
All I wanna, is that some text will be scroll over an image.
This is the code that I use.
local textObject = display.newText( "Text line ONE that will be scrolling over the image", 1, 1, nil, 14 )
textObject:setTextColor( 255,0,2 )
local textObject1 = display.newText( "text line two", 1, 20, nil, 12 )
textObject1:setTextColor( 55,0,255 )
local backbg = display.newImage( "stanzatornano.jpg" )
backbg.x = display.stageWidth / 2
backbg.y = display.stageHeight - 200
function backbg:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
end
backbg:addEventListener( "tap", backbg )
local group = display.newGroup()
group:insert ( textObject )
group:insert ( textObject1 )
group:insert ( backbg )
assert( (group[1] == backbg) and (group[2] == textObject) and (group[3] == textObject1))
transition.to( textObject, { time=10000, y=textObject.y+200 } )
…and this is the error that Corona give me:
Copyright © 2009 ANSCA, Inc.
Version: 0.3
Build: 2009.06.15.1
Runtime script error
/Developer/ansca/SampleCode/HelloWorld/main.lua:34: assertion failed!
librtt: /Developer/ansca/SampleCode/HelloWorld/main.lua:34: assertion failed!
stack traceback:
[C]: ?
[C]: in function ‘assert’
/Developer/ansca/SampleCode/HelloWorld/main.lua:34: in main chunk
…any help?
Thanks
Ale [import]uid: 940 topic_id: 111 reply_id: 300111[/import]
[import]uid: 940 topic_id: 111 reply_id: 82[/import]