[RELEASE] How To Draw Sprites
Well i thought id create a tutorial on this, Since some people are asking. The code is NOT mine. Credits to pyroctain666 for the code and im not sure who made the program
First get your image and open it up in the converter provided.
Convert the image to bytes. The output bytes will be in the text file.
Define you bytes like this:
[php]
BYTE Menu[ ] = {output bytes here};
[/php]
In the globals, Put:
[php]
LPD3DXSPRITE Sprite;
LPDIRECT3DTEXTURE9 MenuTexture;
static BOOL Create = TRUE;
[/php]
Now, Go to your Endscene or Present and create your texture and sprite like so:
[php]
if(Create){
D3DXCreateTextureFromFileInMemory(Device,&Menu,siz eof(Menu),&MenuTexture);
D3DXCreateSprite(pDevice,&Sprite);
Create = FALSE;
}
[/php]
Now you need to draw the sprite (In Endscene or Present again)
[php]
D3DXVECTOR3 POS;
POS.x = 15;
POS.y = 15;
POS.z = 0;
Sprite->Begin();
Sprite->Draw(MenuTexture,NULL,NULL,&POS,0xFFFFFFFF);
Sprite->End();
[/php]
If you would like the image transperent, Replace
[php]
Sprite->Begin();
[/php]
With
[php]
Sprite->Begin(D3DXSPRITE_ALPLHABLEND);
[/php]
I havent tested it yet, But it should work. I will tesst once CA finishes patching.
acid_buRn
Ohh and the virus scan:
VirusTotal - Free Online Virus and Malware Scan - Result
First get your image and open it up in the converter provided.
Convert the image to bytes. The output bytes will be in the text file.
Define you bytes like this:
[php]
BYTE Menu[ ] = {output bytes here};
[/php]
In the globals, Put:
[php]
LPD3DXSPRITE Sprite;
LPDIRECT3DTEXTURE9 MenuTexture;
static BOOL Create = TRUE;
[/php]
Now, Go to your Endscene or Present and create your texture and sprite like so:
[php]
if(Create){
D3DXCreateTextureFromFileInMemory(Device,&Menu,siz eof(Menu),&MenuTexture);
D3DXCreateSprite(pDevice,&Sprite);
Create = FALSE;
}
[/php]
Now you need to draw the sprite (In Endscene or Present again)
[php]
D3DXVECTOR3 POS;
POS.x = 15;
POS.y = 15;
POS.z = 0;
Sprite->Begin();
Sprite->Draw(MenuTexture,NULL,NULL,&POS,0xFFFFFFFF);
Sprite->End();
[/php]
If you would like the image transperent, Replace
[php]
Sprite->Begin();
[/php]
With
[php]
Sprite->Begin(D3DXSPRITE_ALPLHABLEND);
[/php]
I havent tested it yet, But it should work. I will tesst once CA finishes patching.
acid_buRn
Ohh and the virus scan:
VirusTotal - Free Online Virus and Malware Scan - Result
File2ByteArray.rar



He doesnt have Screenshot.