tommymaster Posted December 9, 2017 Share Posted December 9, 2017 Hi. I made a script, in which i created an edit box, then set it's alpha to 0, and i would like to output the text of the invisible edit box, by dxDrawText. This is what i have came up so far: Edit boxes: function createLoginEditBoxes() usernameField = guiCreateEdit(px/2 - field["width"]/2, py/2 - field["height"]/2 - 150/y*py, field["width"], field["height"], "asd", false) guiSetAlpha (usernameField, 0) passwordField = guiCreateEdit(px/2 - field["width"]/2, py/2 - field["height"]/2 - 50/y*py, field["width"], field["height"], "asd", false) guiSetAlpha (passwordField, 0) guiEditSetMasked (passwordField, true) end dxDrawImage (px/2 - field["width"]/2, py/2 - field["height"]/2 - 50/y*py, field["width"], field["height"], "files/inactive.png") if isElement (passwordField) then dxDrawText(guiGetText(passwordField), px/2 - field["width"]/2 + 10, py/2 - field["height"]/2 - 30/y*py, _, _, _, 1/x*px, "default", "left", "center") end The problem is, that the edit boxe's text pointer will not set it's alpha to 0. So the pointer of the edit box remains visible, and protrudes into the text. Screenshot of it: -Also, the edit box (passwordField) is set to masked, but the text in it is not, and the drawText will not mask the text in the editbox. Link to comment
itHyperoX Posted December 9, 2017 Share Posted December 9, 2017 Because that is gui, not dx. password = guiGetText(passwordField) passwordText = string.gsub(password, "%C", "•") dxDrawText(passwordText) 1 Link to comment
tommymaster Posted December 9, 2017 Author Share Posted December 9, 2017 (edited) ok thanks, but how do i hide the ponter of editbox? Edited December 9, 2017 by tommymaster Link to comment
Ahmed Ly Posted December 9, 2017 Share Posted December 9, 2017 local masked = string.rep('●',#guiGetText(text)) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now