FEATURE REQUEST: Text Box Input

  • Why is it that I can only write into a text box when:

    A - It's on screen

    B - It's visible

    ?

    I have events in place that state it's always in focus. This is so I can write into the text box and the content will always be shown in a text object. Anyone know how to achieve this with these 'features' in place?

    *UPDATE*

    Upon doing further tests it seems that even setting the on-screen box to a vertical size of zero will not allow me to enter text, and also auto size must be switched on if the text box is too small.

    Therefore, Ashley, please may I request that text boxes can be focused even if they are invisible or off screen? At the moment I can't think of a way to allow people to write into Sprite.Font or normal font objects without text boxes.

    This (hopefully) minor feature is important for 2 of my current ongoing projects.

  • I never liked the text boxes much

    maybe you could work with something like this instead?

    Edit* see bellow

  • Sorry Sargas, I can't see anything...

  • AnD4D woops, there, forgot the link xD

    Edit* see bellow

  • Sargas, Interesting. Not bad at all. The only thing I can think of is the fact that in order to get the shift and caps lock working, I'll have to set up a whole bunch of other functions. I'll definitely do this if the TextBox won't be updated, but the text box method would be a lot more straight forward... if it worked

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AnD4D CapLocks is easy... but holding shift is considerably more complex

  • AnD4D https://dl.dropboxusercontent.com/u/206 ... ting3.capx

    Now you can input only letters, numbers, space and enter. with or without shift. and with capslock on or off.

  • Sargas - Very nice indeed. Thanks a lot! I'm still going to put this through as a feature request however, as although it may be this way by design, I do not see why whether an object is invisible or not should stop it from functioning.

    15 events for something that should already be built in reminds me of my early turret code

  • Following on from: https://www.scirra.com/forum/viewtopic.php?t=102042

    @Ashley - Can we at least have a opacity setting then, as I believe 0% opaque objects are still rendered and can therefore be focussed. At the moment, I can't see anyone using the TextBox for their professional game as you can't customize it at all. At least if you link it to a text object you can change the font and size. The ability to enter data is a big deal for my current game, and would prefer to use the great functionality provided by the TextBox... just not the way it looks.

    Unless of course, you know of an easier way to achieve my aim beyond Sargas suggestion?

    Your help would be appreciated, as it's a rather nicely paid job waiting here, requiring that I upgrade my license

  • If text boxes are off-screen or invisible, the text box is removed from the page so it does not exist. You can't focus a control that does not exist.

    It sounds like you're trying to reinvent the wheel. Why not just let the user type text in to the text box itself? Are you going to go as far as enabling cursor editing, text selection, copy/paste...?

  • Ashley - Thanks for the response, I appreciate your reply.

    My client wishes to have their custom font appear on an educational game, and they want their current 640x480 flash game upscaled to an 1080p HTML5 game but with strict instructions that the new game visually looks the same (but better). Unfortunately I can't achieve this with the current text box, as they currently have a transparent background to their textbox allowing them to show textures behind the text. I hate reinventing the wheel when the more efficient tool is so close to what I want it to do. One of the levels is based on a space background, so having a floating white box just looks out of place, which is the reason as to why I'm trying to combine it with the text object or sprite font.

    I've never actually needed to make proper use of the Text Box in a game before, but they've agreed to a £3200 quote for one program, and a £720 quote for 1 of 6 other games and so I'm pretty keen to get the function in place.

    Sorry for chasing so much! I know it's a pain, but I'm hoping there's an easier method. Would an opacity setting be possible? Am I correct in thinking a 0% opacity object is still rendered?

  • Just use the "set CSS style" action. There is a CSS property for opacity. This is still a bad idea, because the UI will be all wrong: you will still be able to select text and move the cursor around, but there will be no visual indication. It would be better to use CSS to remove the background and set a web font.

  • Although you may be very much against this, Ashley :s setting the CSS to ensure that all colours are transparent, and the outline and border to none has given me exactly what I needed. The Educational game involves quickly typing out the answer to as many sums as possible, so the text box is always in focus and the mouse isn't used until the game ends.

    Sure, it's not a very good game, but it pays the bills

    Thanks for your help, and sorry for all the hassle!

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