off Posted February 15, 2014 Share Posted February 15, 2014 I created a block as an example and I want to move it to a certain location. That's basically it, I tried several ways, but could not. Obs: It has to be adaptable to most resolutions. If possible, all. dxDrawRectangle(0, 0, 60, 60, tocolor(0, 0, 0, 255), false) -- BLOCK Sorry my bad english. Link to comment
Bonsai Posted February 15, 2014 Share Posted February 15, 2014 local x,y, guiGetScreenSize() dxDrawRectangle(0, 0, x/2-30, y/2-30, tocolor(0, 0, 0, 255), false) -- BLOCK Edit: Thats the middle of the screen. Try it out. Link to comment
Wei Posted February 15, 2014 Share Posted February 15, 2014 you can get position on your resolution and then make it for all resolutions like this x, y = guiGetScreenSize() px = (x/yourRes)*yourPosition py = (y/yourRes)*yourPosition dxDrawRectangle(px, py, 60, 60, tocolor(0, 0, 0, 255), false) Link to comment
off Posted February 15, 2014 Author Share Posted February 15, 2014 local x,y, guiGetScreenSize() dxDrawRectangle(0, 0, x/2-30, y/2-30, tocolor(0, 0, 0, 255), false) -- BLOCK Edit: Thats the middle of the screen. Try it out. Very useful. What did I do? Center X and inverted Y. local x, y = guiGetScreenSize() dxDrawRectangle(x/2-200, y-100, 60, 60 tocolor(0, 0, 0, 255), false) -- BLOCK you can get position on your resolution and then make it for all resolutions like this x, y = guiGetScreenSize() px = (x/yourRes)*yourPosition py = (y/yourRes)*yourPosition dxDrawRectangle(px, py, 60, 60, tocolor(0, 0, 0, 255), false) In the future I can do it, thanks. 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