Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Class CAAText (Fast Antialiased DirectX Text)

Author
Message
adastras
15
Years of Service
User Offline
Joined: 15th Oct 2007
Location:
Posted: 22nd Feb 2009 13:47 Edited at: 25th Feb 2009 12:20
DarkSDK addon with the full Class CAAText (Fast Antialiased DirectX Text)

Last Version 25.02.2009

Thanks to Morcilla - Message "Which DirectX SDKs can be used with DGDK?":
http://forum.thegamecreators.com/?m=forum_view&t=144802&b=22

for original code in text.h/text.cpp!

==================================================================

Replacement to standard DarkGDK functions:

void dbPerformChecklistForFonts ( void );

dbText( int iX, int iY, char* szText ); -> AAPrint(int x, int y, int align, LPSTR pString) or
startText();
AAText(int x, int y, int align, LPSTR pString);
endText();

dbCenterText( int iX, int iY, char* szText ); -> ... AAText(int x, int y, ALIGN_CENTER, LPSTR pString);/AAText(int x, int y, ALIGN_CENTERWINDOW, LPSTR pString); ...

dbSetTextFont( char* szTypeface ); -> setFont(LPSTR pFont, int FontSize, bool FontBold, bool FontItalic);

dbSetTextFont( char* szTypeface, int iCharacterSet ); -> setFont(LPSTR pFont, int FontSize, bool FontBold, bool FontItalic); setCharset(int charset);

dbSetTextSize( int iSize ); -> setAttr(int FontSize, bool FontBold, bool FontItalic);

dbSetTextToNormal( void ); -> setAttr(int FontSize, FALSE, bool FontItalic);
dbSetTextToBold ( void ); -> setAttr(int FontSize, TRUE, bool FontItalic);

dbSetTextToItalic( void ); -> setAttr(int FontSize, bool FontBold, TRUE);

dbSetTextToBoldItalic( void );-> setAttr(int FontSize, TRUE, TRUE);

void dbSetTextToOpaque(); -> setAlpha(int a); // Set Text To Opaque
void dbSetTextToTransparent(); -> setAlpha(int a); // Set Text To Transparent

int dbTextBackgroundType ( void );
char* dbTextFont( void ); -> char* getFontName();
int dbTextSize( void ); -> int getFontSize();
int dbTextStyle( void ); -> int getFontStyle();
int dbTextWidth ( char* szString ); -> int getTextHeight(LPSTR pString);
int dbTextHeight( char* szString ); -> int getTextWidth(LPSTR pString);

+ Draw Bicolor String: void AATextBicolor(int x, int y, int align, LPSTR pString, float up, float down);
+ Draw Text with Shadow: void AATextShadow(int x, int y, int align, LPSTR pString);

Attachments

Login to view attachments
prasoc
14
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 22nd Feb 2009 14:23 Edited at: 22nd Feb 2009 14:25
It looks amazing. the normal text is ****. Putting this to use right away!

edit: in the example, is there any reason for this:



?
adastras
15
Years of Service
User Offline
Joined: 15th Oct 2007
Location:
Posted: 22nd Feb 2009 19:03
prasoc,

only for delete font check. it is not necessary!
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd Feb 2009 21:40
looks great! thanks a lot
Krisacz
13
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 23rd Mar 2009 13:58
Thanks for that plug-in it's working great! When I was using normal dbText in my GUI i had about 50% fps loss, now not even 1%!

But there are two question: Is there a way to include text (in that form or other) to sprite priority? What I mean is I have sprite background, then I'm drawing some text, and on top of it I have sprite-mouse cursor. If i will put functions dbDrawSpriteFirts() then all sprites are behind text, it looks weird when mouse-cursor (sprite) is moving on text and it is behind it. If I'm not include that function (dbDrawSpriteFirts()) there is no text at all (it's behind background). Any ideas?

And question 2: When I'm creating new font using that class i have to use pre-defined names, i can't use my own like:


So even if I'm not using Arial my code needs to be like that:


Probably I'm doing something wrong, if so please help.
Thanks!
ABXG
13
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 9th Apr 2009 11:14 Edited at: 9th Apr 2009 11:29
EDIT, I figured it out. I had to do something like this:


Forgive my noobness, never used (I think these are classes?) before.

------------------------------------
Currently developing an "over-the-shoulder", action based, RPG with combat based on rag-doll physics.
adastras
15
Years of Service
User Offline
Joined: 15th Oct 2007
Location:
Posted: 9th Apr 2009 13:21
yes
FIGHTEX
14
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 17th Apr 2009 22:05
would be great, if it would have IDs so you can edit them one by one..
like if u dont want to hide all the text
with
SetApha(0);

Game.Love
adastras
15
Years of Service
User Offline
Joined: 15th Oct 2007
Location:
Posted: 18th Apr 2009 15:04 Edited at: 19th Apr 2009 08:44
sysfnt->setAlpha(0); make the font sysfnt unvisible
Carlos
18
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 27th Apr 2009 14:35
Can you add the functionality of drawing outlined text?
It will be great if DarkGDK can draw outlined text.
adastras
15
Years of Service
User Offline
Joined: 15th Oct 2007
Location:
Posted: 28th Apr 2009 14:19
Class BitmapFont use

Login to post a reply

Server time is: 2022-12-09 09:12:14
Your offset time is: 2022-12-09 09:12:14