Tremidinha Posted August 7, 2012 Share Posted August 7, 2012 How to make a window dx in a position of the screen in all resolutions? Link to comment
Anderl Posted August 7, 2012 Share 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. 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