1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
define a truetype font ? and fps low from draw_text!
#414995
01/12/13 14:58
01/12/13 14:58
|
Joined: Jan 2013
Posts: 23 France
Mo222
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 23
France
|
Hello ! I have a problem with my texts that i want to display in the game. 1) how should i define a true type font to use for my texts? -When i read the manual and the workshop, it says just type for example :
FONT* arial_font = "Arial#20b";
but my A6.60 engine doesnot recognize this and says "Keyword unknown FONT*" -When i type
font font_centur12 = <font_centur12.pcx>,16,20;
: no problem for the engine, it works for a pcx font. But in my case i want truetype font. Question : How should i define a truetype font in C-Script for my A6.60 engine? 2)I have a function named for exemple show_variables that i use to show some values in the gamehud for the player . I use several times the instructions "draw_text" like
draw_textmode("arial",1,60,100);
draw_text(str_time_left,253,43,vector(0,0,0));
But when i started to use F11 and monitor the engine performances , i encountered that show_variables uses a lot of CPU compared with entities functions. When i include show_variables with draw_text instructions , F11 gives me 10ms per frame for functions...whereas i have only 0.5 ms per frame for functions when i use formatted texts. ----I have seen in the manual at frame rate page that "draw_textmode reduce the frame rate remarkably"...
3) So if i want to reduce the frame rate , i should set some formatted texts with a bitmap font. But i still would like to know how can i define a truetype font.
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Mo222]
#414999
01/12/13 16:32
01/12/13 16:32
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
1. I'm not sure A6 supports true type fonts at all. Why using such an outdated version?
2. You already answered that question for yourself.
3. When you want to reduce the framerate? Why would you want to do that? And if you wanted to do that you should use fps_max instead.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Uhrwerk]
#415004
01/12/13 17:26
01/12/13 17:26
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
3. When you want to reduce the framerate? Why would you want to do that? And if you wanted to do that you should use fps_max instead. I think he meant reduce the render time?
POTATO-MAN saves the day! - Random
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Kartoffel]
#415011
01/12/13 19:26
01/12/13 19:26
|
Joined: Jan 2013
Posts: 23 France
Mo222
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 23
France
|
3. When you want to reduce the framerate? Why would you want to do that? And if you wanted to do that you should use fps_max instead. I think he meant reduce the render time? Yes indeed , my bad I wanted to say : i want to increase the frame rate , and reduce the render time .. After the previous remarks i made, i think the best way for texts of the gamehud is to use formatted texts with bitmap fonts.... Do you agree?
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Uhrwerk]
#415013
01/12/13 19:33
01/12/13 19:33
|
Joined: Jan 2013
Posts: 23 France
Mo222
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 23
France
|
1. I'm not sure A6 supports true type fonts at all. Why using such an outdated version?
2. You already answered that question for yourself.
3. When you want to reduce the framerate? Why would you want to do that? And if you wanted to do that you should use fps_max instead. 1)I have bought my A6 in 2005, and i just wanted to use what i have available , before to buy or else. I am not sure the benefits would be good enough to pay 60 euros for upgrading A6 commercial to A8 extra. 2) yep 3)see above
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Mo222]
#415017
01/12/13 20:13
01/12/13 20:13
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I suggest you give the A8 Trial a try, I'd hate to use A6 for all reasons.
EDIT: To give my post any content: A8 is faster in every regard, especially those drawing options. My whole GUI and options menu in my game is based on draw_text, draw_quad and draw_obj and it's really fast.
Last edited by Superku; 01/12/13 20:14.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Superku]
#415020
01/12/13 20:31
01/12/13 20:31
|
Joined: Jul 2002
Posts: 3,208 Germany
Error014
Expert
|
Expert
Joined: Jul 2002
Posts: 3,208
Germany
|
Alright, so, it's been a while since I used A6, so sorry if this is wrong - can't exactly look it up so easily nowadays. But I think it used to be defined like this:
FONT Arialfont = "Arial",20,1;
where the 20 was the size and the other number defined whether it was a boldtype font or italicized or whatever. I think "1" meant bold type, but you'd have to experiment. Again, no guarantees, but probably worth a shot! As far as draw_textmode goes, this is always slow. You can use it once when starting your game, but from that moment onwards only use draw_text every frame. In general, if you're calling draw_textmode every frame, you're doing it wrong.
Perhaps this post will get me points for originality at least.
Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Error014]
#415022
01/12/13 21:01
01/12/13 21:01
|
Joined: Jan 2013
Posts: 23 France
Mo222
OP
Newbie
|
OP
Newbie
Joined: Jan 2013
Posts: 23
France
|
@Error014 Thanks for the tip . Now the engine error message says " Can't open Arial" , which is different from the previous message "Keyword unknown Font*" Its strange, i even tried to put the arial.ttf file in the directory of the project , but it didnot change the message. How comes A6 cant open the arial font? (i have tried with "times" too, no result) -About draw_textmode i'll think about it ! As you said i shouldnot have 1 draw_textmode per frame.
@superku I would like to publish my little game, even for free (i dont know yet). I wouldnot be able to publish it with a trial version of A8, would i?
Last edited by Mo222; 01/12/13 21:02.
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Mo222]
#415023
01/12/13 21:26
01/12/13 21:26
|
Joined: Jul 2002
Posts: 3,208 Germany
Error014
Expert
|
Expert
Joined: Jul 2002
Posts: 3,208
Germany
|
Looks like I got it mixed up. The following is copied right out of old scripts of mine. Secret, magic games that slumber on my harddisk. With this, they shall live on! (Sorry, but let me have my theatralic moment).
FONT myfont = "Arial",1,40;
As you can see below, you can define these fonts in a different way if you're lazy:
text name {
string = " ";
font = "Arial#22";
layer = 20;
}
Since they're from (working!) game projects, I guess they should work for you as well. Try the good ol' copy&paste and see if that works!
Perhaps this post will get me points for originality at least.
Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
|
|
|
Re: define a truetype font ? and fps low from draw_text!
[Re: Error014]
#415034
01/12/13 22:39
01/12/13 22:39
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I am not sure the benefits would be good enough to pay 60 euros for upgrading A6 commercial to A8 extra. I suggest you give the A8 Trial a try
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|