-ve Coordinates of the screen
I want the 2D text in DirectX pass through the left side of the screen is there any way in DirectX to solve that problem.
Thing is that i am scrolling a text from right to left when the
first character matches the 0 coordinate of the screen the text repeats again from the starting instead of crossing the zero value of the screen.
void CGame::RenderText()
{
//Draw some text at the top of the screen showing stats
char buffer[255];
DWORD dwDuration = (timeGetTime() - m_dwStartTime) / 1000;
static float d1 = 800.00;
d1 -= 3.00;
sprintf(buffer, "The Contineous Scrolling Text in DirectX The Contineous Scrolling Text in DirectX");
m_pFont->DrawText(buffer, d1, 310, D3DCOLOR_XRGB(255, 255, 255));
if (d1< -100.00)
d1 = 800.00;
}
Muhammad Ali Lodhi
Can you clarify your problem a little bit? Is it that the text starts to wrap around back to the right side of the screen before it has fully moved through the left? If so, then:
Maybe -100.0f isn''t far enough off the left side for the text. It probably isn''t, since your text string is pretty big. If you''re using a fixed-width font, you can determine how many pixels wide the string is, so that it will disapear at the correct time.
Dustin Franklin
Mircrosoft DirectX MVP
quote:Original post by alitheone10
if (d1< -100.00)
d1 = 800.00;
}
Maybe -100.0f isn''t far enough off the left side for the text. It probably isn''t, since your text string is pretty big. If you''re using a fixed-width font, you can determine how many pixels wide the string is, so that it will disapear at the correct time.
if( d1 < 0.0f - (fontWidth * numChars) )d1 = 800.0f;
Dustin Franklin
Mircrosoft DirectX MVP
thanx
but u have mentioned one thing here fixed width font
can u plz tell me abt this?
and how can i get pixels wide?
but u have mentioned one thing here fixed width font
can u plz tell me abt this?
and how can i get pixels wide?
quote:Original post by Anonymous Poster
thanx
but u have mentioned one thing here fixed width font
can u plz tell me abt this?
and how can i get pixels wide?
Thing is that as soon as first character of the string
touches the 0 coordinate of the screen the whole string disappear. This is the main problem.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement