RenanPG Posted May 30, 2014 Posted May 30, 2014 hi everybody, i am creating a login using dx functions, but i have no idea how to make an EditBox in dx. I know need a table to store the keys pressed using this event: addEventHandler("onClientCharacter", getRootElement(), getCharacter)
xXMADEXx Posted May 30, 2014 Posted May 30, 2014 You could use something like this: local str = "" addEventHandler ( "onClientKey", root, function ( b, s ) if s then if ( b == 'backspace' ) then str = str:sub ( 0, str:len() - 1 ) else str = str .. b end end end )
Karuzo Posted May 30, 2014 Posted May 30, 2014 Or you can use tables. Like using tabel.insert if he types and table.remove if he want's to delete smth.
RenanPG Posted May 30, 2014 Author Posted May 30, 2014 You could use something like this: local str = "" addEventHandler ( "onClientKey", root, function ( b, s ) if s then if ( b == 'backspace' ) then str = str:sub ( 0, str:len() - 1 ) else str = str .. b end end end ) Thanks man, it's exactly i needed.
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