I'm working on a game in AHK. I'd like some help with a drag and drop for some pictures. I have some pictures off to the side, and they need to be placed on a grid of squares.
An example would be how auto gui creator lets you drag a button from its title bar to set on a grid (your gui window)
So I have 5 squares in a line, and I'd like to drag a 30 x 30 picture and drop it on one of those 5 (30p x 30p) squares. It doesn't need to be perfect, but setting it with the mouse is a requirement.
Code: Select all
#Warn
#NoEnv
SetWorkingDir %A_ScriptDir%\Resources\
Gui, Add, Picture, x30 y390 w30 h30 , %A_WorkingDir%\gridbox.png
Gui, Add, Picture, x60 y390 w30 h30 , %A_WorkingDir%\gridbox.png
Gui, Add, Picture, x90 y390 w30 h30 , %A_WorkingDir%\gridbox.png
Gui, Add, Picture, x120 y390 w30 h30 , %A_WorkingDir%\gridbox.png
Gui, Add, Picture, x150 y390 w30 h30 , %A_WorkingDir%\gridbox.png
Gui, Add, Picture, x380 y402 w30 h30, %A_WorkingDir%\placeablepicture1.png
Gui, Add, Picture, x415 y402 w30 h30, %A_WorkingDir%\placeablepicture2.png
Gui, Color, 1c3968
Gui, Show, x590 y118 h718 w500, GUI Window
Return
There is currently no main loop.