Results 1 to 7 of 7

Thread: How to make my layer not disapear when out of screen? (direct draw)

  1. #1

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172

    How to make my layer not disapear when out of screen? (direct draw)

    i am creating a game with the use of direct draw i have a background a level on top of it and a character on top of that. the level moves , not the character , how to make sure the level does not disapear when it goes out of my screen? :S i just started learning Direct draw and starting to get it but need this fixed to test some things :S
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  2. #2
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202
    I'm assuming you are loading in a backgroud that is bigger than the screen size right? Just download the DirectDraw Full screen tutorial from dx4vb and modify it like this:

    'get the area of the screen where our window is
    rBack.Left = Abs(sx1)
    rBack.Right = Abs(800 - sx1)

    rBack.Top = Abs(sy1)
    rBack.Bottom = Abs(600 - sy1)


    rBack is the rect of the background and sx1 and sy1 is the position of the backround. So here I have my screen set to 800 by 600 with a bigger background which scrolls without disappering.

  3. #3
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202
    Or better yet here is demo I made which is based of the Fullscreen tutorial from dx4vb. I couldn't upload the bg picture because it's too big. You'll need to create a bmp called "BacktestFinal2.bmp" with a size of 2000 by 1300 - or you can change the code to your needs.
    Attached Files Attached Files

  4. #4

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    aargh i cant seem to get it right i dont see why it keeps on the screen like you did, and keeps disapearing with my code , btw you got the code form the same place i did it looks rather simular only mine is a bit more organised

    here is my project , it isnt much yet so there is no trouble posting it :P http://www.xs4all.nl/~jleroy/tuxball.zip

    please help me fix it , and comment what you changed :S
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  5. #5

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    anybody got an solution for me? i looked at his example and at some others and cant seem to find what i am doing wrong/diffrent :S
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    What you have is a clipping problem. Instead of trying to blit the whole surface, you need to blit the visible portion. Sorry, but I don't have the time to fix it for you. I'm not sure where you got the code from but if that code works, there should be some kind of clipping code in it.

  7. #7

    Thread Starter
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    Well the code example i had was just a picture on the screen i created the rest myself , and i really dont have a clue how i can have made a clipping thing ..
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width