Jump to content

help me please i'm not getting the correct result


Vizzy

Recommended Posts

how do i transform positions correctly??


'location x,y = (x/1366), (sy/768)'

dxDrawImage(screenW * 0.2903, screenH * 0.4067, screenW * 0.4243, screenH * 0.5300, ".........", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("", screenW * 0.4201, screenH * 0.5878, screenW * 0.5986, screenH * 0.6211, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("", screenW * 0.3535, screenH * 0.6500, screenW * 0.4104, screenH * 0.6856, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("", screenW * 0.4347, screenH * 0.6511, screenW * 0.5618, screenH * 0.6856, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("", screenW * 0.5861, screenH * 0.6511, screenW * 0.6833, screenH * 0.6856, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("", screenW * 0.3792, screenH * 0.7856, screenW * 0.4813, screenH * 0.8167, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)

Edited by Vizzy
Link to comment

sx = playerScreenX/yourScreenX
sy = playerScreenY/yourScreenY

dx(x/sx,y/sy,w/sx,h/sy)

 

e.g.

```lua
local screenX,screenY = guiGetScreenSize()
local sx,sy = screenX/1366,screenY/768

local skalowanie = {
    background = {(365)/sx, (164)/sy, (637)/sx, (450)/sy};
}

local wyskalowaneGui = {
    background= skalowanie.background;
}

local function renderGui()
dxDrawRectangle(wyskalowaneGui.background[1],wyskalowaneGui.background[2],wyskalowaneGui.background[3],wyskalowaneGui.background[4], tocolor(3, 2, 2, 230), false)
end
addEventHandler("onClientRender",root,renderGui)
```

Edited by Kezoto
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...