So, here's how you would make a typewrite effect.
I'm not giving you the whole code, I more likely tell you how to write one
You'll need these global variables:
- Code: Select all
int counter;
char temp[256], type[256];
Then, in global code, create a void function, name it like typewrite or something and give one parameter, char input[256].
Then, inside the function create integer i.
Do a for loop from 0 to 256 and reset all the cells of 'temp' and 'type'.
Like this:
- Code: Select all
temp[i] = NULL;
And after the for loop set counter to 0 and use strcpy to copy input to temp.
Here's all you need in global code.
Then, go to your text actors draw actor code and make an if condition and check if counter < strlen(temp).
Inside that condition set type[counter] equal to temp[counter] (that's how you copy single characters!)
And then write counter ++;
After that you'll need to add a sprintf() call to display 'type' on the actors text.
Now you can use your typewrite() function to make it typewrite something.
For example: view - create actor:
- Code: Select all
typewrite("Hello! This works! :DD");
And if you wanted to skip the effect, you'd just write use strcpy() to copy temp to type and then set counter equal to strlen(temp).
Ask if there is something you don't understand!