Jump to content

Weird DX Text problem


Recommended Posts

Hello today i was making a DX text for a script but when i tried making it fitting to every resoulotion it didnt do any difference

And i can see i did it right since it still shows at the right place in 1024 x 768 wich i calculated it from

But when i change resoulorion it moves ..

DX code

function DX() 
local sWidth,sHeight = guiGetScreenSize() 
DXText = dxDrawText(timeleft,sWidth-228,sHeight-597,sWidth-72,sHeight-545,tocolor(0,0,255,255),3.0,"default","left","top",false,false,false) 

BTW the eventhandler is in a other part of the script no need for that

Link to comment
local sX, sY = guiGetScreenSize() 
local mX = 0,22265625 -- 228/1024 
local mY = 0,77734375 -- 597/768 
local dX = sX * mX 
local dY = sY * mY 
function DX() 
    -- Modyfy 72, 545, it should be static on every resolution 
    DXText = dxDrawText(timeleft, dX, dX, 72, 545, tocolor(0,0,255,255), 3.0, "default", "left", "top", false, false, false) 

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...