leshikgo Posted December 10, 2014 Share Posted December 10, 2014 Please give ideas for the implementation of a full edit box at the DX. I would be very grateful to all who help with that! P.S Sorry for my english Link to comment
.:HyPeX:. Posted December 10, 2014 Share Posted December 10, 2014 i was actually planning to do one myself aswell... https://wiki.multitheftauto.com/wiki/OnClientKey https://wiki.multitheftauto.com/wiki/OnClientKey https://wiki.multitheftauto.com/wiki/OnClientMouseEnter https://wiki.multitheftauto.com/wiki/OnClientMouseLeave https://wiki.multitheftauto.com/wiki/OnClientMouseMove https://wiki.multitheftauto.com/wiki/OnClientClick https://wiki.multitheftauto.com/wiki/On ... oubleClick Link to comment
leshikgo Posted December 10, 2014 Author Share Posted December 10, 2014 Thank you, I understand you! Another question, whereby you can add a blinking cursor input? dxDrawRectangle but how to make it blink? Link to comment
.:HyPeX:. Posted December 10, 2014 Share Posted December 10, 2014 what do you mean with blinking cursor? the one that appears when you're edditing? you could make it blink with a timer changing the alpha and placing it by dxGetTextWidth. Greetz Link to comment
leshikgo Posted December 10, 2014 Author Share Posted December 10, 2014 Thank you, I understand you! Link to comment
.:HyPeX:. Posted December 10, 2014 Share Posted December 10, 2014 Thank you, I understand you! You're Welcome. Link to comment
leshikgo Posted December 10, 2014 Author Share Posted December 10, 2014 Came another question. And how to jump the cursor to the input typed text on mouse click and thus determine the index letters in a string? Principle can be in three words, if you do not mind!? Link to comment
MTA Team botder Posted December 10, 2014 MTA Team Share Posted December 10, 2014 How to jump with the cursor? Using the position, iterate through the visible text and checking if the delta position is greater or lower than the cursor position. How to make a blinking caret? Use that piece of code when drawing the caret line: tocolor(0, 0, 0, math.abs(math.sin(getTickCount() / 300)) * 200) Link to comment
.:HyPeX:. Posted December 10, 2014 Share Posted December 10, 2014 Note: string.split and table.size are usefull functions local text "My Random generated string of text wich goes long" local str = string.split(text) local mstr = "" local boxStart = x*0.2 local cursorPosition = x*0.3 for i=1, table.size(str) do mstr = mstr..str[i] if cursorPosition <= dxGetTextWidth(mstr, scale, font) + boxStart then -- Found da spot! end end You'd still need to do some maths to where to add more characters due to the nature of dxInput, but you can do it from here Link to comment
leshikgo Posted December 10, 2014 Author Share Posted December 10, 2014 Thanks guys, I will try 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