   [Direct X] Draw Tile Map Using Sprite
  I want to draw tile map using Sprite in DirectXEach tile is 48X48 and I use these tile to create a 10 X 10 map.And hence, I expect the map is 480X480.However, it is weird that the tiles drawn on the screen is 48 X 44 and the map is 480X440.What is the problem? THX   
  I'd recommend that you show some code. All I can get from your post is that you've set something wrong somewhere. I'd start by showing us how you are rendering it because that's the most obvious place for something to be wrong.   ;  void DrawTile(LPDIRECT3DTEXTURE9 source,int tilenum,int width,int height,int columns,int destx,int desty){RECT r1;D3DXVECTOR3 pos(destx, desty,0);r1.left=(tilenum%columns)*width;r1.top=(tilenum/columns)*height;r1.right=r1.left+width;r1.bottom=r1.top+height;spriteobj->Draw(source,&r1,NULL,&pos,D3DCOLOR_XRGB(255,255,255));}-------------------------------------------------------------------------------void BuildGameWorld(){ //fill the gameworld with tilesfor(int y=0;y<MAPH;y++){for(int x=0;x<MAPW;x++){DrawTile(tile,MAPDATA[y*MAPW+x],TILEH,TILEW,MAPW,x*TILEW,y*TILEH);}}}   ;  Based on your original query this is the only part that should matter:for(int y=0;y<MAPH;y++){for(int x=0;x<MAPW;x++){DrawTile(...,x*TILEW,y*TILEH);I assume that MAPH and MAPW are both set to 10? And that TILEW and TILEY are set to 48? I'd check that TILEW and TILEY are correct first. If these variables aren't the issue I'd check if the position it is drawing is correct but it's not drawing the full sprite. I.E. Every 48 pixels it draw a 44 pixel sprite.Let me know how you go.;Quote:I assume that MAPH and MAPW are both set to 10? And that TILEW and TILEY are set to 48? Let me know how you go.YES,they are correctThe tile I used.http://img69.imageshack.us/img69/4805/mappo.pngThe Exe File:http://www.turboupload.com/5hr4vzcvp69r/tile.exe.htmlIf required, I will upload the code   