Font Engine Demo

posted in Beals Software
Published February 23, 2006
Advertisement
I'm still working on my 2D demo (I can't geting fringing/transitions to work). Hopefully I can have a demo for that later. Until then, I have this little font engine demo for you:QftDF

This was done pretty easily, here's the code that I used:
void Idle(){    g_Timer.Start();    dftin::DirectInput::GetSingleton()->Update();    dftgfx::Direct3D::GetSingleton()->GetDeviceComPtr()->Clear(0, 0, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0);    dftgfx::Direct3D::GetSingleton()->GetDeviceComPtr()->BeginScene();    static int nTalkingIndex = 0;    static int nMsgIndex = 0;    static float fTalkingTime = 0.0f;    static float fMsgTime = 0.0f;    static bool bDone = false;    fTalkingTime += g_Timer.GetTimeElapsed();    fMsgTime += g_Timer.GetTimeElapsed();    std::string Talking = "Talking...";    std::string Message = "This is a complete message that will be\nrendered one character at a time!";    if(fTalkingTime > 0.5f)    {        ++nTalkingIndex;        if(nTalkingIndex > 3)            nTalkingIndex = 0;        fTalkingTime = 0.0f;    }    if(fMsgTime > 0.125f)    {        if(!bDone)            ++nMsgIndex;        if(nMsgIndex >= Message.length())            bDone = true;        fMsgTime = 0.0f;    }    if(bDone)        Talking = "Finished talking!!!";    dftgfx::FontEngine::GetSingleton()->GetItem(DEF_FONT)->DrawText(Message.c_str(), nMsgIndex, 0.0f, 0.0f, 0xffffffff);    dftgfx::FontEngine::GetSingleton()->GetItem(DEF_FONT)->DrawText(Talking.c_str(), bDone ? Talking.length() : Talking.length() + (nTalkingIndex - 3), 800.0f - (Talking.length() * 11), 600.0f - 24.0f, 0xffffffff);    dftgfx::Direct3D::GetSingleton()->GetDeviceComPtr()->EndScene();    dftgfx::Direct3D::GetSingleton()->GetDeviceComPtr()->Present(0, 0, 0, 0);    g_Timer.End();}
Previous Entry Sooner than I thought
Next Entry This sucks...
0 likes 3 comments

Comments

HopeDagger
Drat, I can't run it. Darned picky D3DX DLLs. -_-
February 23, 2006 02:55 PM
Programmer16
Is it still a bad idea to post the dll? If so you can copy and paste the one you have into the file where you downloaded the demo, and rename it to d3dx9_25.dll (not the greatest idea, but it does work). If its ok, then I can upload it.

Note: Also, if anybody downloaded it and it opened and closed, I had forgot to remove my depth buffer code, so that was probably your problem. I fixed it and reuploaded the demo.

Edit: I could also email the dll to anybody that wants it.
February 23, 2006 02:59 PM
Programmer16
Ok, anybody that doesn't have the D3DX april dll that wants to run this, can get it from here:
ToyMaker.info
February 24, 2006 06:35 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement