Code: Select all
Gui, Theme: Add, CheckBox, vMvImgLeftCB, Left
Gui, Theme: Add, CheckBox, vMvImgRigtCB, Right
Gui, Theme: Add, CheckBox, vMvImgUpCB, Up
Gui, Theme: Add, CheckBox, vMvImgDownCB, Down
Gui, Theme: Add, Picture, x350 y300 vPic1, %A_ScriptDir%\Pic1.png
Gui, Theme: Add, Button, w100 h100 gGo
Gui, Theme, Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight
return
Go:
GuiControlGet, MvImg1LeftCB
GuiControlGet, MvImg1RigtCB
GuiControlGet, MvImg1UpCB
GuiControlGet, MvImg1DownCB
If (MvImgLeftCB = 1) || (MvImgRigtCB = 1)
{
MovImgVar = 350
If (MvImgLeftCB = 1)
{
Loop, 500
{
MovImgVar -= 1
GuiControl, Move, Pic1, x%MovImgVar%
}
}
else if (MvImgRigtCB = 1)
{
Loop, 500
{
MovImgVar += 1
GuiControl, Move, Pic1, x%MovImgVar%
}
}
}
else If (MovImgUpCB = 1) || (MvImgDownCB = 1)
{
MovImgVar = 300
If (MovImgUpCB = 1)
{
Loop, 500
{
MovImgVar -= 1
GuiControl, Move, Pic1, y%MovImgVar%
}
}
else if (MvImgDownCB = 1)
{
Loop, 500
{
MovImgVar += 1
GuiControl, Move, Pic1, y%MovImgVar%
}
}
}
return
I was wondering if I can achieve something like this:
Code: Select all
if (MvImgDownCB = 1)
{
var = -
var2 = y
}
Loop, 500
{
MovImgVar %var%= 1
GuiControl, Move, Pic1, %var2%%MovImgVar%
}