Jump to content

[HELP] dxDrawRectangle Local.


off

Recommended Posts

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 

local3.png

Sorry my bad english.

Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...