How to change text dynamic

edited May 2010 in Help request
I have known how to display a text.But how can I change it dynamic?Because it is a object too, I can replace it, But I don't know how to change it's text, Is there a way?

Or the better way to create a text is use OrxText module instead of orxObject ?


  • edited May 2010
    IIRC, there's a function called orxObject_SetTextString you can use. It takes the object and a orxSTRING/orxCHAR*.
  • edited June 2010
    Ekerik's totally right.
    Also if you use the locale module for localization, whenever you select a new language, all the text objects will be updated automatically (cf. tutorial #10).

    EDIT: Wrong tutorial number, fixed now.
  • edited June 2010
    You have said some things about user-defined font.
    Will it be easy to display chinese with that?
  • edited June 2010
    Well, right now it isn't as there's a max of 255 characters (ASCII) but it's funny as I was thinking about this problem over the past few days and I'll try to support UTF-8 before next week if things work well.
    This way you'll be able to display chinese text with a user custom font (not with the default one as it's a plain ASCII non-accented one, couldn't find a better open source font so far).

    I'll let you know when the UTF-8 support will be ready.
  • edited June 2010
    Think about freetype?

    I didn't know how to use a custom font now,and there is not a tutorial.
  • edited June 2010
    jtianling wrote:
    Think about freetype?

    FreeType would help creating glyphs out of font files, not helping me to support unicode string internally in orx's text module.
    But UTF-8 support is very easy, I'll give it a try over the week end.
    I didn't know how to use a custom font now,and there is not a tutorial.

    It's a new feature of orx 1.2, hence not documented yet. I'll update the tutorial #10 before the release.

    If you could also find me a nice open source/free font with chinese character support in bitmap format (I can make a bitmap out of a font file, anyway, it's just an extra step for me), I'd use it in the tutorial.
    Also, if you could provide me with a chinese translation of "This is Orx's logo", that'd be nice. =)
  • edited June 2010
    There's surely a free chinese font.It's english web site:
    Web in sourceforge:

    It's used in a lot of Linux with Chinese.

    I'm glad that I can help.

    The Chinese translation of "This is Orx's logo" is "这是Orx的标志"

    And "这是Orx的Logo" could be acceptable too,because we use "logo" in china frequently.

    By the way, did orx have a chinese name?
    OGRE is "鬼怪“
    Irrlicht is "鬼火”
    But I don't know what "orx" means.
  • edited June 2010
    Thanks for the links and the translation!

    As for the meaning of orx, it's named after a swamp near my birth place, so it doesn't have a special meaning, I just happen to like the name. =)
Sign In or Register to comment.