Keeping numerals visible while typing decimal point...

Get help using Construct 2

Post » Fri Dec 11, 2015 8:13 am

A very simple example is here: http://1drv.ms/1QzRcvd

An educational game I have been developing little by little over several months suddenly started exhibiting problems, and I am perplexed as to why. I am using a Text box (form control, set to 'number' input) to accept keyboard input and then copying these numbers to a text object for displaying on screen. Everything displayed and behaved normally until recently.

The problem that I think popped up in the last few days is that the 'text' of the TextBox disappears when the number being entered ends with a "." (decimal point). For example, as the user would type in the decimal value "3.42" the text field disappears as the user enters the decimal point after the three. If I change the Properties/Type to "text" everything works fine, but I need it set to "number" because I want the number pad to pop up for the user, not the keyboard. It appears that C2 is suddenly having a hard time recognizing it as a 'number' when it ends in a "."

I appreciate any and all assistance and really hope to get back on track with my game. :) I apologize for wasting anyone's time if I am missing something obvious or overlooked a previous discussion on this matter. I am an educator, not a programmer, but C2 has really given me an exciting avenue to try to reach my students. I'm using this numerical entry for math-based problems in (what I hope is) a fun game for them.

I have the user enter text in the TextBox, which is seen on-screen every tick as it's displayed in a TextObject. When it comes time to evaluate the user's response I copy the number into a global variable which is used in various calculations and compared to a correct value to determine right/wrong.
B
6
S
2
Posts: 7
Reputation: 478

Post » Fri Dec 11, 2015 4:12 pm

There isn't a decimal point on number pads is there? So you should be fine in the end environment.
B
43
S
13
G
59
Posts: 1,779
Reputation: 35,731

Post » Fri Dec 11, 2015 10:16 pm

It seems Chrome returns an empty string for number inputs that end in a decimal point. I don't know what you can do about that. I don't think there is any way to force the numeric keyboard with a text input. You could use the telephone input but that's not ideal.
B
55
S
28
G
18
Posts: 1,520
Reputation: 25,305

Post » Sat Dec 12, 2015 2:43 am

Thank you both for your replies, Ramones, I really appreciate your expertise in knowing that about chrome, as I am still at such a beginning phase I wouldn't have even thought to address it at the "browser-level." Strange that it only started happening recently, as I have been using chrome for quite a while.
B
6
S
2
Posts: 7
Reputation: 478

Post » Sat Dec 12, 2015 6:30 pm

I see some other people mention the same issue and it looks like it only started in Chrome 47.
https://productforums.google.com/forum/ ... 7Zqe7-sLOY
https://productforums.google.com/forum/ ... UtAQoIF0Y8

Hopefully it's just a temporary issue that gets fixed soon.
B
55
S
28
G
18
Posts: 1,520
Reputation: 25,305


Return to How do I....?

Who is online

Users browsing this forum: justintime0185, oddreal, oosyrag, TRMG, twomonocles and 12 guests