Jump to content

dxDrawRectangle


Recommended Posts

  • Moderators

You have the position of the cursor and you have the positions of the rectange, as far I know it isn't that hard to compare them.I haven't said that I finished the code, I just help you creating the basic. It is your job to finish it.

Note* it doesn't store a cursor position because it is a local.

Link to comment
You have the position of the cursor and you have the positions of the rectange, as far I know it isn't that hard to compare them.I haven't said that I finished the code, I just help you creating the basic. It is your job to finish it.

Note* it doesn't store a cursor position because it is a local.

ok but there's one thing i don't understand .. what are the 4 values in the table?? does it includes the width and height or there're just coords if so.. then witch one is the X and Y ?

Link to comment

Easy, just convert it to absolute.

function getAbsoluteCursorPosition ( ) 
    if isCursorShowing ( ) then 
        local sx, sy = guiGetScreenSize ( ) 
        local cursorX, cursorY = getCursorPosition ( ) 
        return ( cursorX * sx ), ( cursorY * sy ) 
    end 
end 

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