How do I set text on layout2

Just started using Construct 2? Post your questions here

Post » Mon Jul 27, 2015 6:59 pm

i try to learn from tutorial. my problem is can not crate name on layout2 .
what wrong of my game

this is my game
---------------------------------------------------------------------------------------------------------------------------------
Layout1 Event
-----------------------------------------------------------------------------------------------------------------------------------
Global text nameOfPlayer=""
Global text MyVar=""
--------------------------------
1 System On start of layout /action/ Textbox/Set text to MyVar
Text/Set text to MyVar
2 System Every tick /action/ Text Set text to Textbox.Text
3 Touch On tap gesture on bottom1 /action/ System Set nameOfPlayer to Text.Text
Text2 Set text to"Hello"&nameOfPlayer&"

4 Touch On tap gesture on bottom2 /action/ System Go to Layout2
--------------------------------------------------------------------------------------------------------------------------------------------------
Layout2 Event
-------------------------------------------------------------------------------------------------------------------------------------------------
Include :Layout1 Event

1 System On start of layout /action/ Text/Set text to " "&myvar&"&nameofplayer&"

---------------------------------------------------------------------------------------------------------------------------------------------------
thankyou anyone :)
B
7
Posts: 23
Reputation: 315

Post » Tue Jul 28, 2015 1:13 am

Can you post the capx so we can take a look at it?
B
9
S
2
Posts: 50
Reputation: 700

Post » Tue Jul 28, 2015 4:06 am

Sorry beginner's cant post link. :(
B
7
Posts: 23
Reputation: 315

Post » Tue Jul 28, 2015 10:39 am

Just post it without www. So it doesnt show as a link.
B
9
S
2
Posts: 50
Reputation: 700

Post » Tue Jul 28, 2015 2:13 pm

thank @vendara this is my game
Last edited by nitawat on Wed Jul 29, 2015 3:11 am, edited 1 time in total.
B
7
Posts: 23
Reputation: 315

Post » Tue Jul 28, 2015 7:20 pm

I'm sorry, you use some Plugins I don't use.
So i can't open your game.
B
9
S
2
Posts: 50
Reputation: 700

Post » Wed Jul 29, 2015 3:15 am

Sorry that’s my fault. this is new capx with out plugsins.

;)
Last edited by nitawat on Thu Jul 30, 2015 6:25 am, edited 1 time in total.
B
7
Posts: 23
Reputation: 315

Post » Thu Jul 30, 2015 5:49 am

you need to remove the extra quotes and & you have around your text strings

wrong:set text.text= "&myvar&"&nameofplayer&"
right:set text.text= myvar&nameofplayer
B
90
S
44
G
17
Posts: 1,012
Reputation: 18,527

Post » Thu Jul 30, 2015 6:24 am

thankyou @vendara @justifun

i got it! . now the name can show on layer2. But it have number in front of name (1nameofplayer) how i fix it.
Last edited by nitawat on Thu Jul 30, 2015 8:39 am, edited 1 time in total.
B
7
Posts: 23
Reputation: 315

Post » Thu Jul 30, 2015 6:33 am

the MyVar& is your number variable that you are combining with the "name of player"

so simply make it.
set text . text = nameofplayer
B
90
S
44
G
17
Posts: 1,012
Reputation: 18,527

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests