xboxscene.org forums

Author Topic: Yep... I Got Another Problem  (Read 86 times)

SamSam

  • Archived User
  • Jr. Member
  • *
  • Posts: 76
Yep... I Got Another Problem
« on: February 21, 2004, 10:13:00 AM »

I have a problem with the function text of www.xfactordev.net.

I try to put a wallpaper and some text over it, but the text won't show.

I call a function that make two triangle and apply the image on it, after i draw the text with a function a found in the tutorials of xfactordev.

g_pd3dDevice->BeginScene();

Wallpaper.DrawWallpaper(WWallpaper,&g_pd3dDevice);   
Text.DisplayText(WLED,225.0f,200.0f,255,0,255);
Text.DisplayText(L"Ca pu!",300.0f,300.0f,255,0,0);

g_pd3dDevice->Present( NULL, NULL, NULL, NULL );

g_pd3dDevice->EndScene();

and after that i loop in the render function until a button is pressed.
Anyone know what im doing wrong?
Logged

SamSam

  • Archived User
  • Jr. Member
  • *
  • Posts: 76
Yep... I Got Another Problem
« Reply #1 on: February 21, 2004, 10:51:00 AM »

I tried to put it at different place and it didn't solve my problem.
It's there because it's the last place where I tried to put it.
Logged

Wishi

  • Archived User
  • Full Member
  • *
  • Posts: 191
Yep... I Got Another Problem
« Reply #2 on: February 21, 2004, 12:20:00 PM »

BeginScene() and EndScene() don't do anything on Xbox. Just provided for portability.
Logged

SamSam

  • Archived User
  • Jr. Member
  • *
  • Posts: 76
Yep... I Got Another Problem
« Reply #3 on: February 21, 2004, 12:29:00 PM »

What could help me is something that explain clearly how the buffer works.

because i managed to make it appear if i let it loop but it flicker a lot.
Logged

dXtr333

  • Archived User
  • Newbie
  • *
  • Posts: 9
Yep... I Got Another Problem
« Reply #4 on: February 21, 2004, 01:46:00 PM »

I made his code a little more effective..

add this in your text.cpp file:

void CText::TextOut(const WCHAR *lpwszString, const int &Xpos, const int &Ypos, const DWORD &Color)
{
   // Display the text
   m_lpFont->SetTextColor(Color);
   m_lpFont->TextOut(this->m_lpBackBuffer, lpwszString, -1, Xpos, Ypos);
}

and add this in your text.h file under the other TextOut line:

void TextOut(const WCHAR *lpwszString, const int &Xpos, const int &Ypos, const DWORD &Color);

then to print just do like this:

text.TextOut(L"HELLO", 225, 200, D3DCOLOR_XRGB(255, 255, 255));

------------------

btw. I discoverd why my test didn't show any text. Thats because I needed to set x and y to 40 to display on screen.. don't know If it's because of the stupid focus chip or why it is like that.. but I can't se the whole screen in any app.. it was like that before in my mod chip Xenium to.. until they released their update
Logged