Jump to content

Label setting position


Renkon

Recommended Posts

Posted

Hello fellas. I am having an issue right now at the moment.

twdn.png

As you can see, DEATHMATCHIN position is fine above the radar. However, when resolution is different, it isn't!. I have tried many different ways such as using absolute and relative, using many other mathematical ecuations, but couldn't make it work correctly in all resolutions.

Mine is 800x600, but at 1400x900, position's quite different....

Here's the code I have.

    local LabelInf1 = guiCreateLabel(sW/13, sH/1.4, 200, 50, "deathmatchin", false) 
    guiLabelSetColor ( LabelInf1, 255, 255, 255 ) 
    guiSetFont ( LabelInf1, Chino ) 

Would you mind explaining me how to make it exactly in the same position (or almost the same position) above the radar, centered?

Thank you. In advance.

Posted
dxCreateFont doesn't create the font I want to, so I had to use GUI.
x,y = guiGetScreenSize() 
local font = dxCreateFont("font.ttf", 10) -- or just "Chino" idk chino is mta font? 
local size = 1 
dxDrawText ("deathmatch" ,x/2,y/2,x,y, tocolor ( 0,0,0,100 ), font, size ) 

you can do it with dx.

Posted

dxCreateFont with the custom font I have isn't working correctly. That's why I am not using dx. It looks like an Arial Font with dx, but with GUI it's fine.

Posted
dxCreateFont with the custom font I have isn't working correctly. That's why I am not using dx. It looks like an Arial Font with dx, but with GUI it's fine.

can you show me your dx code? maybe it has a bugs?

btw:

x,y = guiGetScreenSize() 
local LabelInf1 = guiCreateLabel(50, y-200, 200, 50, "deathmatchin", false) 
guiLabelSetColor ( LabelInf1, 255, 255, 255 ) 
guiSetFont ( LabelInf1, Chino ) 

you can edit the position of text in here: 50, y-200

Posted
It won't be centered in certain resos

you can edit the position by yourself. it will be same position on every resolution.

Posted
It won't be centered in certain resos

you can edit the position by yourself. it will be same position on every resolution.

It won't be centered above the radar. That's the problem ! :S

Posted
It won't be centered in certain resos

you can edit the position by yourself. it will be same position on every resolution.

It won't be centered above the radar. That's the problem ! :S

show us your code so we can help you!..

Posted
    local LabelInf1 = guiCreateLabel(sW/13, sH/1.4, 200, 50, "deathmatchin", false) 
    guiLabelSetColor ( LabelInf1, 255, 255, 255 ) 
    guiSetFont ( LabelInf1, Chino ) 

Posted

Finally done..

local LabelInf1 = guiCreateLabel(sW/17.3913043, sH/1.4, sW/6.34920635, 50, "deathmatchin", false) 
    guiLabelSetColor ( LabelInf1, 255, 255, 255 ) 
    guiSetFont ( LabelInf1, Chino ) 
    guiLabelSetHorizontalAlign ( LabelInf1, "center" ) 

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