• DTextEntry Password
    2 replies, posted
Hello, I look how replace the value of Password to asterisk. I tested some solutions which do not have to work [CODE] ---Password--- local Password = vgui.Create("DTextEntry", TextBack) Password:SetPos(50, 95) Password:SetSize(150, 20) Password:SetMultiline(false) Password:SetDrawLanguageID(false) [/CODE] Thank in advance
You'll have to build your own textbox system, although it's pretty useless since you passwords in gmod are something not usable due it's a home game and login system via steamid account it's not something usable... Althought i can recommend you to use Paint hook and draw an asterisk for every character in textbox, if you were looking for a built solution, there's no one, so you would need to build yours
Or you could kinda 'hack' it [code] vguiPasswordMask = vgui.Create ("DLabel") vguiPasswordInput = vgui.Create ("DTextEntry") vguiPasswordInput:SetTextColor (Color (0, 0, 0, 0)) vguiPasswordInput.OnValueChange = function (strValue) vguiPasswordMask:SetText (string.rep ("*", #strValue)) end do x, y = vguiPasswordInput:GetPos () w, h = vguiPasswordInput:GetSize () vguiPasswordMask:SetFont (vguiPasswordInput:GetFont ()) vguiPasswordMask:SetTextColor (Color (0, 0, 0, 255)) vguiPasswordMask:SetPos (x, y) vguiPasswordMask:SetSize (w, h) vguiPasswordMask.DoClick = function () -- I don't know if this would work or not. vguiPasswordInput:OnGetFocus () end end [/code]
Sorry, you need to Log In to post a reply to this thread.