Jump to content

deleting gui text input.

Recommended Posts

So my first display screen is an empty map with a camera.


On it I'm setting up the HUD, and giving some basic instructions using white text on black background.


I prompt for the user to enter their initials, and press return to start.


I display the initials as they hit each key A-Z.


The problem I'm having though, is if the user keys the wrong initials, and presses delete or backspace, I need to blank out the initials that have been displayed with DrawText.


The problem is the output on the display is cumulative. So displaying blanks over the initials changes nothing.


So I thought, I know , Ill be really clever and use SetColor(0,0,0,1) to redraw the old initials in black before i clear them down.


(I was implementing the backspace and delete key to completely reset all the initials typed in, not just the last key)


Unfortunately the SetColor(0,0,0,1) just writes grey text on black, its better than nothing, but I was wondering how anyone else would black out the initials typed in error.

Share this post

Link to post

Rather than blanking out with color, why not alter the string that you want to display?


The way I do is I store a boolean for when the backspace key pressed. Then depending on where the cursor is, I remove a letter from the string.

Share this post

Link to post

Something happened with after yesterdays beta, the text displays on the empty map, have sharpened up and are no longer blocky, and the grey colour has gone for the deleted text, and is now black, so I guess its been fixed.biggrin.png

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...