I honestly don't know how this function is called(and I'm sure it is a simple thing), neither how I can effectively search for it(I didn't find it when I googled it).
I have a set of string variables in Haxe called
public static var variable01:String;
public static var variable02:String;
public static var variable03:String;
public static function TextContent()
{
variable01 = new String("abc");
variable02 = new String("def");
variable03 = new String("ghi");
}
And a function that shows the text in the variable
_message = variable01;
_Dialogue = new FlxText(60, 400, 100, _message);
When the user clicks the screen, I want the variable in display change to the next one. Is there a way to simply change the number of the variable? I need to be able to change the text of the variable for another dialogue, because then there will be another set of variables with the same kind of pattern(text01, text02, text03, etc...)
When there is "a set of variables", it is nearly always a great use case of
Array
. To remember what is the current displaying variable, we need an additional integer variable (current
below) to store the array index.