string - How to add java typing text -
i'm trying add text effects game making text "type" here, maybe pseudocode make understandable.
string text = "but have particular set of skills, skills have acquired on long career."; char = characters(text) ///turn string list/array of letters = 0; //initializes while (i < text.length) { print(char.letter[i]) ///print 'i'th letter in list (starting 1) timeunit.milliseconds.sleep(100) //wait 1/10th of second i++; //repeat letters } p.s. comments triple slashes things don't know how do
simply use for-each loop on chars of input text:
string text = "..."; for(char c : text.tochararray()) { system.out.print(c); thread.sleep(100); } system.out.println();
Comments
Post a Comment