How do I make minimum digits condition?

Just started using Construct 2? Post your questions here

Post » Wed Apr 15, 2015 10:47 pm

I have a text box where digits are required to be entered. A button uses the condition "On text changed" to be created. How do I create a condition for the button to appear only if at least 6 digits are entered in this text box?
B
8
S
2
Posts: 110
Reputation: 928

Post » Wed Apr 15, 2015 11:14 pm

Compare Two values

System: len(TextBox.Text) > 6 - do your actions
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,598
Reputation: 34,823

Post » Wed Apr 15, 2015 11:47 pm

works great. thank you!
now I am trying to enter a subevent saying -
if text is less than 6 set button invisible, but the button becomes invisible exactly after I eneter the first digit. How do I combine these two conditions?
B
8
S
2
Posts: 110
Reputation: 928

Post » Thu Apr 16, 2015 12:02 am

Image


Edit: Looks like dropbox have some issues currently so

Code: Select all
+ System: len(TextBox.Text) > 6
  + Trigger once   ->  Button: Set Visible

+ Else
+ Trigger once     ->  Button: Set Invisible
Last edited by shinkan on Thu Apr 16, 2015 12:29 am, edited 2 times in total.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,598
Reputation: 34,823

Post » Thu Apr 16, 2015 12:20 am

this looks and works soooo nice!
thank you!
now I know even more about c2
B
8
S
2
Posts: 110
Reputation: 928


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest