There was an error while loading. Please reload this page.
The textbox control allows viewers to input text to your game.
In Interactive Studio, you can add a new Textbox by selecting the Textbox control and adding it to your project:
In Unity, there is both a polling style API that can be called from your Update function as well as an event-based API.
If you want to get text input from your game's update loop, you can write the following code:
if (MixerInteractive.HasSubmissions("MyTextBox")) { var results = MixerInteractive.GetText("MyTextBox"); foreach (InteractiveTextResult result in results) { string userWhoGuessed = result.Participant.UserName; string guess = result.Text; } }
If you prefer you can also listen for text input through the OnInteractiveTextControl event.
MixerInteractive.OnInteractiveTextControlEvent += OnInteractiveTextControlEvent; private void OnInteractiveTextControlEvent(object sender, Microsoft.Mixer.InteractiveTextEventArgs e) { string viewName = e.Participant.UserName; string text = e.Text; }