--JPEditText API JPEditText.activate ( sUserToken, sActivationKey ) JPEditText.setEditTextPlaceholder ( hComponent, sPlaceholderTextOrNil, nOptRed, nOptGreen, nOptBlue, nOptAlpha ) JPEditText.setReturnKeyEnabled ( bEnabled ) JPEditText.updatePlaceholder ( hComponent )
JPEditText allows you to add new features to the ShiVa's Edit Texts
The first feature is the possibility to set a placeholder to a HUD Edit Text. When the component is empty, you will be able to set a default text with a specific color. For instance, if you have a search bar, if there's nothing entered yet, JPEditText allow you for instance to display "Search..." in grey until the user enters his search keywords. As soon as the user enters text, the placeholder will disappear and the user's text will show up in the right color. If he deletes the text, the grey "Search..." text will be displayed again. It's really an amazing feature.
Another great feature is is the keyboard keys repeat when a text is added to the component. By default, if you press a key, even if you hold it only one character will be written. With JPEditText, the character will be repeated until the key is released.
This feature also works when moving the edit cursor position with the keyboard arrows and when deleting text with both Del. and BackSpace keyboard keys.
JPEditText also grants the possibility to paste text using the Ctrl+V shortcut and undo using Ctrl+Z.
Some keys doesn't work at all with default Edits behaviour, like the math symbols of the numpad (/ * - +). With JPEditText, they are taken into account!
Finally, JPEditText handles the Return key to add a new line in the text.
In short JPEditText modify the default archaic behaviour of the ShiVa's Edit Texts to obtain smart components by giving them multiple behaviours that are present in most of the text editors.
The usage of JPEditText is very simple, load it in your game, activate it, and... you are done, nothing else to do, JPEditText is completely autonomous!
Note : As this pack is based on the keyboard events, consider buying this pack only if your game will be published on a device using a keyboard that triggers the onKeyboardKeyDown/Up events. For instance, it won't work with the iOS native keyboard which does not triggers those events. It will work for the Android native keyboard (that you can add in your game by using plugins like jpVirtualKeyboard) as it sends the keyboard event.
About Android, JPEditText offers to fix a bug with android applications, that does not allow to delete letters with the native android keyboard backspace key. By using JPEditText, this bug will be gone.