How to animate text to appear word by word for iphone application?

I want to make a tutorial page with a main character that gives speech bubbles. Suppose I use UILabel / UITextView to contain these speeches, how can I animate text to appear word by word, like what we see in the rpg lesson scene?

Thank.

+3
source share
2 answers

Go to the text you are planning and divide it into an array, so that each element of the array will be a block of text that you want your character to say.

(For example, element 0 may be @ "Hello, welcome tutorial!", Element 1 may be @ "The purpose of this game ...", etc.)

UIButton , "", .

, /Xcode, , , , .

( "" ), nib.

IBAction :

-(IBAction) continueTutorial{
    i ++; //Here i is an NSInteger from your .h file, set it to 0 when the tutorial starts
    YourUILabel.text = [yourArray objectAtIndex: i];
}

, !

+2

(n- ..) , , . NSTimer. , , ( nth-1) . (re) .

+1

Source: https://habr.com/ru/post/1792055/


All Articles