Kaneki16 Posted August 14, 2018 Posted August 14, 2018 I want to draw image on the blue region of the image posted below. How can I find its coordinates? I want to now Screen X and Screen Y
Keiichi1 Posted August 14, 2018 Posted August 14, 2018 First you need to get the clients' screen resoulution, you can do it by: local sx, sy = guiGetScreenSize() I usually divide sx and sy by 2 so: dxDrawImage(sx/2, sy/2, 50, 50, "someimg.png") And then you start positioning your image. dxDrawImage((sx/2) - 300, sy/2, 50, 50, "someimg.png") -- And start reducing the number you want
Discord Moderators Pirulax Posted August 14, 2018 Discord Moderators Posted August 14, 2018 That'll not work at all, it'll be at the same distance from the center of the screen for anyone(so anyone with a smaller screen than yours will not see it) Instead, on X just type a coordinate (0, 100, etc..) on Y do: SY- something.DxSetAspectRatioAdjustmentEnabled
JeViCo Posted August 14, 2018 Posted August 14, 2018 Step 1. Download guieditor script, make everything you need here, copy your code. Step 2. Paste this before your dxDraw functions local sx,sy = guiGetScreenSize() local px,py = 1366,768 -- replace 1366, 768 with your resolution local x,y = (sx/px), (sy/py) Step 3. For example you got this dxDrawRectangle(200,400,100,500) replace coordinates like this dxDrawRectangle(x*200,y*400,x*100,y*500) and that's it. Easy, isn't it?
Moderators Tut Posted November 11, 2020 Moderators Posted November 11, 2020 Gravedig post removed. Please create a thread in the correct forum for receiving programming help: https://forum.multitheftauto.com/forum/127-programação-em-lua/
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