The Killer Posted February 14, 2014 Share Posted February 14, 2014 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
manve1 Posted February 14, 2014 Share Posted February 14, 2014 You're multiplying with quite high numbers, which makes the text draw outside of the screen + you need eventHandler: onClientRender or onClientPreRender Link to comment
The Killer Posted February 14, 2014 Author Share Posted February 14, 2014 i know that i have to use that event, so but i can't see it, if i remove: screenWidth and screenHeight, i can see it. Link to comment
NeO_DUFFMAN Posted February 14, 2014 Share Posted February 14, 2014 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
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