How to get the text width and height of a 2D Text Node on screen?

(3 posts) (2 voices)
  • Started 9 months ago by alonezhby
  • Latest reply from alonezhby

Tags:

No tags yet.

  1. alonezhby

    enthusiast
    Joined: Mar '09
    Posts: 78

    Hi,

    my goal is to set the 2D Text Node 's size according to the text width and height automatically, just like the right of the attached image.

    How to achieve this?
    .

    Attachments

    1. HowToGetTextWidth.png (9.9 KB, 12 downloads) 9 months old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 9 months ago #
  2. NKL_DS

    3DVIA Studio Guru
    Joined: Jan '10
    Posts: 38

    Hello Alonezhby,
    If you set a VSL task with the line:
    my2D.SetSize(my2D.GetTextEndCoords());
    the vkText2D should be resized correctly.

    Posted 9 months ago #
  3. alonezhby

    enthusiast
    Joined: Mar '09
    Posts: 78

    Hi,
    Thank you.

    Seems this method only works on vkText2D and only is useful when the text only has one line.

    But the vkNLSText2D does not work.

    Posted 9 months ago #

Reply

You must log in to post.