- Home /
Text to image
Hello, i'm asked to make a module that takes a string, and adds it on an image, like captions. The goal here is to put text on different images of a gallery depending on the author or language chosen by the user. Does unity have a method/function to do this?
Thank you for the suggestion, i will try to use it for what was of me. But you should put your advice as an aswer so i can select is as a correct answer.
Answer by asafsitner · Dec 20, 2011 at 05:21 PM
While you can certainly access the pixel array of an image, I believe it would be far easier to implement with a Text Mesh object:
http://unity3d.com/support/documentation/Components/class-TextMesh.html
Answer by jahroy · Dec 20, 2011 at 05:17 PM
Personally, I would approach this by using Unity's GUI system.
I would draw a label with text either below, next to, or on top of the texture.
http://unity3d.com/support/documentation/ScriptReference/GUI.Label.html
If you really have to create a texture from your text, that's a different story.
I already thought about that but the reason they ask me for an image is so that it could be placed on the walls beside the images. So when someone is strolling around the gallery the image should be in 3D, and GUI.Label is 2D. So i think the Text$$anonymous$$esh suggested by asafsitner is a better option.
Your answer
Follow this Question
Related Questions
Print char to a 2D image? 1 Answer
Why isn't the text preferred size calculating correctly? 0 Answers
Instantiated UI objects with image components not appearing, rest of object works fine. 0 Answers
Some questions regarding card game 2 Answers
Can I add text and image in a content like a document? 1 Answer