Search Unity

How-To Text to Textures?

Discussion in 'General Graphics' started by roxenhall, May 9, 2018.

  1. roxenhall

    roxenhall

    Joined:
    May 9, 2018
    Posts:
    5
    Hi!
    How can I take my value (text-string) from C#-scripts and put this on my Material (with Textures)?
    I found what I need (link below), but I cant get it to work! (I'm new in this)
    http://blog.almostlogical.com/2010/...time-in-unity3d-without-using-render-texture/
    I read on commets that dosent work in Unity ver 5? Is that correct? I have ver 5.61f1
    Or are there another solutions?

    Thank´s for your time and helping me!

    Micael Roxenhall.
     
  2. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    423
    Seems like author on the link uses some kind of experimental solution. If it does not works for you, you are always can use "Render texture" approach.

    The idea is to create a 3D text using text mesh
    https://docs.unity3d.com/Manual/class-TextMesh.html

    Point a camera at this text and render this camera to render texture
    https://www.assetstore.unity3d.com/en/#!/content/13153

    After that you can save this texture in file.
    https://docs.unity3d.com/550/Documentation/ScriptReference/Texture2D.EncodeToPNG.html