Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Edit Box

pittie
Registered User
Quote
2015-09-12 15:34:22

Hello,

I wish that the Player is able to enter an decimal number like 234.23 into the editbox.
But it seems that "." "," "+" "-" doesn't work. I need no math, but only as letters.
Any tips?

Thanks


erik
Registered User
Quote
2015-09-12 17:54:25

Which edit box?


pittie
Registered User
Quote
2015-09-12 19:36:14

Edit box 2d overlay (behaviors script)


techno-valley
Registered User
Quote
2015-09-13 12:45:14

You can use the following code inside the script instead of the existing


if (key == 8)
{
// backspace
this.Text = this.Text.substring(0, this.Text.length - 1);
}
else // let you detect the numbers from 0 to 9 on top of keyboard
if (key >= 48 && key <= 57)
{
this.Text += String.fromCharCode(key);
}
else // let you detect the . (decimal sign)
if (key == 190)
{
this.Text += '\.';
}


This will allow you to use the normal numbers keys in case you need to use numeric pad key you will have to add key codes from 96 to 111


Note that you will have to use \ sign for special characters to appears correctly in the 2D overlay.

EDIT: you can use a Boolean value for example in order to let you enter only 1 dot (in case you are for example simulating a calculator)


pittie
Registered User
Quote
2015-09-13 15:34:08

Hello :-)

Thank you very much.

Is it possible to post the full script for me, because if I try to copy this part into the script, I get always errors.

Sorry, I'm no programmer :-(


niko
Moderator
Quote
2015-09-13 20:42:43

Just search for the line

if (this.LastOverlayObject != null)


and paste that above that line.


pittie
Registered User
Quote
2015-09-14 08:25:09

Thank you, works :-)


ajay
Registered User
Quote
2016-12-29 14:05:53

how to player enter manually value,number,passwords etc. in 2d overlay after pubishing game....pleaz pleaz help me.


techno-valley
Registered User
Quote
2016-12-29 14:48:21

Hello ajay,

Goto this page

http://www.ambiera.com/coppercub...

Then search for Edit Box and use this script to fulfill your needs


ajay
Registered User
Quote
2016-12-29 18:37:25

Thanks... techno valley.


ajay
Registered User
Quote
2016-12-29 18:44:07

Thank you very much... valley working :-)


ajay
Registered User
Quote
2016-12-29 19:20:14

hiii
Thanks but when i published for android app .apk and when install and play app can't get keypad for enter words...pleaz help me pleaz


ajay
Registered User
Quote
2016-12-29 19:20:50




techno-valley
Registered User
Quote
2016-12-30 09:03:06

Hello Ajay,

I don't remember if I've used this plugin for Android or not.

I will test it this week end and let your know


techno-valley
Registered User
Quote
2017-01-01 22:29:05

Hello Ajay,

I don't think the Edit 2D Box is working on Android.

I've tested and it wasn't working.

May be Niko or someone can confirm.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact