Tremidinha Posted August 7, 2012 Posted August 7, 2012 How to make a window dx in a position of the screen in all resolutions? Email - [email protected] Skype - mattheusxdx
Anderl Posted August 7, 2012 Posted August 7, 2012 You'll have to make use of dxDrawRectangle or dxDrawImage to draw an image as an window and also the function guiGetScreenSize. Here is an example of an override of dxDrawRectangle to be ajusted automatically for every resolution: local screenWidth = 800; local screenHeight = 600; local iScreenW, iScreenH = guiGetScreenSize ( ); __dxDrawRectangle = dxDrawRectangle; function dxDrawRectangle ( ... ) local arg = { ... } return __dxDrawRectangle ( ( arg[1] / screenWidth ) * iScreenW, ( arg[2] / screenHeight ) * iScreenH, ( arg[3] / screenWidth ) * iScreenW, ( arg[4] / screenHeight ) * iScreenH, arg[5] or nil, arg[6] or nil ); end Note: Change 'screenWidth' and 'screenHeight' variables to the screen size where you got screen positions. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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