• Content count

  • Joined

  • Last visited

Community Reputation

115 Neutral

About BugShan

  • Rank
  1. Isometric Tile Map - Drawing

    [quote name='slodki' timestamp='1338382709' post='4944657'] Top: x + w/2, y Right: x + w, y+h/2 Bottom: x+w/2, y+ h Left: x, y+h/2 [/quote] as you have written,i dont know what the point (x,y) does mean,and the also as the w and h.if w for width ,h for height,then the point(x,y) would not be the center point of the title.if in this case ,what about the point of the title( 2 X 3)? So,i cant say something ,but if you just display it just as the image as you have provided,you can set the (x,y) as the left point and have a try.It will be easier or you can provide more details
  2. [indent=1]I am new here too as you,but I have something in my mind.What I think,maybe not good,is that you can have a array to store the data or information of the title,for example, 1 for sand and 2 for water.Then when your guy stand on the title which value is 1,it floats on the sand and in the other hand ,it pushes into the water.[/indent] [indent=1]Then,besides that,we also have another data that stands for depth(we can use the high four bits of a byte for it and the low onse for sand or water).The depth of the titles that are more far away from screen is greater,And also your guy constains the depth information too.Well,When we render the screen,we draw the background first,then we draw the titles by the order(if you can understand ,my english is not natural language^_^).In my mind,you can treast your guy as a title,and store these titles within a container,it will be easier.I belive it should not be a best way and I will think again.Extually,what i am most intreasted in is you generated map.I want to you can give some help as you said to learning code,and my appreciates will come after your reply.[/indent]
  3. [quote name='Adam_42' timestamp='1320756066' post='4881745'] StretchRect() does a simple texture copy and ignores the alpha channel. You probably want to use [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb174249%28v=vs.85%29.aspx"]ID3DXSprite[/url] to draw your image. [/quote] Thank you very much!I have considered it but not for sure.I just want to use a simple method and i think DirectDraw was in my mind.
  4. Now ,I have a problem with d3d programming.I want to use d3d to display a image on the screeen.Although I have set the colorkey as 0xffff00ff, but the image is always in black box. My code is as the following: [code] //set the render state m_pD3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE); m_pD3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA); m_pD3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA); //create a surface and load the image HRESULT hResult=D3DXGetImageInfoFromFile(imageFile,&imageInfo); if(S_OK!=hResult) return NULL; hResult=m_pD3dDevice->CreateOffscreenPlainSurface(imageInfo.Width, imageInfo.Height,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT, &surface/*m_pSurface[m_nSurfaceUsed]*/,NULL); if(S_OK!=hResult) return NULL; hResult=D3DXLoadSurfaceFromFile(surface/*m_pSurface[m_nSurfaceUsed]*/,NULL,NULL, imageFile,NULL,D3DX_DEFAULT,colorKey,NULL); //i have sat the colorkey as 0xffff00ff hResult=m_pD3dDevice->StretchRect(surface,res,m_pBackBuffer,dest,D3DTEXF_NONE); [/code] i know that i can use another metohd to display this image ,such as IDXSprite,but i always want to know why my code doesnt work . where is woring or the StretchRect function doesnt support the transprarency color ? anybody can help me?Thanks!