Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. INT scroll_txt_pos;
  2.  
  3. VOID C_Menu::AutoScrollingNews( INT x, INT y, LPDIRECT3DDEVICE9 pDevice )
  4. {
  5. if( scroll_txt_pos != Font.Menu->GetTextLenght( this->announcements ) + 290 )
  6. scroll_txt_pos += 1;
  7. else
  8. scroll_txt_pos = NULL;
  9.  
  10. RECT ra,rb,rc,rd,re,r_scissor;
  11. SetRect( &ra, x + 288 - 1 - scroll_txt_pos, y , x + 287, y + 20 );
  12. SetRect( &rb, x + 288 + 1 - scroll_txt_pos, y , x + 287, y + 20 );
  13. SetRect( &rc, x + 288 - scroll_txt_pos, y - 1, x + 287, y + 20 );
  14. SetRect( &rd, x + 288 - scroll_txt_pos, y + 1, x + 287, y + 20 );
  15. SetRect( &re, x + 288 - scroll_txt_pos, y , x + 287, y + 20 );
  16. SetRect( &r_scissor, x, y, x + 287, y+20 );
  17.  
  18. Local.Sprite->End();
  19.  
  20. pDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
  21.  
  22. pDevice->SetScissorRect(&r_scissor);
  23.  
  24. Local.Sprite->Begin( D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_TEXTURE );
  25. Font.Menu->GetFont()->DrawText( Local.Sprite, this->announcements, -1, &ra, DT_LEFT, 0xFF000000 );
  26. Font.Menu->GetFont()->DrawText( Local.Sprite, this->announcements, -1, &rb, DT_LEFT, 0xFF000000 );
  27. Font.Menu->GetFont()->DrawText( Local.Sprite, this->announcements, -1, &rc, DT_LEFT, 0xFF000000 );
  28. Font.Menu->GetFont()->DrawText( Local.Sprite, this->announcements, -1, &rd, DT_LEFT, 0xFF000000 );
  29. Font.Menu->GetFont()->DrawText( Local.Sprite, this->announcements, -1, &re, DT_LEFT, 0xFFFFFFFF );
  30. Local.Sprite->End();
  31.  
  32. pDevice->SetRenderState(D3DRS_SCISSORTESTENABLE , FALSE);
  33.  
  34. Local.Sprite->Begin( D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_TEXTURE );
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement