Scrolling 2D background

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
giulioz
Posts: 8
Joined: Mon Jun 24, 2013 2:21 pm

Scrolling 2D background

Post by giulioz »

Hi at all!

I'm writing a Final Fantasy-like game engine, with 2D prerendered backgrounds and 3d player models.
I want to scroll the background according to player movments, but like in the picture below, the scroll speed changes with the distance.
I want a simple way to do this, I thought I move the background based on the position of the 3D model projected on the screen, but how?

Image

Sorry for the bad english! :(
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: Scrolling 2D background

Post by chronologicaldot »

You could put the image on a box as a texture (see IBillboardSceneNode). Then you just move the position of the box in the background. Then you can change the scroll speed by moving the box faster.
That's the simple way.
Post Reply