DirectDraw + zooming

Started by
3 comments, last by lack o comments 18 years, 5 months ago
Hi all, I have a world which is just 1 bitmap. What is the easiest way to zoom so only a part of that world is visible in my surface? Thanks!
Advertisement
Quote:
zoom so only a part of that world is visible in my surface?

By 'surface' I assume you mean 'Destination Surface'. Call the DestSurface::Blt method using a destination RECT large enough that the image is stretched to the desired size.

NOTE: Making entire worlds out of a single bitmap is generally a bad idea. Use a tile-map.
Hi,

This is the first time I am working with DirectDraw, so every tip is appreciated.

I have already implemented the zoom function using the Draw() function with SrcRect and DestRect. It is working very well!

I am going to find out how tilemaps are working. If you have any nice links, could you please post them here?

Thanks!
I did a quick search for tilemaps. It sounds good to use them, however, I have a question.

This is my engine (don't look at the ugly grass, need to fix that one):
View example

If you look to the water, it is an animation (you cannot see in the image though). I have an array. Loaded all bitmaps into the array and created surfaces for each one of them. I draw them one by one so I can get a nice animation for the sea (as well for other objects, for example the weather icons).

Can I still use the animations when using tile-maps?

Thanks!
Follow this link. Under the subcategory 'General' you will find a series called 'Game Programming Genesis'. That might be a very good start. And to answer you animation question: Yes it can be done and is explained in the series I just showed.

Another good place is GameDev.net's articles section (link is a top of nearly evey page). Look into Isometric and Tile-based Games. And don't forget the Isometric and Tile-based forum.

Hope that helps.

This topic is closed to new replies.

Advertisement