0 Favourites

check global text

  • i have a global text called name that is set to "nul" when the player enters their name in a TextBox the global text is set to what the player typed. Next to the TextBox i have a button. what i want to achieve is when the button is pressed the player goes to the next layout, but if they have not entered their name a message pops up telling the player to enter their name.

    I know how to do everything apart from how do I compare the values of the value of the global text, eg. if name="nul" and name<>"nul" I have tried useing the system option to compare values, but cant figure out to use it to compare values of a global text, I have tried name.text and text.name etc but nothing seems to work

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • first of all - set type of global variable 'Name' to Text, by default it's a Number (just in case :)) then on event Button on click you should make 2 subevents - textbox is empty or it's not. if empty - show message, if not - set textbox.text to global 'Name' and go to 2nd layout. hope it will help!

  • Thanks, works great. I think I wa trying to make it more complicated than it actually is.   <img src="smileys/smiley36.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[Plugin] tag text
188 25,457
RBuster's avatar
RBuster
Unread hot topic
118 32,907
rexrainbow's avatar
rexrainbow
Unread hot topic
102 6,404
Ashley's avatar
Ashley Construct Team Founder