Jump to content
  • Advertisement

Archived

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

evercloud

How do tiles and bitmap work? -newbie question

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

After reading thru many posts within this forum and gotten a better understanding on tiles, I am still not clear on one thing How does loading tiles from a bitmap work? Is bitmap a normal BMP image which consists of several smaller aligned tiles? If this is the case, do you use Photoshop to copy paste small tiles onto the big BMP image and align them manually(not very scientific IMHO)? If so, how would the program know which tile to retrieve from the BMP image? If the above is not the case, please enlighten.... Thanks big time!

Share this post


Link to post
Share on other sites
Advertisement
Tiles are normally all the same size, so can be easily arranged on a bitmap.

Say a tile is 32x32 pixels in size. Then a 256x256 bitmap can contain 8x8 = 64 tiles.

Getting a tile from a bitmap is easy. It's X position is TileWidth * (TileNumber%(TilesAcross)), and the Y is TileHeight* * (TileNumber/TilesAcross)

Arranging on the bitmap is easy in photoshop with the grid tool, but the way to do this depends on where you get the tiles from, and how they are drawn. You could of course write a program to do this for you, or let you pick them from another bitmap.

edit:
Oh yeah, I forgot to mention, in ISO maps, the tiles are often square on the bitmap, but sheared by the game either during drawing or as a pre-processing step.

Edited by - Twoflower on November 30, 2000 10:46:26 AM

Share this post


Link to post
Share on other sites
Thanks for the reply. Now other newbie questions:

(1)What does blit mean and how is it done?

(2)What is Bitmasking and how is it done?

THANKS AGAIN!!!

Share this post


Link to post
Share on other sites
BitBlt, or blit for short, stands for bit block transfer. Generally it means copying one graphic (or surface) to another graphic (or surface).

Bitmask is a black and white graphic that acts like a siloutte of another graphic. It is generally used to tell whatever function does the BitBlt''ing which pixels to actually copy.

I highly recommend that you read through the basic graphic articles in the gamedev.net article section for more information on this and also some of the basic articles on game programming before you dive into the realm of isometric programming

Dino M. Gambone
Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Share this post


Link to post
Share on other sites
Thanks for the fast reply! Here is another question after what I have gathered from your answer and other tutorials:

By combining BLT and bitmasking, you first BLT the board with background tiles, then you bitmask (grab a tile from your tileset then grab a smaller part off the tile? Or just grab a little part(smaller than a tile) off the tileset?) and blt the bitmasked image/tile over the background?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!