Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Question regarding String2D  (Read 5367 times)

0 Members and 1 Guest are viewing this topic.

rpgmaker

  • Newbie
  • *
  • Posts: 38
    • View Profile
Question regarding String2D
« on: March 21, 2009, 12:16:34 pm »
Is it possible to draw an antialiased text and is it also possible to get the size of a specific character in a text?

Thanks

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Question regarding String2D
« Reply #1 on: March 21, 2009, 01:18:19 pm »
Text is always antialiased.

You can't directly get the size of a character, but you can get other things. What do you want to do?
Laurent Gomila - SFML developer

rpgmaker

  • Newbie
  • *
  • Posts: 38
    • View Profile
Question regarding String2D
« Reply #2 on: March 21, 2009, 05:33:34 pm »
I want to create something where i define a string variable with like two sentence in it. Then i want to loop through the character in the string and render each of them to the screen and when ever i get to a special limit of text that i want to render on a line, i increase the y position of the text drawing. The purpose of getting the character size in this is to be able to know where to draw each character without giving too much spacing between the render of the whole sentence.

For example:

var test = 'The quick brown fox jumps over the lazy dog'

I want to be able to render something like this
draw_text(test) =>

Code: [Select]
The quick brown fox jumps over
the lazy dog


Thanks