Page 1 of 1

PocketFrog: draw text on surface?

PostPosted: Apr 26, 2005 @ 3:08pm
by EvilMaio
Hi!

I'm trying to display a text on a surface object; what i need is something like ExtTextOut or similar..

Do you have a place where i can learn (tutorial, example or simple manual, i can't find on the pocketfrog one!!)

I found a exttextout method in pocketfrog, but i can't figure how it works.

Thanks for your time.

PostPosted: Apr 26, 2005 @ 3:20pm
by EvilMaio
Well, it looks like i didn't search very well until today; finally i found a tutorial about it ;)

With google, first link using "pocketfrog exttextout" as search keys.

PostPosted: Apr 27, 2005 @ 10:18pm
by fast_rx

PostPosted: Apr 29, 2005 @ 10:48am
by Conan

PostPosted: Apr 29, 2005 @ 11:27am
by EvilMaio

PostPosted: Apr 29, 2005 @ 12:42pm
by BIGBEN

PostPosted: Apr 29, 2005 @ 1:40pm
by fast_rx

PostPosted: Apr 29, 2005 @ 3:28pm
by BIGBEN

PostPosted: Apr 29, 2005 @ 4:06pm
by Conan

PostPosted: May 2, 2005 @ 7:07pm
by fzammetti
I wrote the DrawVGAText function, as well as supersample...

Thwt function is slower because it calls SetPixel (or whatever it is, I forget) for every pixel in the characters. Without question it's going to be slower most of the time by some degree. Although, as compared to GDI I'd bet the difference isn't sever 99% of the time... looks like your difference was 2FPS... I'd be willing to bet that if you put the same amount of text on the screen with DrawVGAText as with gersen's function you wouldn't drop below 27FPS anyway. 2FPS might be a big enough different for you to worry about though.

That being said, I am able to fill a screen with a background image, then put text over the entire thing with a random color in each pixel and still pull 30FPS on an old Casio E-125, so clearly it isn't THAT bad :) In fact, all of my games released to date use that function with no ill effect... Invasion: Trivia is coded to run at 30FPS, I think K&G Arcade is 24FPS.

Supersample was hardcoded to I believe 30FPS because that's the speed I wanted it to run at... I wanted it to be a known rate so if you tried it on a device and saw something less you'd know something was up with that particular device.

PostPosted: May 2, 2005 @ 7:18pm
by BIGBEN
Thanks for your info, Frank. And about my screenshots - they do not provide accurate framerate, just some rounding sorry(just to show you the test in action) :)

PostPosted: May 2, 2005 @ 7:29pm
by fzammetti
No problem :)

Keep in mind one of the benefits of DrawVGAText is that it makes some effects extremely easy... Since you have the source, it's trivial to do things like per-pixel coloring or fake raster bars through the text, or text dissolves, or (one of the coolest) animations based on altered character data...

Basically, if you ever did any coding on the C64 or in DOS days you will probably appreciate this function... your font data is just like the font data you used to be able to manipulate in all sorts of crazy ways.

Also, since it's always a known font size, sometimes it can make things easier because you can always simply determine how much space your text will take up.

Certainly it's not perfect for every case, and when I added it to PF I did so with the idea that (a) there was no built-in text drawing functionality at that point so ANYTHING was better! and (b) it enables some cool effects that otherwise wouldn't be possible or would be more difficult.

PostPosted: May 2, 2005 @ 10:46pm
by BIGBEN

PostPosted: May 2, 2005 @ 11:44pm
by fzammetti
That's actually what supersample was supposed to be... maybe I'll find some time and throw together some new screens in that... might be fun to try and duplicate some of my old C64 demos :)

You are more than welcome in any case :)