papam77 Posted October 13, 2013 Share Posted October 13, 2013 Hello, I have problem with dxDrawRectangle, here is code: dxDrawRectangle ( sX/(25*100), sY/(25*100), sX/3, sY/30, tocolor ( 0, 125, 255, 255 ) ) And what am I doing? http://www.img.tpx.cz/uploads/thisthist ... isthis.jpg sX 25*100 and sY 25*100 is correct it is in the left side (up), but when I am changing the sX it is making sY smaller, but why? I need it like on the image. Link to comment
csiguusz Posted October 13, 2013 Share Posted October 13, 2013 Do you just want to draw a rectangle on the top of the screen? Then use this: local w, h = guiGetScreenSize () height = 20 --20 is an absolute value. You can use h/10 for example, to make it relative. dxDrawRectangle ( 0, 0, w, height, tocolor ( 0, 125, 255, 255 ) ) Link to comment
papam77 Posted October 14, 2013 Author Share Posted October 14, 2013 And what about dxDrawText? http://www.img.tpx.cz/uploads/relative.png http://www.img.tpx.cz/uploads/relative2.png local sX, sY = guiGetScreenSize() function design () showCursor ( true ) -- Header -- dxDrawRectangle ( 0, 0, sX/1, sY/20, tocolor ( 0, 125, 255, 255 ) ) dxDrawText("Sign In", sX/1.1, 0, sX/2, sY/2, tocolor(255, 255, 255, 255), 3.00, "default", "left", "top", false, false, true, false, false) end addEventHandler ("onClientRender", root, design ) It is not relative, but why? I mean the text scale Link to comment
csiguusz Posted October 14, 2013 Share Posted October 14, 2013 No, it isn't relative, but then why don't you try to make it relative? Example: local sX, sY = guiGetScreenSize() dxDrawText("Sign In", sX/1.1, 0, sX/2, sY/2, tocolor(255, 255, 255, 255), sX*0.0016, "default", "left", "top", false, false, true, false, false) 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