Snow-Man Posted August 3, 2014 Share Posted August 3, 2014 hey, i have made top chat but i have got problem in text position http://postimg.org/image/4nne1czu9 addEventHandler("onClientRender",getRootElement(), function() for i, message in ipairs ( dxMessage ) do dxDrawRectangle(256, 2*((i-1)*20), 898, 33, tocolor(0, 0, 0, 100)) dxDrawText(message[1], 256, 2*((i-1)*20), 898, 33, tocolor(message[3], message[4],message[5], 255), 1.00, "bankgothic", "left", "center", false, false, true, true, false) end end ) but when i use guiGetScreenSize() i got error expected number, got NaN my codes : local sizeX, sizeY = guiGetScreenSize( ) local sx, sy = sizeX/1280, sizeY/1024 addEventHandler("onClientRender",getRootElement(), function() for i, message in ipairs ( dxMessage ) do sx, sy, sh, sw = sx*256, sy*2, sx*898, sy*33 dxDrawRectangle(sx, sy*((i-1)*20), sh, sw, tocolor(0, 0, 0, 100)) dxDrawText(message[1], sx, sy*((i-1)*20), sh, sw, tocolor(message[3], message[4],message[5], 255), 1.00, "bankgothic", "left", "center", false, false, true, true, false) end end ) Link to comment
Anubhav Posted August 3, 2014 Share Posted August 3, 2014 NaN means Not A Number. I am not sure whats wrong. Show us the image of /debugscript 3 Link to comment
Snow-Man Posted August 3, 2014 Author Share Posted August 3, 2014 i have fixed problem but still dx text and rectangle is not in same line, please take a look in screenshot Link to comment
Et-win Posted August 3, 2014 Share Posted August 3, 2014 Make those dxDrawText's the same size, and do exactly the same as what you do with that bars. Link to comment
Snow-Man Posted August 3, 2014 Author Share Posted August 3, 2014 Make those dxDrawText's the same size, and do exactly the same as what you do with that bars. thanks, i have fixed it /lock please 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