Problems with showing text in my layouts

Just started using Construct 2? Post your questions here

Post » Sat Feb 28, 2015 2:48 pm

Hi All!

I am new to C2 and I ran into a problem while learning things:

I have three different layouts representing three planets in a far (far!) away galaxy... :D

On game-start I show the layout of planet 1.
There is an introductory text ("Welcome, etc") and two buttons leading to the other two planets.
(Note: Clicking on the buttons represents kind of 'travelling' to the other planets.)

Now, I click on e.g. the button for Planet 2 which takes me to the layout of that planet.
Here are also two buttons to the other planets (1 and 3), etc.
Now, and here comes the problem...

When I click back on button 1 to return to Planet 1, I see the introduction text again, but I only want to show that once. (The first time you visit that planet.)

What do I have to do to show the intro text only the FIRST time that I visit planet 1?
And while we are at it; how do I show multiple lines of text after eachother? I only am able to show the last line with the code I came up with. This is what I have in the Event Sheet of Planet 1 right now:


System->On start of layout -> T/Storytext -> set Visible
Mouse-> On left button Clicked -> T/StoryText -> Set text to "Welcome to the Green Planet."
Mouse-> On left button Clicked -> T/StoryText -> Set text to "To win this tutorial you blabla.."
Mouse-> On Left button Clicked on Button1 -> System -> Go to Planet 2

Thank you so much and enjoy the weekend!

Rizzo
B
6
Posts: 15
Reputation: 280

Post » Sat Feb 28, 2015 3:21 pm

Create a global variable:
When left btn clicked and Global Variable = 0 then show text "Welcome".
When left btn clicked and Global Variable = 1 then show text "", or make text invisible or move it outside the layout.

For making several lines of text, make the text field larger. If all text is on the same row, it will split auto on word.
You can also make linebreaks Ex. "This is on first line" &newline &"This is on 2nd line"
Frosty Elk AB
www.frostyelk.se
Have no fear, We come in peace!
B
13
S
3
G
1
Posts: 106
Reputation: 1,169

Post » Sat Feb 28, 2015 5:01 pm

Thank you for your reply Frosty elk! So, by using global variables the 'welcome'message won't appaear again the next time I visit the layout?

Good to know, I'll look into that next!
B
6
Posts: 15
Reputation: 280


Return to Beginner's Questions

Who is online

Users browsing this forum: danispag and 0 guests