1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| D3DXVECTOR3 vEye = D3DXVECTOR3(0.0f, 0.0f, -30.0f);
D3DXVECTOR3 vLookAt = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
D3DXVECTOR3 vUp = D3DXVECTOR3(0.0f, 0.0f, 1.0f);
D3DXMatrixLookAtLH( &matView, &vEye, &vLookAt, &vUp);
pd3dDevice->SetTransform( D3DTS_VIEW , &matView);
// Let the sprite at the origin
D3DXMatrixIdentity( &matId);
pd3dDevice->SetTransform( D3DTS_WORLD, &matId );
// Set new matrix value to the sprite
m_pSpeedTextSprite->SetWorldViewLH( &matId, &matView);
m_pSpeedTextSprite->SetTransform(&matId);
// Screen rect
RECT rct;
SetRect( &rct, 10, 10, 0, 0);
// Draw the sprite
m_pSpeedTextSprite->Begin( D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_TEXTURE | D3DXSPRITE_BILLBOARD | D3DXSPRITE_OBJECTSPACE);
V(m_pSpeedFont->DrawTextW( m_pSpeedTextSprite, L"Test", -1, &rct, DT_NOCLIP,
D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f)));
m_pSpeedTextSprite->End(); |
Partager