Is there a way to remove text box TEXT selection highlighting?

0 favourites
  • 8 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • I'm making the text box text be displayed by a spritefont and will probably make some nice background effects for it. I can set the text box background and text invisible. But I haven't found out how to remove the selection box selection highlighting, meaning the text box text can be highlighted with the cursor, making it become annoyingly visible. This is different from the highlighted borders of the text box that become visible when you select the text box, I know how to disable that effect.

    Is there a way to remove this feature from the text box or maybe make the effect invisible? Thanks in advance.

  • you could try setting it to disabled, or have it be off screen...

  • You can use commends like: set CSS style "border-style" to "none", but what is the command to disable text highlighting? Didn't really find anything useful while I tried to search it. I tried "selection-style" to "none", but that doesn't work...

    Moving the box off screen is one option, but kind of clunky..

  • I didn't mean anything to do with CSS, you can set the TextInput to Disabled in the layout properties bar, or with a C3 action. Then the user can't click on it to highlight text or have the control intercept keyboard presses - which can still happen if it is on screen and just invisible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can also set it to "read only".

  • Hi,

    I think you misunderstood me. I don't want to disable the text input. All the methods above (as well as turning the text box invisible, btw) unable the player to type values in the text box. I don't want to do that.

    What I want to do is disable cursor selection of the text box text, or alternatively make the cursor highlighting effect invisible. You see, you can turn the text box text invisible, but after that you can still highlight it with the cursor, which then makes that text visible again.

    See how the text box numbers become visible when I highlighted them with the cursor? I just want to disable that feature. I also don't really want to make the whole text box invisible or move it away since I like those arrows that you can click to increase or decrease the value by one.

  • looks like this might be an option...

    -webkit-touch-callout: none; /* iOS Safari */

    -webkit-user-select: none; /* Safari */

    -khtml-user-select: none; /* Konqueror HTML */

    -moz-user-select: none; /* Old versions of Firefox */

    -ms-user-select: none; /* Internet Explorer/Edge */

    user-select: none; /* Chrome, Edge, Opera and Firefox */

    but I think it is a bad idea to try to force a form control to do what you want here. I would make my own out of sprites... especially if people will be using this on a mobile device.

  • Yes I guess that is the best way to go. I suppose I will have to move the text boxes away from the screen.

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