- Home /
Write in button
Is it possible to make a button "writable"? I have a UI Button in a scene and i wanted to write on it when i am on play mode. Is it possible? If so, how do i do that?
Answer by Jessespike · Oct 26, 2016 at 09:23 PM
Are you asking how to change a button's text with input?
Create a Button and an InputField, hide the InputField by moving it offscreen.
In the Button's OnClick() events, drag in the InputField.Select() function.
In the InputField's OnValueChanged() events, drag in the Button's Text (child object) and select the Text.text property.
If you are asking how to edit properties and keep the changes when playmode is done, then I'm not sure.
Answer by SkandYxyz · Oct 26, 2016 at 09:15 PM
As far as I know it is not possible, because a button returns true if it is was clicked and no string. Usually you take a text field for text input. You can only use what Unity provides, use a third party solution or write your own writable button class.
Best, Amdre
Your answer
Follow this Question
Related Questions
Canvas Button persistence 0 Answers
[4.6 - UI] Change text on button click via script 1 Answer
Destory button on click and other problem 0 Answers
Find GUI Button and Assign Text 1 Answer
UI Scaling with Button Text 1 Answer