Problem with the position of the replica text [SOLVED]

  • #1, z red363Tuesday, 04. January 2022, 19:26 hodinky 2 years ago
    Hello everyone!

    I use a script that forces the text of the replicas to be strictly in certain coordinates. Faced a problem in a scene that exceeds the size of the exposed resolution. Those. during scrolling, when the character moves to the back of the scene, all his lines are left somewhere behind (since they are tied to certain coordinates).

    Please tell me if there is any solution to this problem?
    Thanks!

    Fanoušek fóra

    101 Posts


  • #2, z esmeraldaTuesday, 04. January 2022, 23:45 hodinky 2 years ago
    I don't know what your script looks like, but I guess you need to add the scroll position.

    In the line where you set the position add: + game.ScrollPostion.x  and if the game is scrolling vertically too, the same with .y

    like this for example:
    text.Position = {x = game.ScrollPosition.x + (game.WindowResolution.x /2), y = game.ScrollPosition.y + 100}

    Zabiják klíčů

    525 Posts

  • #3, z red363Wednesday, 05. January 2022, 03:17 hodinky 2 years ago
    I don't know what your script looks like, but I guess you need to add the scroll position.

    In the line where you set the position add: + game.ScrollPostion.x  and if the game is scrolling vertically too, the same with .y

    like this for example:
    text.Position = {x = game.ScrollPosition.x + (game.WindowResolution.x /2), y = game.ScrollPosition.y + 100}
    Thank you very much, esmeralda! It works.

    Fanoušek fóra

    101 Posts