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.

Dark GDK / Scrolling

Author
Message
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 20th Aug 2013 22:12
Dear ALL,
i have a question about scrolling. I use the following code and i am not sure whether i do it right.

I have the variables screenx and screeny and i draw the sprite with this variables (dbSprite (12,screenx,screeny,1);

i have a phrase like:

screenx=0-scrollx;
screeny=0-scrolly;

And then i change the value of scrollx and scrolly if i press a key.

So this code only move the background-sprites, is it so right/good or is there a method to move the screen without moving the background-sprites? Is this better?

Thank you for your help!
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 26th Aug 2013 23:11
Does nobody want to help? Is this a good way to scroll, or are there better ways?
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 27th Aug 2013 19:14 Edited at: 27th Aug 2013 19:28
To avoid issues with sprite priorities and having to use the dbDrawSpritesFirst function, so that text and other 2-D elements display over the background, I would use an image for the background. Other than that, you’re gold. This little example only scrolls horizontally.

Attachments

Login to view attachments
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 28th Aug 2013 21:09
Many thanks, so, to move the sprites or images is the normal way, right?
To move the visible screen without to move the background files section is not possible?
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 29th Aug 2013 00:51
Yes, positioning the sprites or images in a positive or negative; horizontal or vertical direction, is the only way.

Login to post a reply

Server time is: 2024-03-28 19:29:00
Your offset time is: 2024-03-28 19:29:00