Jump to content
  • Advertisement
Sign in to follow this  
ballack

scrolling how?

This topic is 5398 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i want to know how to show only part of the bitmap which is bigger than the screen ,and show the rest as the character moves forward in win32 api?

Share this post


Link to post
Share on other sites
Advertisement
I think the Win32 API call BitBlt will copy a region from one hDC to another; just draw the same width/height as the screen from your background image, positioned at (0,0), but offset of the source x/y values.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You save the viewport values, and as the user presses a direction update the relevant axis.

if(USER PRESSES RIGHT)VIEWPORTX--;
if(USER PRESSES LEFT)VIEWPORTY++;

Check for collision, reset to the last position if so and then render the image from the viewport.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!