|
Fonts and text input |
OICW
Member #4,069
November 2003
|
I have some questions: 2) Can be the fonts larger ( in resolution 800 x 600 are the fonts 8 x 8 very small ) ? [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
SonShadowCat
Member #1,548
September 2001
|
I remmeber something called gstream being used for text input. |
mEmO
Member #1,124
March 2001
|
string szInput; if (keypressed()) { szInput += readkey() & 0xff; }
--------------------------------------------- |
23yrold3yrold
Member #1,134
March 2001
|
C++:
C:
And yes, you can use different fonts, but I'll leave that to someone who knows more about how than me -- |
mEmO
Member #1,124
March 2001
|
You didn't leave him much work to do --------------------------------------------- |
23yrold3yrold
Member #1,134
March 2001
|
Hey, give me some credit; I completely ignored the second question! -- |
Maverick
Member #2,337
May 2002
|
Quote: 2) Can be the fonts larger ( in resolution 800 x 600 are the fonts 8 x 8 very small ) ? You could create and use your own font. However, if you don't have the time/inclination/artistic ability, you could just draw the system 8x8 font to a temporary bitmap (with a color 0, or "magic pink" background), then stretch_sprite() it onto the screen (or your backbuffer) to whatever size you need it. -Maverick ----- |
gnolam
Member #2,030
March 2002
|
Quote: You could create and use your own font. However, if you don't have the time/inclination/artistic ability, you could just draw the system 8x8 font to a temporary bitmap (with a color 0, or "magic pink" background), then stretch_sprite() it onto the screen (or your backbuffer) to whatever size you need it. Or just use ttf2pcx -- |
OICW
Member #4,069
November 2003
|
Thanks for posibilities, I have another question, if I draw my own font in one bmp, how can I select one character of 40. Or I had to draw it in many bmps? [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
miran
Member #2,407
June 2002
|
[plug]Allegro Font Editor[/plug] -- |
Basix 9
Member #3,994
October 2003
|
23yrold3yrold here are the errors i get when i compile your code =(. I am using MingW32 with DevC++
|
flares
Member #3,463
April 2003
|
by the tagBitmap stuff, i think that you need to hide the windows headers from the compiler using some flag define in the FAQ, hold on i think that should work edit: add it there [nonnus29]Plus the api is crap ... I'd rather chew broken glass then code with those. |
OICW
Member #4,069
November 2003
|
Thank you Miran for your utility, I probably use it. 2 Basix 9: I've got same errors when I wanted to compile it, it needs repair, I think, that I'll try to write my own algorythm. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
23yrold3yrold
Member #1,134
March 2001
|
flares is right; you need to use that compiler flag. -- |
OICW
Member #4,069
November 2003
|
Ok that's it. I copied the code to new source file but I didn't make a project. I'll try to implement it in my game (it's done from 40%) and when I have first beta I'll post it here. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
Tobias Dammers
Member #2,604
August 2002
|
For making your own fonts: Get ttf2pcx, create a font (any font), and closely observe the resulting pcx bitmap. Your font should then look the same, you can draw it onto one big pcx. Note that fonts are always 8 bpp, the border around the glyphs is color #255, and the mask color for within glyphs is #0. Glyphs are variable-width, but should all be the same height. Every color from #1 to #254 is free for your use, and will be replaced by the text foreground color, except when that is set to something < 0, in which case the original colors are used. --- |
mEmO
Member #1,124
March 2001
|
Quote: Oh yes, and for text input: Why not use the gui functions? I'm sure you could bash out a simple text input box within 15 minutes... You mean the allegro standard GUI? I'm pretty sure it's faster to write a custom made function, and better too. Unless you use one of the many addon libs out there, of course. --------------------------------------------- |
Thomas Fjellstrom
Member #476
June 2000
|
nah. the Allegro gui us uber simple. a quick DIALOG struct with a entry will take barely a few minutes to layout. -- |
|