Jump to content

Help dxDraw


Tremidinha

Recommended Posts

Posted

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

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