Search the Community
Showing results for tags 'Potato rage'.
-
I am trying to make a map with little 16x16 rects for each 'coordinate'. Now I have the map size already set in a two dimensional array, and another array that will hold the GUI Graphic ID so I can loop through them and tell whether one was clicked or not (If it was clicked then change the graphic color and set ANOTHER two dimensional array value at the position of the map coordinate). But besides that I can't seem to get past this "Array badly formatted error"... My code: ;----INCLUDES----; #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <array.au3> Global Const $mapX = 51 Global Const $mapY = 31 Global Const $IMGX = 16 Global Const $IMGY = 16 Global $labryinthMap[$mapY,$mapX] ;Our maze Global $GUID[$mapY,$mapX] ;Holds each GUI graphic ID so we can check if it was clicked Global $posX = 16 Global $posY = 16 GUICreate("Labyrinth", 900, 900) Local $y, $x for $y = 0 To $mapY $posX = $IMGX ;Reset posX to start position $posY += $IMGY ;Increase Y axis by 16 (img size) for $x = 0 To $mapX $GUID[$y,$x] = GUICtrlCreateGraphic($posX, $posY, $IMGX, $IMGY) GUICtrlSetGraphic( $GUID[$y,$x], $GUI_GR_RECT, $posX, $posY, $posX + 16, $posY + 16) Next MsgBox(0, "", "Row " & $y & " complete.") Next Local $msg GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd On a side note, how do I draw a rect in a certain color? I didn't see any values to set in GUICtrlSetGraphic for the color. Thanks.