Hi, ich habe ein dickes Problem mit GUICtrlSetImage. Ich habe schon bereits im Internet nachgeguckt und kam zu keiner Lösung, oder habe nicht nach dem richtigem gegoogelt.
Also ich habe folgenden Code:
Spoiler anzeigen
$MapScreen = GUICreate("GUI 1", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x000000)
;Ab hier wird ein Spielfeld aus Daten ausgelesen:
For $i = 0 to 19 Step 1
$reihe = $reihe + 1
For $i2 = 0 to 37 Step 1
$coord1 = IniRead("sources\coords.pl", "coords", $reihe & ":" & $i2 & "_1", "ERROR")
$coord2 = IniRead("sources\coords.pl", "coords", $reihe & ":" & $i2 & "_2", "ERROR")
$type = IniRead("sources\map0_01.pl", $reihe, $i2, "ERROR")
If $coord1 = "ERROR" Or $coord2 = "ERROR" Or $type = "ERROR" Then
MsgBox(0, "", "Fehler")
Exit
Else
GUICtrlCreatePic("sources/types/" & $type & ".jpg", $coord1, $coord2, 50, 50)
EndIf
Next
Next
GUISetState(@SW_SHOW, $MapScreen)
;---------
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]$playerGUI = GUICreate("GUI 2", 50, 100, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $MapScreen)
$player = GUICtrlCreatePic("", 0, 0, 50, 100)
GUICtrlSetImage($player, "sources/types/char/char1.gif")
IniWrite("tmp.pl", "tmp", "feldnr", 0)
IniWrite("tmp.pl", "tmp", "feldreihe", 1)
GUISetState(@SW_SHOW, $PlayerGUI)
[/autoit] [autoit][/autoit] [autoit]While 1
If _IsPressed("10", $dll) AND _IsPressed("25", $dll) And Not _IsPressed("27", $dll) And Not _IsPressed("26", $dll) And Not _IsPressed("28", $dll) Then
GUICtrlSetImage($player,"sources\types\char\char2.gif")
IniWrite("tmp.pl", "tmp", "richtung", "25")
EndIf
If _IsPressed("10", $dll) AND _IsPressed("26", $dll) And Not _IsPressed("27", $dll) And Not _IsPressed("28", $dll) And Not _IsPressed("25", $dll) Then
GUICtrlSetImage($player,"sources\types\char\char4.gif")
IniWrite("tmp.pl", "tmp", "richtung", "26")
EndIf
If _IsPressed("10", $dll) AND _IsPressed("27", $dll) And Not _IsPressed("28", $dll) And Not _IsPressed("26", $dll) And Not _IsPressed("25", $dll) Then
GUICtrlSetImage($player,"sources\types\char\char3.gif")
IniWrite("tmp.pl", "tmp", "richtung", "27")
EndIf
If _IsPressed("10", $dll) AND _IsPressed("28", $dll) And Not _IsPressed("27", $dll) And Not _IsPressed("26", $dll) And Not _IsPressed("25", $dll) Then
GUICtrlSetImage($player,"sources\types\char\char1.gif")
IniWrite("tmp.pl", "tmp", "richtung", "28")
EndIf
;.... Hier kommt noch anderer Code
[/autoit] [autoit][/autoit] [autoit]WEnd
[/autoit]Wenn ich nun aber mal ein Bild aus der 1. GUI mit GUICtrlSetImage verändern möchte geht dies nicht (In der 2. GUI kann man alle Bilder ändern). Kann man das Problem irgendwie lösen?
Wäre euch mega dankbar wenn Ihr mir helfen könntet.
LG Zaziki