License from €75
DE EN FR ES IT CZ

[SOLVED] Change position of text

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 14 years ago
    hi,

    is ist possible to change the character display text position (similar to action part "display speaker text")?
    right now it always appears at the top of the characters graphic.

    thanks for any answer!

    best

    raul
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.

    Get 15 % off Try it for free
  3. · 14 years ago
    Hi Raul,

    yes. wink
    Try something with the setTextPosition hook:
    http://wiki.visionaire-tracker.net/wiki/RegisterHookFunction

    Alex has made an example here:
    http://www.visionaire-studio.net/forum/thread/character3939s...

    David
  4. · 14 years ago
    Awesome!!
    thx dude!
  5. · 14 years ago
    ok, there is a another little thing.
    its working fine for one character if i use the "Hero" script mentioned in the thread by alex.
    is it also possible to do it for another character (in the same script)?

    i never scripted before, sorry for the stupid question wink

    thx for any answer!
  6. · 14 years ago
    okay got it !

    thank you!
  7. · 14 years ago
    cheers for the second link David wink

    I never got around to providing an example for the registerHookFunction in the new wiki for the exclusive VS player commands.

    now I've got an example I can base it on.
  8. · 14 years ago
    is there a possibility to change the align as well?
    i've looked in the lua docu but couldn't find anything.
    thx
  9. · 14 years ago
    GameSpeakerTextAlignment - t_int:

    Defines alignment of speaker text:
    '0' (eAlignLeft): Align left.
    '1' (eAlignRight): Align right.
    '2' (eAlignCentered): Centered.
    '3' (eAlignLeftWithCenterPos): Align left (use center position).
    '4' (eAlignRightWithCenterPos): Align right (use center position).
    '5' (eAlignCenteredWithLeftPos): Centered (use left position).
    game:setValue(VGameSpeakerTextAlignment, integer value)
    


    GameTextAlignment - t_int:

    Defines alignment of spoken text:
    '0' (eAlignLeft): Align left.
    '1' (eAlignRight): Align right.
    '2' (eAlignCentered): Centered.
    '3' (eAlignLeftWithCenterPos): Align left (use center position).
    '4' (eAlignRightWithCenterPos): Align right (use center position).
    '5' (eAlignCenteredWithLeftPos): Centered (use left position).
    game:setValue(VGameTextAlignment, integer value)
    


    you can change these values in the game options setup tab also!
  10. · 14 years ago
    hi
    thank you. havent seen because i looked under "text".

    the option VGameTextAlignment does something with my text but not what i want whatever value im choosing.

    this is my code
    registerHookFunction('setTextPosition', 'setTextPosHook')
    
    function setTextPosHook(text, game)
      local owner = text:getLink(VTextOwner)
      if owner:getId().tableId == eCharacters and owner:getName() == 'Charakter1' then
        local pos1 = {x=50, y=80}
        text:setValue(VTextPosition, pos1)
    return true
    end
      if owner:getId().tableId == eCharacters and owner:getName() == 'Charakter2' then
        local pos2 = {x=500, y=80}
        text:setValue(VTextPosition, pos2)
    return true
    end
      if owner:getId().tableId == eCharacters and owner:getName() == 'Charakter3' then
        local pos3 = {x=400, y=600}
        text:setValue(VTextPosition, pos3)
       [b]game:setValue(VGameTextAlignment, 1)[/b]
    return true
     
    end
    end
    


    maybe you could help.

    im new with lua, sorry

    thanks for your help!
  11. · 14 years ago
    what's up with the bbcode tags on line 18?

    you could simplify this script a lot more than this...

    is the text being displayed above the characters heads or is it being placed somewhere else on screen?
    what is happening when you use "VGameTextAlignment"?
    & why have you added "game" to the function variable after text?

    before I write up a script, can you please give me some details on exactly what you are wanting to do...
    are you planning on using this script for every character in the game?
    do you want the text to be displayed above the characters head or manually positioned somewhere on the screen; in a box/image of some kind?

    this could determine if you could use a more global script to achieve what you want to do or if it would be better to use tables or create multiple if elseif queries etc.
  12. · 14 years ago
    There is a much MUCH easier way. Just create an "empty" character. Create an object and set it where you want the text to appear (empty object). Set that newly created character to have the starting point of the new object you just created.

    Then just have the empty character talk when ever you want the text to be in another location.
    Thats how I do it 100's of times

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?