How to make text subtitle like this one:
Cocos2d has this feauture?
If someone can show me how to make the message come line by line. what effect should i use?
A fast, easy to use, free, and community supported 2D game engine
How to make text subtitle like this one:
Cocos2d has this feauture?
If someone can show me how to make the message come line by line. what effect should i use?
Bump!!
yeah if somebody could also show me how to do this thing, i will appreciated!. Thanks
Well... to make the subtitles appear line by line you could have that much labels, let's say 3 of them.
So, basically what i would do is:
call an action on the first one, a fadeIN would be nice, do that in a sequence, so you do fadeIn ---> callfuncND. in callfuncND, call a sequence with fadeIn and callFuncND and do the same for each label you want to appear.
In the last one you should reset this so every line dissapears and you can repeat this process...
The best way would be to create a class, where you can pass it the maximun lines at a given time and the content of those lines.
ok one question: How do i update the label in runTime?
for example i create a label
Label *label1 = [Label labelWithString:@"Demo & Testing" fontName:@"Marker Felt" fontSize:30];
[self addChild:label1 z:4];
[label1 setPosition:ccp(100,200)];
How do I assign new label text in runtime in the same object (label1)?
You can use the setString method. But if you're going to update rapidly the label in runtime, you might want to use LabelAtlas or BitmapFontAtlas instead of Label (because Label has to create a new texture in memory every time you change its string, and it's kind of costly).
You can't change label text at runtime... cocos labels don't have a text property (too bad)...
What I would do is delete the old label, and create a new one instead...
I wrote such a long post to this topic, but the stupid bb-post action didn't work at the time, and everything got erased.
I'm not too familiar with other label, except for Label... so I guess there are other label types that have the option...
I'm not too familiar with LabelAtlas either...
I was only referencing the standard cocos Label
~ Natan Avra.
Label also supports setString.
I would definitely make a subtitle class that handles everything in terms of animating on screen, disappearing and everything. It should be as simple as feeding the subtitle object a string and it'd output the subtitle.
Hmm maybe when I have time I'll make a subtitle class for everyone to use...it'd be my first contribution to this community :)
@Riq That's new, you added it since 0.8.1??
'Cause 0.8 doesn't have a text/string property, or am I blind?!
nope, I think setString was part of Label from the very beginning.
but string is not a property. setString is an instance method.
Couldn't really find it, I tried using the auto complete to check every possibility, nothing...
I must be blind or something...
Hi If somebody could tell me how to do the line by line effect of the text dialog? Example text showing up like what im typing right here..
Anyone? If I use Layer Effect on the label. IT will effect the entire layer not only the label like FlipX3D. I'm looking at effect for the text CHARACTER come out one by one for the game dialog. anyone here know?
By the way I forgot to say thanks to the people above because provide me information about setString. THANKS!
<deleted, sorry didn't read the first post>
related: riq, just curious about why there's no string getter method for all of the labels? I assume it's not a property so people know it's a fairly heavy call?
Hi everyone, I also having a problem in my game when i come to develop the subtitle for the game scene. I used label, and everytime i call a new label, i delete the old one, but it does not seems to be very efficient, it overlap each other sometimes for a bit of seconds. I heard about AtlasLabel. But if so, i have to create images that store the text right? seems troublesome too. Or anyone has an example could show me pleasE?
I really appreciate
It is not difficult, check the tests, there you can see how LabelAtlas and BitmapFontAtlas are used. You won't want to create and delete them, instead if you are going to show 3 lines of text you can do that with 3 or 4 label atlas, just write in one, move the one that should go out of the textbox down in queue to be shown next.
You must log in to post.