horizontal scrolling - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

horizontal scrolling

beardtrixbeardtrix Posts: 44Member
can anybody tell me how to make the screen scroll horizontally over a large background image?

if not, can someone send me some code they have or point me in the direction of a good tutorial please.

Comments

  • protektorprotektor Posts: 116Member
    : can anybody tell me how to make the screen scroll horizontally over a large background image?
    :
    : if not, can someone send me some code they have or point me in the direction of a good tutorial please.
    :


    Lets say you have a 640*200 image you wanna display on a 320*200 screen:

    when you press the right arrow, increase a var I

    [code]
    for counter=0 to 200 do begin
    offsIMG:=I+(counter*640);
    offsSCR:=counter*320;
    display 320pixels from offsIMG to offsSCR
    end;
    [/code]
    if you have different image dimension, change the appropriate values


  • beardtrixbeardtrix Posts: 44Member
    What's the quikest way to draw a 640*200 image. the only way i know is to actually right out a 640*200 grid of 0's then change the 0's to the colour that i want, then print it to screen with an array and some assembley code.

  • beardtrixbeardtrix Posts: 44Member
    you wouldn't have any source code for horizontal scrolling would you?


  • protektorprotektor Posts: 116Member
    : you wouldn't have any source code for horizontal scrolling would you?
    :
    :

    unfortunatly not. but the example i gave you is perfect. you can do it in assembly, that would be even better. but what exactly is your question? you want to know how to copy a source buffer to the screen?

    if you want to do it with horizontal scrolling, you have to copy lines by lines. I could make an example if you want, send me the code you made to do this, and I will implement some documentation in it so you can complete your source code.

    mail it to me

Sign In or Register to comment.