Better than Text Input?

2 favourites
From the Asset Store
Total customisation of the input! You can combine inputs from all peripherals. Make your game accessible for everyone!
  • As the question states, are there any options better than the text input. Its great for prototypes, but sticks out like a sore thumb when art starts getting added :/

  • I think someone here shared a cool example where the Text Input was made invisible with CSS, and displayed a Spritefont object that matched the text of the Text Input. So it kept the function of the Text Input object, but had the visual cohesion that the Spritefont allowed.

    Is that the kind of thing you're after?

  • Yeah, it's better to make one yourself with a Text or Spritefont object. Here is an example:

    howtoconstructdemos.com/old-terminal-style-text-input-with-blinking-cursor-capx

  • As noted in this blog post, text inputs are actually highly complex. I would strongly advise that you do not try to recreate one yourself. Instead you can customise the appearance of a text input - for example you can remove the border and background so it's transparent with just text, and use your own art as the border and background.

  • Ashley I disagree. In many cases we don't need all those fancy features from the text inputs. For example, if I only want to ask the player to enter their name, I don't need undo/redo/selecting/copying/pasting/tooltips etc. And considering how difficult it may be to make the text input match the style of the game, creating your own text input in such case is a much easier solution. Besides, it will not have all the quirks and limitations of DOM elements, like drawing above everything else on the canvas, not supporting effects and so on.

  • In many cases we don't need all those fancy features from the text inputs.

    You should ask your players, or watch some people trying to interact with your own controls. Everyday computer users expect all those features to work, and will be annoyed if they don't.

  • Just slap an ID on the inputtext, and add a css file ....

    You can style it with all the css possibilities that are out there, from animating to to fade effects, gradient coloring etc etc etc

  • I agree with dop2000, 95%+ of the time Input Text in games is simply for entering name/usernames/etc, where we do NOT want them to have all functionality (like pasting special characters, etc)

    A Spritefont works great with simple Keyboard events for Append and backspace.

    If anything, InputText object should have a UI properties feature for basic appearance adjustments quickly.

  • Again, I would encourage you to watch everyday users try using your custom input controls. I expect it will be enlightening.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I use the prompt to let users set their username.

    cordova.apache.org/docs/en/11.x/reference/cordova-plugin-dialogs

    I've modified the file so the appearance match the appCompat theme and follow the google guidelines.

    Works perfectly always.

  • I agree with dop, there are pros and cons to making your own text input vs just using the editbox.

    To me, editboxes work well but you are limited how it can look, even with css. Making your own can go from fairly simple like dop’s example to trying to reproduce everything. Clipboard access is the tricky part in js.

    Another idea is to hide the editbox by setting the style opacity to 0. That would let you interact with the editbox but let you draw it as you wish. It’s just fiddly to make them match.

    As long as it works it should be fine. I’ve seem lots of games and software that don’t just use a normal os editbox and it’s seldom an annoyance.

  • There's a use for everything!

    More often I use textinput, but I can see a potential issue arising with floating DOM elements, where my project might have a 9-patch menu with a few textinputs and buttons, then when clicking "Done" on this menu, I would like to have a popup menu asking "Are you sure you wish to save changes?", but this popup may overlap the textinput and buttons below, causing them to appear above the "are you sure" popup - sooo I could either attempt to use drawing canvas and paste the textinputs so that I can keep the correct Z order, or I make a custom textinput with SpriteFont (Which I do see as a sacrifice, as I like the ability for users to use highlighting with mouse or shift+arrows, right-clicking for extra options, CTRL+A then CTRL+X for a quick cut, etc.)

  • and paste the textinputs

    I'm pretty sure it's not possible to paste a textinput on drawing canvas..

  • You should ask your players, or watch some people trying to interact with your own controls. Everyday computer users expect all those features to work, and will be annoyed if they don't.

    In the old days players selected letters using arrow keys and no one complained :)

  • > and paste the textinputs

    I'm pretty sure it's not possible to paste a textinput on drawing canvas..

    Yeah probably not, which leaves me with no other workarounds aside from using spritefonts. Or maybe switching out the TextInput for a SpriteFont when the TextInput is not focused.

    ...or just use SpriteFonts overall, probably easiest!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)