News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

drawing bitmap fonts onto images not working?

Started by Alex, March 24, 2007, 11:26:24 PM

Previous topic - Next topic

Alex

im trying to draw bitmap font onto an image, and its not working.
for instance:


RenderToImage 6
DrawFontChr 2, asc("1"), 0, 0, 0


where 2 is my bitmap font.
it simply draws it to the scene, not the image. but if it is set to 1, the normal font, it draws it to the image like it should.



Note:  In PlayBASIC V1.64M  use the  MakeBitmapFont command to convert the font to CRF format.   These can be coloured real time and drawn onto anything.  Newer editions of PlayBASIC, V1.64N and above can do an automatic conversion when using Windows fonts


Alex

ok,
i figured out that i had to do:
prepareFXfont 2
in order to draw to an image, but now i have another issue..

i'm trying to draw each character to an image and draw that image each time, so that I have a bunch of drawn images with characters on each, using same image.. but i can only get the same character on all of them.. i'm not sure why.
i'm captureing toscene, maybe this has something to do with it?

Alex

ok,
figured this out as well, but it took alot of tweaking

had to have drawgfximmediate
also had to draw the font onto an image, clear that image every loop, draw that image onto another larger one which would hold all the smaller ones useing the same image, then finally draw that larger image to the scene when all drawing operations to it are done.
in the end i have a larger image consisting of a bunch of smaller images(useing same image, but changing each time) which were drawn to it.

Ian Price

Errr... sorry, what language was that in? :P

I haven't got a clue what exactly you were trying/succeeded in doing there, but it sounds like you went the long way around to do it.

Why would you want the font to be drawn only to an image and not to the scene?
I came. I saw. I played some Nintendo.

Alex

I needed the bitmapfont to be rotated.
so i had to draw the font onto an image, and then rotate that image

Ian Price

#5
OK. Is the font only rotated to one angle (say 90degs)? If so, there are definitely far more efficient methods of achieving this, however, if you've got it working, then that's good too. :)

Can I ask what you are working on? The only thing I can think of that would require a rotate font would be one where the score is used down the side of a screen and the only genre I've seen that in is shoot'em-ups. Am I right in assuming it's for a sh'mup?
I came. I saw. I played some Nintendo.

Alex

I'd rather not talk about my game until I have atleast a playable demo available.

I'm pretty sure how I did things is as good as it can be for what is possible and what I need.

Ian Price

Well, I look forward to seeing it - whatever it is you're doing. :)
I came. I saw. I played some Nintendo.