Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Continuous Scrolling Background
Started by Miro Feb 11 2010 05:02 AM

- - - - -
1 reply to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Miro

[GLOBAL: userInfoPane.html]
Miro
  • Enthusiast

  • 76 posts
  • Guests

How would I make a continuous scrolling background with one image? I guess it would go something along the lines of make a group and a timer that transitions the x coordinate. I'm just not sure how to handle loading the image into the group so it repeats indefinately.

Thanks
uid: 3018 topic_id: 489 reply_id: 300489


[TOPIC: post.html]
#2

carlos m. icaza

[GLOBAL: userInfoPane.html]
carlos m. icaza
  • Corona Geek

  • 2,992 posts
  • Alumni

try

local stageWidth = display.stageWidth

local image1 = display.newImage("background_bubbles.png",0,0);
local image2 = display.newImage("background_bubbles.png",320,0);
image2:scale(-1,1); -- flip it... you dont' have to

transition.to(image1, { time=35000, delay=1500, x= -(image1.width/2)});
transition.to(image2, { time=35000, delay=1500, x= (image2.width/2) } )
Look at this thread for additional information

http://developer.anscamobile.com/forum/2010/02/07/best-way-repeat-short-animation

Hope this helps.

Carlos

uid: 24 topic_id: 489 reply_id: 950



[topic_controls]
[/topic_controls]