Limit characters

Get help using Construct 2

Post » Mon Jul 22, 2013 3:02 pm

Hello everybody.
I want to know how I do to limita a text??

I create a Virtual Keyboard and when I click in one number, the number appears in the box (the box is a Text, not a textbox), but if I click in 7 numbers, the numbers desappears.

How I limit the characters ( the numbers in my game isn't a numbers couse I use "." ) in my game, and how I limit the point (".") in the text??



thanks so much.
B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Mon Jul 22, 2013 3:59 pm

@pablolink23 Do you mean something like this. CapX

Edit: Small updateKatala2013-07-22 16:04:44
B
34
S
9
G
3
Posts: 517
Reputation: 5,206

Post » Mon Jul 22, 2013 4:06 pm

Give me your e-mail!!!!
B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Mon Jul 22, 2013 4:29 pm

Yes Katala, but, I don't use Buttons, mu vitual Keyboar is with sprites...
but your exemple is very good!!

How I do with sprites???

thanks!

B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Mon Jul 22, 2013 4:42 pm

@pablolink23 Use mouse object:On object clicked

And I could recommend some basic tutorials
B
34
S
9
G
3
Posts: 517
Reputation: 5,206

Post » Mon Jul 22, 2013 8:43 pm

I understanding your exemple!
But, if you want to clear the numbers end put other?
What I do?
B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Mon Jul 22, 2013 9:08 pm

@pablolink23 On object clicked ->
Text: Set text ""
Text: Set Character_count to 0
B
34
S
9
G
3
Posts: 517
Reputation: 5,206

Post » Tue Jul 23, 2013 3:57 pm

Well, I want to set price and edit tris price!!!
in a Text (isn't a textbox)

I create a button that clear the last number, but when I clear, I can't edit the text...

B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Tue Jul 23, 2013 4:26 pm

When you use Len(text) you can't edit the text!!!
B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Tue Jul 23, 2013 4:53 pm

I added a sprite to the example made by @Katala

with clear button

Push the pink aquare to clear the text. Easy right?
Have a look at the 1 event I added for that effect.

Learn how to work with C2 and you won't have to ask for everything.
Have you seen the green button on top of this page that says tutorials?
It works!
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: Darknessed, FabianB, shubhamrathi9 and 12 guests