So say I have an input box and a button.how do I get the text data from that element, whenever a button is pressed. I got a function to run when the button is pressed using .AddBuildUserInterfaceXmlAction and request.AddOnLayoutRebuiltAction and var button = IXmlLayoutController.XmlLayout.GetElementById("Button");
button.AddOnClickEvent(onClick);
I have tried grabbing the text attribute of the text element of the input box and passing it as a parameter, but it doesn't pass the text in the box unless I set it in the xml file. How can I get the updated text of that box whenever the button is pressed?
Hi I see you use Game.Instance for tons of stuff like you did here for ambient light attenuation, for this you used Game.Instance.Settings.Game.Flight.AmbientLightAttenuation I saw similar strings as options instead of sliders in game but, how would I find different ones like the ships altitude for instance? Is there a text file similar to StockUserInterfaceResourceManifest.txt for stuff like this? Or am I missing something?
edit: if you ignored it, please "update" to .net 4.7.1 framework, now at least I have auto fill in visual studio, nice to know something exists before you compile it :/
@NathanMikeska Thank you so much, the TMPro.TMP_Text.GetParsedText() method worked perfectly for me :)
4.9 years agoSo say I have an input box and a button.how do I get the text data from that element, whenever a button is pressed. I got a function to run when the button is pressed using .AddBuildUserInterfaceXmlAction and request.AddOnLayoutRebuiltAction and var button = IXmlLayoutController.XmlLayout.GetElementById("Button");
4.9 years agobutton.AddOnClickEvent(onClick);
I have tried grabbing the text attribute of the text element of the input box and passing it as a parameter, but it doesn't pass the text in the box unless I set it in the xml file. How can I get the updated text of that box whenever the button is pressed?
Hi I see you use Game.Instance for tons of stuff like you did here for ambient light attenuation, for this you used Game.Instance.Settings.Game.Flight.AmbientLightAttenuation I saw similar strings as options instead of sliders in game but, how would I find different ones like the ships altitude for instance? Is there a text file similar to StockUserInterfaceResourceManifest.txt for stuff like this? Or am I missing something?
edit: if you ignored it, please "update" to .net 4.7.1 framework, now at least I have auto fill in visual studio, nice to know something exists before you compile it :/
5.3 years ago