Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / a simple 1 screen repeating scrolling backround

Author
Message
Marsekay
16
Years of Service
User Offline
Joined: 24th May 2008
Location:
Posted: 25th May 2008 23:48
Hi all i have a static backround, but i want the screen to scroll the 1 screen over and over.

do i need to do this with sprites?

imagine if you will a bitmap full screen repeating, this is what i am trying to do.

Marse
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th May 2008 00:48
You can do this with images too if you like. You just need two images if it to scroll in a single direction and three images if it has to scroll both directions.

Paste Image will work with negative numbers so you paste the first image at -1 and the second image at 799. The next time you position image 1 at -2 and image 2 at 798.

After this has been done 800 times (or the number of pixels your screen is wide) then you go back to the beginning.

This is a single pixel scroll (fine scrolling) and will be slowish. You can scroll faster by moving the image in steps of 2, 4 8 or even larger amounts, but stick to even numbers of it will stutter at the end of each screen width.

Very rough example:



If you need to scroll the other way too, position the first screen at -800, the second at 0 and the third at 800 and scroll them all by equal amounts in the same way you do with two screens.

TDK_Man

Marsekay
16
Years of Service
User Offline
Joined: 24th May 2008
Location:
Posted: 26th May 2008 01:41
i seem to have got that going how i want! cheers for that!

Marse
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 27th May 2008 16:40
It can also be done using a single image.

Position a 3D plain so that it fills the screen and texture it with your image. The use the Scroll Object Texture command.



Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 27th May 2008 17:12
Here is some code to position a plain so that it exactly fills the screen

http://forum.thegamecreators.com/?m=forum_view&t=42508&b=6

Login to post a reply

Server time is: 2024-09-27 14:29:28
Your offset time is: 2024-09-27 14:29:28