MouseX(), MouseY()

BlitzMax Forums/BlitzMax Programming/MouseX(), MouseY()

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Umm ... it's simple enough, I don't see what the fuss is about.

Use GadgetX() and GadgetY() to get the position of the Window gadget. This is relative to the desktop in absolute coords. Then get the GadgetX() and GadgetY() of the top left of the canvas which covers the whole client area of the window, and subtract it from the window topleft. This gives you the size of the title bar and/or border. Then get your relative mouse coords and add the window coords plus the title bar size to get the absolute coords. Then use SetGadgetShape() to position the window.