Auto-Scrolling Background?

983 views
Skip to first unread message

xhunterko

unread,
Feb 8, 2014, 4:52:13 PM2/8/14
to haxef...@googlegroups.com
I'm trying to put a little more life in my shooter by putting in an auto scrolling background. I have no idea how haxeflixel would handle this. Photonstorm did a lovely plug in class that did the job back when it was in action script 3, so I was hoping it'd be ported over. It appears, unless I've not found it yet, that it has not.

So, how do I get a background to scroll automatically? Like in the old shmup games.

Gama11

unread,
Feb 8, 2014, 4:54:01 PM2/8/14
to
Yeah, that class has not been ported afaik, but I think FlxBackdrop is fairly similar.

xhunterko

unread,
Feb 8, 2014, 4:55:18 PM2/8/14
to haxef...@googlegroups.com
I did try FlxBackdrop. But I didn't get that working either.

Gama11

unread,
Feb 8, 2014, 5:08:07 PM2/8/14
to
Seems pretty straightforward, what exactly did you struggle with?

package;

import flixel.addons.display.FlxBackdrop;
import flixel.system.FlxAssets;
import flixel.FlxState;

class PlayState extends FlxState
{
var backdrop:FlxBackdrop;
override public function create() 
{
add(backdrop = new FlxBackdrop(GraphicLogo));
backdrop.velocity.set(100, 100);
}
}

xhunterko

unread,
Feb 8, 2014, 5:18:32 PM2/8/14
to haxef...@googlegroups.com
Most probably the reason is that I'm an idiot and don't normally see things pretty straightforward from documentation. I was setting it up via like this:

BackWaterDrop = new FlxBackdrop("assets/Water.png", 0.80, 0.80, true, true);        
add
(BackWaterDrop);

So of course, it wouldn't work.

Thank you sir!


On Saturday, February 8, 2014 4:07:51 PM UTC-6, Gama11 wrote:
Seems pretty straightforward, what exactly did you struggle with?

package;

import flixel.addons.display.FlxBackdrop;
import flixel.system.FlxAssets;
import flixel.FlxState;

class PlayState extends FlxState
{
var backdrop:FlxBackdrop;
override public function create() 
{
add(backdrop = new FlxBackdrop(GraphicLogo));
backdrop.velocity.set(100, 100);
}
}



On Saturday, February 8, 2014 10:55:18 PM UTC+1, xhunterko wrote:

Gama11

unread,
Feb 8, 2014, 5:20:00 PM2/8/14
to haxef...@googlegroups.com
That should still work though, just not move?
Reply all
Reply to author
Forward
0 new messages