This topic is now archived and is closed to further replies.

Isometric how?

This topic is 6280 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

Right, I am only a newbie to this DirectX lark but I have been programming Windows for a while. I''ve read the Direct Draw tutorials on this site and they have helped me quite a lot with the basics, like making surfaces and blitting bitmaps etc. However, although I have a decent idea of the general structure of the code, there isn''t anything (that I can find) on this site about blitting tiles to the screen and blitting sprites (with transparent areas). I realise that all the tiles in my (isometric) map should have a z-order and they should be blitted in order so that the items and the player that are placed on the ground are blitted after the ground tiles, to prevent overblitting. Now, I''m not sure whether DirectDraw works the same as Windows in that you have to collect all your window information and draw it all at once in the WM_PAINT message. So, what''s the question? I guess my question is (after all that), how do I blit isometric tiles that are an arbitrary size and how do I blit transparent sprites? I also heard something about ''compiled sprites'' and wondered how this is done as I believe it has some speed advantages. Finally, how do I do animation with a collection of sprites? Thanks in advance... KlDzny "You can be in a minority of one but the truth is still the truth." - Gandhi

Share this post

Link to post
Share on other sites
Okay, one point at a time:

Blitting tiles is quite simply a simple loop that takes the values from your array and blits the corresponding tile to the screen (be it the primary or the backbuffer surface).

As for the isometric stuff, I'm afarid I've not had too much exerience with it, but I would imagine that you wou;dn't need too much of a Z-orderuing system, you just blit from the top of the screen 's tiles downwards.

E.G. (this is a flat isometric floor)


You just render each row of tiles from (a) to (d), any overlapping objects will be correct, as you're blitting from back-to-front.

However, you will need to check the position of sprites and so on during each row and blit them then so that they are obscured by any scenery in front of them.

If, as you say, you are just beginning to play with directdraw, try playing with simple, 2d, flat tiling for a while to see how it can be used and worked with.

As for having to do all the blitting during WM_PAINT, no you don't have to. Although, you should really do everything during the VBLANK (vertical retrace) for the screen, but this isn't too important for now.

Hope this helps.

[edit] - Realised that HTML won't keep the spaces in ASCII diagrams, and added dots instead.
[edit] - Realised that dots arn't the same size as *'s and used underscores instead.

Edited by - mr_jrt on October 8, 2000 5:56:09 PM

Share this post

Link to post
Share on other sites
Thanks, I am beginning to understand know
Whenever I use that WM_PAINT *analogy* everyone thinks I''m being thick and assuming it is used in DX, I know it isn''t, but thanks for the other info...


"You can be in a minority of one but the truth is still the truth." - Gandhi

Share this post

Link to post
Share on other sites