2 registered members (AndrewAMD, juanex),
1,247
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: What are you working on?
[Re: Slin]
#444905
08/21/14 12:07
08/21/14 12:07
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Using the way Felix proposed, with bmap_rendertarget should work perfectly for you!? Nobody forces you to redraw the bmap every frame. Just do it once and you are done. And if you want to draw additional letters into it there should even be some way to keep the textures content and render on top of it.
Edit: also why aren´t you using true type fonts? but hoow? ;_;
In Felix's example he draws it once every frame which works fine, but if I only draw it once it's not working.
might be obvious but I'm really not getting it or it's just some dumb mistake, I don't know
Edit: I'm not using tt font's because in my case (low-/mediumres game) it just works better this way and I'm quite sure you can't get the same effect/accuracy/whatever with truetype fonts. (like the one in the screenshot I posted some pages before) Edit#2: forget all that, acknex is just doing some annoying s*** again. After the startup I have to wait two frames instead of one before I can write the text, otherwise nothing happens. -.-
Last edited by Kartoffel; 08/21/14 12:19.
POTATO-MAN saves the day! - Random
|
|
|
Re: What are you working on?
[Re: Kartoffel]
#444906
08/21/14 12:44
08/21/14 12:44
|
Joined: Jul 2010
Posts: 283 Germany
jenGs
Member
|
Member
Joined: Jul 2010
Posts: 283
Germany
|
If you only add one character per keypress you can send the position data through a material skill. That saves a lot of time. You don't need a wait(1) anymore
void paint_char(BMAP *bmpTarget, char *str, VECTOR *offset)
{
var pos = str_getchr(str, 1);
mtlProjectText.skill[0] = floatv(1);
mtlProjectText.skill[1] = floatv(offset.x);
mtlProjectText.skill[2] = floatv(offset.y);
mtlProjectText.skill[3] = floatv(bmap_width(bCourier) / 32);
mtlProjectText.skill[4] = floatv(bmap_height(bCourier) / 4);
mtlProjectText.skill[5] = floatv(points[pos].x);
mtlProjectText.skill[6] = floatv(points[pos].y);
bmap_process(bmpTarget, bmpTarget, mtlProjectText);
}
I didn't test it. but it should run faster.
Last edited by jenGs; 08/21/14 12:49.
|
|
|
Re: What are you working on?
[Re: Kartoffel]
#444907
08/21/14 12:45
08/21/14 12:45
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Edit: I'm not using tt font's because in my case (low-/mediumres game) it just works better this way and I'm quite sure you can't get the same effect/accuracy/whatever with truetype fonts. (like the one in the screenshot I posted some pages before) I am sure you can get that effect in a much better quality with true type fonts, BUT you need a font specifically designed for your needs, so either you find one online or build it yourself, however that is done.
|
|
|
Re: What are you working on?
[Re: Slin]
#444908
08/21/14 12:49
08/21/14 12:49
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
Edit: I'm not using tt font's because in my case (low-/mediumres game) it just works better this way and I'm quite sure you can't get the same effect/accuracy/whatever with truetype fonts. (like the one in the screenshot I posted some pages before) I am sure you can get that effect in a much better quality with true type fonts, BUT you need a font specifically designed for your needs, so either you find one online or build it yourself, however that is done. Well I haven't seen a truetype font that used transparency so I don't think they support it. Also I am very happy with the way my font looks like so ttf isn't going to make it look 'better' But thanks anyway
POTATO-MAN saves the day! - Random
|
|
|
Re: What are you working on?
[Re: Kartoffel]
#444911
08/21/14 13:09
08/21/14 13:09
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
They do, there are different flavours! True Type Fonts are actually quite the amazing things, in reality they are byte code that is executed by a VM. And yes, that is turing complete.
However, the biggest advantage they have over bitmap fonts, aside being scalable, is that they contain information for kerning, ascender, descender and leading. Basically all the information needed to do proper typesetting of the text.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: What are you working on?
[Re: WretchedSid]
#444912
08/21/14 13:34
08/21/14 13:34
|
Joined: Jun 2009
Posts: 2,210 Bavaria, Germany
Kartoffel
Expert
|
Expert
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
|
@^: Thank you for the info, I didn't knew that. However I think I'll go with MQ32's or jenGs' approach ( thanks you two ), especially because acknex's way of rendering truetype fonts is slow as hell (every character is a single drawcall afaik)
POTATO-MAN saves the day! - Random
|
|
|
Re: What are you working on?
[Re: WretchedSid]
#444917
08/21/14 17:59
08/21/14 17:59
|
Joined: Aug 2003
Posts: 7,439 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,439
Red Dwarf
|
True Type Fonts are actually quite the amazing things, in reality they are byte code that is executed by a VM. And yes, that is turing complete. So what you're saying is that if I use a True Type Font in a Java app, I am running a VM in a VM?
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Re: What are you working on?
[Re: Michael_Schwarz]
#444923
08/22/14 00:30
08/22/14 00:30
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
So what you're saying is that if I use a True Type Font in a Java app, I am running a VM in a VM? Now imagine that said Java runs on an OS that runs on some kind of hypervisor... The fun never ends on Mr. Bones Wild Ride!
Last edited by WretchedSid; 08/22/14 10:50. Reason: Pop culture reference
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|