Forum rules - please read before posting.

Any way to allow spaces and punctuation in input element type?

Hi Chris,

I am trying to make a notepad app in my game and would like to let players type and save notes. I have got it working by saving variables in Input elements in menus. The problem is that the only 'input type's are Alpha Numeric and Numeric Only. Are there any ways players can type and save messages that include spaces and punctuation?

Comments

  • Which version are you using?  The current release has a third Allow Special Characters option.

    It's also the case that the Input type field is only available for Menus rendered with Adventure Creator.  If you switch to Unity UI, the constraints of what can be entered is set within Unity's InputField component.
  • I'm using version 1.52a, so pretty old.

    That's cool, any chance you know what scripts need importing for that feature (or the instance to search for)?  
    Sorry most of my problems now are old news.
  • Backing up first, try importing /AdventureCreator/Scripts/Menu/Menu classes/MenuInput.cs from the latest release and updating the AC_InputType enum in Enums.cs to:

    public enum AC_InputType { AlphaNumeric, NumbericOnly, AllowSpecialCharacters };

  • Thanks Chris, tried that. The 'allow spaces' option with a AlphaNumeric input works great but when I switch to Allow Special Characters, it won't let me input anything. Any other ideas? 
  • Switching to Unity UI should give you full control, but the code in MenuInput should work.

    You can try placing Debug.Log statements inside its Display method - the TextField is drawn on line 272.
  • Cool, thanks a lot for your help.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.