- Home /
iOS performance: GUItext? want to use text string, but how to instantiate and edit it runtime?
I want to create a simple application similar to basic app Notes. But i need many GUItext elements at the same time on screen. Because GUItext is very heavy on performance, i need to use a different way. I guess simple way is to use text strings, they don't affect performance. But: 1. Text strings cannot be instantiated. I guess i need to create an empty text string and duplicate it every time i am creating new text on screen? 2. The main question, how to edit every created text string at runtime?
Create a List of string? Then on tap or whatever action it adds a new value. public class NewString : $$anonymous$$onoBehaviour {
public List<string> newString = new List<string>();
void OnGUI(){
if (GUILayout.Button ("New string")) {
newString.Add (string.Empty);
}
for (int i = 0; i < newString.Count; i++) {
newString[i] = GUILayout.TextField(newString[i]);
}
}
}
will try it, but you forgot to mention that i need to add at the start :)
using System.Collections.Generic;
How i can make that text will appear where my mouse is at the moment? I was using before`
Vector3 mousePositionInWorldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition);`
But not sure how to do it with
newString.Add (string.Empty);
Your answer
Follow this Question
Related Questions
How do i take a string from a gui and show it in the gameworld c# 1 Answer
Problem with makeing text appear on screen 0 Answers
1 UI Text vs 2 UI Text 1 Answer
IF in a GUI 2 Answers
Detect Text in GUI; Print 1 Answer