Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

World Space Text Rendering on the Canvas

Discussion in 'UGUI & TextMesh Pro' started by bloomingdedalus, Jun 5, 2015.

  1. bloomingdedalus

    bloomingdedalus

    Joined:
    Aug 13, 2012
    Posts:
    139
    I'm getting strange behavior from the text objects I create at runtime on my worldspace canvas. I am using the "CanvasScaler" object and it seems to negate the font size to some point and I'm not really sure why that's happening or what it's about...

    I'm like so close to being done with this control but then I went to try it in world space (I should have written it in world space) and I'm getting all sorts of weird problems. Font size no longer seems to have an effect unless it's like size 10 or below and I'm getting these nasty artifacts on the text rendering.

    Any idea how to make this look pretty and still make it behave like it does in overlay space?

     
  2. bloomingdedalus

    bloomingdedalus

    Joined:
    Aug 13, 2012
    Posts:
    139
    Sorry for the complaint... I figured out what I was doing wrong. I had missized the height of the text fields I was creating and so I thought that putting it on a world canvas was causing a change in the text size when in fact I had somehow reverted the height of the "Text" controls being instantiated.

    The problem is setting "Dynamic Pixels Per Unit" higher than 1... Changing that was the only thing making my text show up without me realizing that my "Text" controls were being created too small for their font size.
     
  3. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,683
    You have to remember that the test system is still the old legacy text system, so you have to account for it's limitations.
    To make the best use of it, use large canvas/rect transforms with large text font sizes and then scale it down to meet your needs.

    Alternatively use on of the replacement text systems on the asset store, such as TextMeshPro.

    Also remember that in the new UI system, each letter is a quad, which if you have large amounts of text can cause performance drawing issues.