Sign in to follow this  
Followers 0
TheOnlyOne

help whit picture move

7 posts in this topic

hey i want to make a very simple game right now it is a plate where you need to move around

i cant get how i can get my man get around :S?

[/code]
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>




hotkeyset ("{right}","right")

$4="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica21.jpg"; that is my  man
$5="C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\dioica2.jpg"; that is the other plates
local $avArray[9]


$pic= $avArray[1]
$pic= $avArray[2] 
$pic= $avArray[3] 
$pic= $avArray[4] 
$pic= $avArray[5] 
$pic= $avArray[6] 
$pic= $avArray[7] 
$pic= $avArray[8]
$pic= $avArray[9] 


$1=0
$2=145
$3=282
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\lo\Skrivebord\Ny mappe (4)\Form1.kxf
$Form1 = GUICreate("Form1", 429, 434, 190, 121)

$pic=  GUICtrlCreatePic($4, $1, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $2, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $3, $1, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $1, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $2, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $3, $2, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $1, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $2, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$pic=  GUICtrlCreatePic($5, $3, $3, $2, $2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


$pos =$pic

func right ()
$pos = $pos+3; its here when i click right its need to move to the right but how ?
    
endfunc

really hope you can help me here:)?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

func right ()
 $hwnd = ControlGetHandle($pic)
 $pos = WinGetPos($hwnd)
 GUICtrlSetPos($pic, $pos[0] + 3, $pos[1]); its here when i click right its need to move to the right but how ?
endfunc

Edited by Zedna

Share this post


Link to post
Share on other sites

func right ()

$hwnd = ControlGetHandle($pic)

$pos = WinGetPos($hwnd)

GUICtrlSetPos($pic, $pos[0] + 3, $pos[1]); its here when i click right its need to move to the right but how ?

endfunc

hmm yeah okay now it work but a other problem is it dosent show when im clicking f5 ?'

i think its becores i havent declared $pic?

and btw there is one mistake

C:\Documents and Settings\lo\Skrivebord\test.au3(31,32) : ERROR: ControlGetHandle() [built-in] called with wrong number of args.

$hwnd = ControlGetHandle($pic1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\lo\Skrivebord\test.au3(33,20) : WARNING: $pic: possibly used before declaration.

GUICtrlSetPos($pic,

~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\lo\Skrivebord\test.au3(33,20) : ERROR: $pic: undeclared global variable.

GUICtrlSetPos($pic,

~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\lo\Skrivebord\test.au3 - 2 error(s), 1 warning(s)

Share this post


Link to post
Share on other sites

uh and btw btw

i think it works but in

$hwnd = ControlGetHandle($pic1)

it dosent work :S ?

why ?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

hmm when it opens it exit ? why it do that ? cant see what im doing wrong ?

Edited by TheOnlyOne

Share this post


Link to post
Share on other sites

okay i just see a mistake i have done now in my post here :)

in stead i mean i need to chance the two pictures so they chance plase? how to do that?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0