Need a string-blitting function

I need a function that I can pass a string and and x and y coordinates
to that will blit said string to the screen. Can anyone point me in the
right direction? Something like Graphics.drawstring in Java…

Michael Sullivan schrieb:

I need a function that I can pass a string and and x and y coordinates
to that will blit said string to the screen. Can anyone point me in the
right direction? Something like Graphics.drawstring in Java…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

H!
http://lazyfoo.net/SDL_tutorials/index.php
Lessen 7 for example.
It is written for C/C++ , but I think, you can do that in java too.
Greetings.

i’ve been working on this today, so here is my 5 cents :

you’ll need the SDL_ttf library

after that, its a matter of these lines :

TTF_Font *font = TTF_OpenFont(fontname, fontsize);
my_text_surface = TTF_RenderText_Solid(font, "testing", m_fore_color);

here, fontname is a char * pointer to your fontname which is best
locally stored with your application (so make sure you use royalty
free fonts !!)On 13 Nov 2007, at 15:02, Michael Sullivan wrote:

I need a function that I can pass a string and and x and y coordinates
to that will blit said string to the screen. Can anyone point me in
the
right direction? Something like Graphics.drawstring in Java…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Michael Sullivan yazm??:

I need a function that I can pass a string and and x and y coordinates
to that will blit said string to the screen. Can anyone point me in the
right direction? Something like Graphics.drawstring in Java…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello,

check http://forum.gp2xtr.com/index.php?topic=789.0 forum in turkish.
But you can use the function easily.–
*Izzet Aykut KOCAK
Elektronik M?hendisi
*
**
*@Izzet_Aykut_KOCAK
aykut_kocak at yahoo.com
aykut_kocak at hotmail.com
*
www.abesis.net http://www.abesis.net
www.gprskamera.com http://www.gprskamera.com

seems to me the same few questions are always cropping up on this list… the
text on screen thing for example…

so i was thinking perhaps on the SDL doc wiki we should get a list of the most
asked questions and have a sort of rough guide to the basics of doing things
like text, your avaliable options, cheapest nastiest way, nicest way etc.

not that it would make much difference cos lass a**es like me will just come
here and as the it didnt work questions anyway.

But if people can come up with simple things that should be on a doc / faq sdl
set up / use wiki, i dont mind having a crack at creating the pages. (cough)

** ALSO ** - perhaps an addidon to the SDL -

SDL_DrawText( char text , int x , int y , SDL_Surface );

that uses a very basic 8x8 pixel alphabet, ( or pehaps 2 or 3 sizes and
an extra
option ) i’m sure this could be useful in some way. esp for on screen
debugging
and for these people that cant cope with not having a in display text
output…

i’m sure it’s also been discussed :wink:

anyway, i’m off to kill santa now, he drank all my coca-cola, corperate whore
that he is.

well, the text-on-screen is already in the faq (just use the SDL_ttf
library) but some specialised sample code would be nice…

can anyone edit the wiki (like wikipedia), or is this admin-only ?On 13 Nov 2007, at 16:23, neil at cloudsprinter.com wrote:

seems to me the same few questions are always cropping up on this
list… the
text on screen thing for example…

so i was thinking perhaps on the SDL doc wiki we should get a list
of the most
asked questions and have a sort of rough guide to the basics of
doing things
like text, your avaliable options, cheapest nastiest way, nicest way
etc.

not that it would make much difference cos lass a**es like me will
just come
here and as the it didnt work questions anyway.

But if people can come up with simple things that should be on a
doc / faq sdl
set up / use wiki, i dont mind having a crack at creating the pages.
(cough)

** ALSO ** - perhaps an addidon to the SDL -

SDL_DrawText( char text , int x , int y , SDL_Surface );

that uses a very basic 8x8 pixel alphabet, ( or pehaps 2 or 3 sizes
and
an extra
option ) i’m sure this could be useful in some way. esp for on screen
debugging
and for these people that cant cope with not having a in display text
output…

i’m sure it’s also been discussed :wink:

anyway, i’m off to kill santa now, he drank all my coca-cola,
corperate whore
that he is.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hey,

If you’re using C++, you can always try my NFont class at: http://pubpages.unh.edu/~jmb97
If you’re not into C++, it might still be worth it since Java is almost identical in syntax.

-Jonny D> From: michael at espersunited.com> To: sdl at lists.libsdl.org> Date: Tue, 13 Nov 2007 08:02:39 -0600> Subject: [SDL] Need a string-blitting function> > I need a function that I can pass a string and and x and y coordinates> to that will blit said string to the screen. Can anyone point me in the> right direction? Something like Graphics.drawstring in Java…> > _______________________________________________> SDL mailing list> SDL at lists.libsdl.org> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Boo!?Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

Hey,

If you’re using C++, you can always try my NFont class at: http://pubpages.unh.edu/~jmb97
If you’re not into C++, it might still be worth it since Java is almost identical in syntax.

-Jonny D> From: michael at espersunited.com> To: sdl at lists.libsdl.org> Date: Tue, 13 Nov 2007 08:02:39 -0600> Subject: [SDL] Need a string-blitting function> > I need a function that I can pass a string and and x and y coordinates> to that will blit said string to the screen. Can anyone point me in the> right direction? Something like Graphics.drawstring in Java…> > _______________________________________________> SDL mailing list> SDL at lists.libsdl.org> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Help yourself to FREE treats served up daily at the Messenger Caf?. Stop by today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

See the source of my game at http://spacerocks.sf.netOn Nov 14, 2007 1:02 AM, Michael Sullivan wrote:

I need a function that I can pass a string and and x and y coordinates
to that will blit said string to the screen. Can anyone point me in the
right direction? Something like Graphics.drawstring in Java…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Paul Holt