Loop Background Image

46 views
Skip to first unread message

Shaun Michael K. Stone

unread,
Jun 12, 2015, 3:45:05 PM6/12/15
to haxef...@googlegroups.com
Hi all,

Want to know the best approach to looping a background image on screen (like some hills of various speeds).

Ideally I would have the same sprite side by side, so when it reaches halfway left, it can move back to original position and continue. So loops. Suggestions?


Sebastian Fernandez

unread,
Jun 12, 2015, 9:39:48 PM6/12/15
to haxef...@googlegroups.com
FlxBackDrop

Shaun Michael K. Stone

unread,
Jun 13, 2015, 5:17:58 AM6/13/15
to haxef...@googlegroups.com
backdropHills1 = new FlxBackdrop(
this.loadGraphicFromTexture(textureAtlas, false, HillsOne.ASSET_NAME), 
1.2,
0, 
true, 
false
);

This doesn't work for me. I'm using a texture atlas.

Christopher Butler

unread,
Jun 13, 2015, 10:08:34 PM6/13/15
to haxef...@googlegroups.com
You might have to give us more details about what's not working. e.g. "Backdrop isnt appearing", "It's not scrolling correctly", "It's in the wrong place".. etc.

But off the top of my head... Did you remember to add the backdrop? That is: add(backdropHills1);
Reply all
Reply to author
Forward
0 new messages