Jump to content

[Help] screenWidth - screenHeight


The Killer

Recommended Posts

hello

i have a problem that when i put this code:

local screenWidth, screenHeight = guiGetScreenSize() 
dxDrawText("hello", 614 * screenWidth, 200 * screenHeight, 791 * screenWidth, 518 * screenHeight, tocolor(0, 0, 0, 255), screenWidth / 1024 * 1, "default", "left", "top", false, false, true, false, false) 

i can't see it

it's work but

i can't see it

this code:

local screenWidth, screenHeight = guiGetScreenSize() 

should make the text

in the same place that i put it

in my screen, so every one

can see it in the same place

no matter if his screen big or small

he can see it in the same

place that i put it in my screen

so, help.

Link to comment

Like manev1 said, you're using relatively high integers. Try changing the values to the following:

x = 0.614 * screenWidth

y = 0.200 * screenHeight

width = 0.791 * screenWidth

height = 0.518 * screenHeight

Basically, the values used for multiplication can't be higher than 1. For instance, if your screen resolution is 1366x768 and if you multiply 614 with 1366 and 200 with 768, you're bound to get impractical values which can be rectified if you use values less than one.

Edit: I just realised that you can see the text without using screenWidth and screenHeight. Seems like you skipped the part where you first have to divide the values.

Refer to the last section of this wiki page: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize

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