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.

2D All the way! / Scrolling large image file?

Author
Message
Dracula
17
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 30th Jan 2012 19:59
I have a large (3088x2056) .jpg that I want to scroll over with a screen of 1024x768. I am able to load it as a bitmap, but I can only see the upper left portion of the image. I tried to place it at negative coords, but I get errors with this. Is there a way to scroll the image around with basic coding?

Thanks for any assistance you can give.

Jason
Iceman
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location:
Posted: 31st Jan 2012 23:16
Erm.... just assign it to a sprite and then put the sprite off screen and move it.

For example:

SET DISPLAY MODE 1024,768,16
sync on : sync rate 0
color backdrop rgb(0,0,0)
cls 0
hide mouse
x=1600:y=0
load image "YOURIMAGEHERE.bmp",800,1
sprite 1,x,y,800
do
sprite 1,x,y,800
x=x-1
sync
loop
Dracula
17
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 2nd Feb 2012 18:11
This works, but why do you start with x=1600? If the image were of a smaller size (that is still larger than the screen dimensions), would you still use x=1600?

Thank you!

Jason
Iceman
21
Years of Service
User Offline
Joined: 10th Jan 2003
Location:
Posted: 4th Feb 2012 21:26
You can start with any number....It is just the amount that it puts if off the screen to start with.

You could use x=1025 and it would just be off the screen by 1 pixel.
Its up to you what you set it to.

Its taking the top left co/ord of the image/sprite and putting it just off screen, so it does not matter what size your image is...It will still be off screen.

Login to post a reply

Server time is: 2024-03-29 11:32:12
Your offset time is: 2024-03-29 11:32:12