All credits goes to silentchris and the MSDN (microsoft).
Please credit silentchris if you use this class.
"cSilentFont" got made to make LPD3DXFONT-using easier and let it render faster.
It`s recommend to use the PreloadText function to get the highest performance
out of your LPD3DXFONT. Make sure that you only call it once for each static string.
With "cSilentFont" you are able to draw fonts in alot different styles:
DrawText() :
LEFT
LEFT_SHADOW
CENTER
CENTER_SHADOW
RIGHT
RIGHT_SHADOW
DrawTextMaxLen() :
LEFT
LEFT_SHADOW
DrawTextAutoScrolling() :
Well, there aint an alignement. You set a start x/y position and a scroll-w. It scrolls from the right to the left inside the field of x-(x+w) and restarts at (x+w) after the text left the field. You can also set the speed. You`ll need to add a buffer as we want it to be different for each call...
----How to use----
-------
[1]
You`ll need to initalise your font by using the Constructor!
Define
Code:
C_Font *pFont;
Call
Code:
pFont = new C_Font( pDevice, "Arial", 14, FW_SEMIBOLD, FALSE );
Parameter 1: Your D3D Device
Parameter 2: The name of your font
Parameter 3: The size of your font
Parameter 4: The Weight of your font
Parameter 5: You want your font Italic?!
-------
[2]
Before your drawing you`ll need to call (every frame), basically at the top of present/endscene
Code:
pFont->InitVolatileResources();
[3]
DRAW!
-------
[4]
After your drawing you`ll need to call (every frame), basically on the bottom of present/endscene
Code:
pFont->FreeVolatileResources();
Header File & Readme are attached






