12-03-2016, 02:33 PM
Merhaba değerleri forum üyelerimiz. Bu konumda sizlere 2D Esp Box Source kodlarını vereceğim . Peki 2D Esp Box nedir ?
* Bu özellik oyundaki oyuncuları kar içinde alır şöyle ;
* Bu özellik oyundaki oyuncuları kar içinde alır şöyle ;

- Kodlar -
PHP Kod:
Code:
cBoxInfo cEngine::DrawBoundingBox( Vector vHead, Vector vFoot, DWORD color, int edge, bool CalcOnly )//edge == 1 edge only, edge == 2 box + edge box::DrawBoundingBox( Vector vHead, Vector vFoot, DWORD color, int edge, bool CalcOnly )//edge == 1 edge only, edge == 2 box + edge box
{{
CVector2i iHead, iFoot;CVector2i iHead, iFoot;
cBoxInfo m_Box = {0};= {0};
//center boxes & add correction's//center boxes & add correction's
vFoot.x = vHead.x;.x = vHead.x;
vFoot.z = vHead.z;.z = vHead.z;
if( WorldToScreen( vHead, iHead ) && WorldToScreen( vFoot, iFoot ) )if( WorldToScreen( vHead, iHead ) && WorldToScreen( vFoot, iFoot ) )
{{
m_Box.iHead = iHead;.iHead = iHead;
m_Box.iFoot = iFoot;.iFoot = iFoot;
iFoot.y += 5;//some corrections.y += 5;//some corrections
iHead.y -= 7;//some corrections.y -= 7;//some corrections
int w = ( iFoot.y - iHead.y ) / 4;int w = ( iFoot.y - iHead.y ) / 4;
if( CalcOnly == false )if( CalcOnly == false )
{{
if( edge == 1 )if( edge == 1 )
{{
DrawEdgeBoundingBox( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), color, 8 );DrawEdgeBoundingBox( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), color, 8 );
} else if( edge == 2 ) {} else if( edge == 2 ) {
m_pDx11Renderer.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );
DrawEdgeBoundingBox( ( iHead.x - w - 3 ), iHead.y - 3, ( w * 2 ) + 6, ( iFoot.y - iHead.y ) + 6, txtYellow, 6 );//draw 3 px biggerDrawEdgeBoundingBox( ( iHead.x - w - 3 ), iHead.y - 3, ( w * 2 ) + 6, ( iFoot.y - iHead.y ) + 6, txtYellow, 6 );//draw 3 px bigger
} else {} else {
m_pDx11Renderer.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );
}}
}}
m_Box.x = ( iHead.x - w );.x = ( iHead.x - w );
m_Box.y = iHead.y;.y = iHead.y;
m_Box.w = ( w * 2 );.w = ( w * 2 );
m_Box.h = ( iFoot.y - iHead.y );.h = ( iFoot.y - iHead.y );
m_Box.middle_x = iHead.x;.middle_x = iHead.x;
}}
return m_Box;return m_Box;
}}
void cEngine::DrawEdgeBoundingBox( int x, int y, int w, int h, DWORD BorderColor, int override_le, bool midpoint, bool center )void cEngine::DrawEdgeBoundingBox( int x, int y, int w, int h, DWORD BorderColor, int override_le, bool midpoint, bool center )
{{
//draw circle on center of box//draw circle on center of box
if( midpoint )if( midpoint )
m_pDx11Renderer.DrawCircle( x, y, 2, txtGreen );.DrawCircle( x, y, 2, txtGreen );
//center x y in the box//center x y in the box
if( center )if( center )
{{
x -= ( w / 2 );-= ( w / 2 );
y -= ( h / 2 );-= ( h / 2 );
}}
int le = w / 4;int le = w / 4;
if( le > ( h / 4 ) )if( le > ( h / 4 ) )
le = ( h / 4 );= ( h / 4 );
if( override_le > 0 )if( override_le > 0 )
le = override_le;= override_le;
m_pDx11Renderer.DrawLine( x, y, x + le, y, BorderColor );.DrawLine( x, y, x + le, y, BorderColor );
m_pDx11Renderer.DrawLine( x, y, x, y + le, BorderColor );.DrawLine( x, y, x, y + le, BorderColor );
m_pDx11Renderer.DrawLine( x + w, y, x + w - le, y, BorderColor );.DrawLine( x + w, y, x + w - le, y, BorderColor );
m_pDx11Renderer.DrawLine( x + w, y, x + w, y + le, BorderColor );.DrawLine( x + w, y, x + w, y + le, BorderColor );
m_pDx11Renderer.DrawLine( x, y + h, x, y + h - le, BorderColor );.DrawLine( x, y + h, x, y + h - le, BorderColor );
m_pDx11Renderer.DrawLine( x, y + h, x + le, y + h, BorderColor );.DrawLine( x, y + h, x + le, y + h, BorderColor );
m_pDx11Renderer.DrawLine( x + w, y + h, x +w - le, y + h, BorderColor );.DrawLine( x + w, y + h, x +w - le, y + h, BorderColor );
m_pDx11Renderer.DrawLine( x + w, y + h, x + w, y + h - le, BorderColor );.DrawLine( x + w, y + h, x + w, y + h - le, BorderColor );
}}