How to set to lines of text? (multiple problems)
Posted: Mon Oct 12, 2009 6:29 pm
I have two problems.
PROBLEM 1:
I want to change the text of my actor named: "Textbar_text"
in the script editor i am using this code:
(The variable "Textbar_text_counter_value" checks what text should be displayed.)
What I want is that this text is displayed over two lines.
So you get the following:
"Welcome to this game."
"I'll explain the rules for you now."
But with my current code, it just shows it in one long line.
This way, from "explain" and further, it is showed outside of the screen.
How can I set the text over two lines?
PROBLEM 2:
Problem 1 has not been solved yet!
I have added some code. After it displayed the text, it is supposed to check what key is pressed.
In my game it is the ENTER or the Return key.
now it comes with the following errors.
Error line 8: Unexpected declaration strcpy
Warning line 8: Trying convert from '* char' to '* char * char'
What did I do wrong here?
I just followed the documentation.
PROBLEM 1:
I want to change the text of my actor named: "Textbar_text"
in the script editor i am using this code:
- Code: Select all
if (Textbar_text_counter_value == 0)
{
strcpy (Textbar_text.text,"Welcome to this game. I'll explain the rules for you now.");
}
(The variable "Textbar_text_counter_value" checks what text should be displayed.)
What I want is that this text is displayed over two lines.
So you get the following:
"Welcome to this game."
"I'll explain the rules for you now."
But with my current code, it just shows it in one long line.
This way, from "explain" and further, it is showed outside of the screen.
How can I set the text over two lines?
PROBLEM 2:
Problem 1 has not been solved yet!
- Code: Select all
if (Textbar_text_counter_value == 0)
{
strcpy (Textbar_text.text,"Welcome to this game. I'll explain the rules for you now.");
char *key_state = GetKeyState(); //Get entire keyboard state
if(key_state[KEY_RETURN] == 1) //Test if right key is pressed
{
Textbar_text_counter_value = 2;
}
}
I have added some code. After it displayed the text, it is supposed to check what key is pressed.
In my game it is the ENTER or the Return key.
now it comes with the following errors.
Error line 8: Unexpected declaration strcpy
Warning line 8: Trying convert from '* char' to '* char * char'
What did I do wrong here?
I just followed the documentation.