How can I display only parts of a text attribute?
TheAJTurner
Member, PRO Posts: 18
Hello,
So I have a text attribute that would have say a name, and a number following it. For example "JohnSmith24"
Is there a way I can separate and display the "JohnSmith" and "24" parts in separate actors WITHOUT putting these in separate variables?
Comments
Actually I believe I figured this one out with the textSubString function
In separate actors without separate variables. Maybe. Does the character count of numbers (in your example it would be two numbers in that name: 2 and 4) always remain the same for each name? If so, you can use the character count function to find the overall character count of the name. Once this is done you'd know how many characters the name consists of because there would always be two numbers attached to the end of the name. You can then use the substring function to display a certain amount of characters in each actor.
Make sense?
Let me see if I can make a demo for you... back in a moment.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Try this. Uses the textSubString function and the textLength function.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Oops. Only saw this now. Anyway, hope the demo sheds some additional light.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx