Print Picture Ovelay D3D

NxFullieX

Member
Joined
Apr 9, 2015
Messages
19
Reaction score
0
How do i print a image on s0beit :: proxyIDirect3DDevice9

Like God of Cars, or s0nicTz Project
[img=500x200]http://i.imgur.com/2wdCS5o.jpg[/img]
[img=500x200]http://imgur.com/kDY3Rle.jpg[/img]
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Look at how the speedometer is drawn, use that as example to draw your own images.
 

NxFullieX

Member
Joined
Apr 9, 2015
Messages
19
Reaction score
0
springfield link said:
Look at how the speedometer is drawn, use that as example to draw your own images.
Thanks, And what this functions/voids shoold to do ? (which one is printing, and which one is load the texture?)


void texturesInitResources ( IDirect3DDevice9 *pDevice, D3DPRESENT_PARAMETERS *pPresentationParameters )
{
if ( set.speedometer_enable
&& (
fopen(set.speedometer_speedo_png_filename, "rb") == NULL
|| fopen(set.speedometer_needle_png_filename, "rb") == NULL
) )
{
Log( "Could not find the speedometer files, disabling it." );
set.speedometer_enable = false;
set.speedometer_old_enable = true;
}
else if ( set.speedometer_enable )
{
// init speedo
tSpeedoPNG = NULL;
sSpeedoPNG = NULL;
tNeedlePNG = NULL;
sNeedlePNG = NULL;
if ( !tSpeedoPNG )
D3DXCreateTextureFromFile( pDevice, set.speedometer_speedo_png_filename, &tSpeedoPNG );
if ( !sSpeedoPNG )
D3DXCreateSprite( pDevice, &sSpeedoPNG );
if ( !tNeedlePNG )
D3DXCreateTextureFromFile( pDevice, set.speedometer_needle_png_filename, &tNeedlePNG );
if ( !sNeedlePNG )
D3DXCreateSprite( pDevice, &sNeedlePNG );
needlePos.x = ( pPresentationParameters->BackBufferWidth / 1024.0f );
needlePos.y = ( pPresentationParameters->BackBufferHeight / 768.0f );
speedoPos.x = ( 750.0f * needlePos.x );
speedoPos.y = pPresentationParameters->BackBufferHeight - ( 292.0f * needlePos.y );
}
if ( !gta_menu_active() && !KEY_DOWN(VK_TAB) )
{
if ( (sSpeedoPNG) && (tSpeedoPNG) && (sNeedlePNG) && (tNeedlePNG) )
{
D3DXMatrixTransformation2D( &mat, NULL, 0.0f, &needlePos, &axisNeedle, 0.0f, &axisSpeedo );
sSpeedoPNG->Begin( D3DXSPRITE_ALPHABLEND );
sSpeedoPNG->SetTransform( &mat );
sSpeedoPNG->Draw( tSpeedoPNG, NULL, NULL, NULL, 0xCCFFFFFF );
sSpeedoPNG->End();

D3DXMatrixTransformation2D( &mat, NULL, 0.0f, &needlePos, &axisNeedle, rotationNeedle, &axisSpeedo );
sNeedlePNG->Begin( D3DXSPRITE_ALPHABLEND );
sNeedlePNG->SetTransform( &mat );
sNeedlePNG->Draw( tNeedlePNG, NULL, NULL, NULL, 0xCCFFFFFF );
sNeedlePNG->End();
}
}

EDIT!!:

I do all the things, where i need to render it ?
 

0x_

Wtf I'm not new....
Administrator
Joined
Feb 18, 2013
Messages
1,116
Reaction score
167
renderHandler obviously OR where the speedometer renders (renderHandler) just remove the conditions for your one.
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Google Direct3D Sprites.

LPDIRECT3DTEXTURE9 Image;
LPD3DXSPRITE          Sprite;


in Hooked PostReset:
PHP:
// SPRITE is defined as a big chunk of bytes of the image, but you can also draw it from file...
if(Sprite == NULL)D3DXCreateSprite(pde, &Sprite);
if(Image== NULL)D3DXCreateTextureFromFileInMemoryEx(
								    pde,
                                                                    &SPRITE,
                                                                    187418,
                                                                    250,
                                                                    491,
                                                                    D3DX_DEFAULT_FLOAT,
                                                                    0,
                                                                    D3DFMT_UNKNOWN,
                                                                    D3DPOOL_MANAGED,
                                                                    D3DX_DEFAULT,
                                                                    D3DX_DEFAULT,
                                                                    0,
                                                                    NULL,
                                                                    NULL,
                                                                    &Image
                                                    );
in Hooked EndScene:
PHP:
Sprite->Begin(D3DXSPRITE_ALPHABLEND);
Sprite->Draw(Image,NULL,NULL,&ColorMenu, Color_);
Sprite->End();
Sprite->OnLostDevice();
Sprite->OnResetDevice();
 

NxFullieX

Member
Joined
Apr 9, 2015
Messages
19
Reaction score
0
T3K link said:
Google Direct3D Sprites.
pde suppose to be pDevice
I tried from your code and some codes from the internet and still doesn't work :hellno:
 

Gray

New member
Joined
Apr 9, 2015
Messages
2
Reaction score
0
Look here https://github.com/BlastHackNet/mod_s0beit_sa/blob/7b404bfb447b4ee14bbd2511255b2fb62e246adb/src/proxyIDirect3DDevice9.cpp#L3251 and here https://github.com/BlastHackNet/mod_s0beit_sa/blob/7b404bfb447b4ee14bbd2511255b2fb62e246adb/src/proxyIDirect3DDevice9.cpp#L800
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
NxFullieX link said:
pde suppose to be pDevice
I tried from your code and some codes from the internet and still doesn't work :hellno:
yes pde is short for pdevice, my code works for d3d9 apps, its incomplete tho just giving u an idea of what u have to do
 
Top