guictrlcreatepic Fehler

  • Hallo, Ich habe ein Problem bei eines meiner Programme.

    Und zwar, erstens, Kapiere ich nicht, wieso ich erst die Häuser erstellen lassen muss und dann die Map.
    Zweitens, sobald ich denn Baum fällen möchte (Auf dem Baum Klicke) komm der baumstamm unter das Map Bild.

    Hat jemand eine Lösung? zip datei.

    Spoiler anzeigen
    [autoit]


    func _map_kulsav()
    $Haus1 = GUICtrlCreatePic("Haus1_wiese.bmp", 640, 35, 116, 156,$SS_NOTIFY) ; Oben rechts
    $Haus2 = GUICtrlCreatePic("Haus1_wiese.bmp", 99, 60, 116, 156,$SS_NOTIFY) ; Oben Links
    $Haus3 = GUICtrlCreatePic("Haus1_wiese.bmp", 99, 322, 116, 156,$SS_NOTIFY) ; Unten Links
    $Haus4 = GUICtrlCreatePic("Haus1_wiese.bmp", 640, 322, 116, 156,$SS_NOTIFY) ; Unten Rechts
    $Baum1 = GUICtrlCreatePic("Baum_wiese.bmp", 272, 216, 108, 124,$SS_NOTIFY) ; Baum 1
    $MAP = GUICtrlCreatePic("kulsav.bmp", 0, 0, 850, 600,$SS_BITMAP,$SS_NOTIFY) ; Map
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _baum1()
    GUICtrlDelete($Baum1)
    $Baums1 = GUICtrlCreatePic("Baumstamm_wiese.bmp", 296, 304, 52, 36,$SS_NOTIFY,$SS_BITMAP) ; Baumstamm 1
    EndFunc

    [/autoit]

    :):):):)

    Eine Antwort :D

  • Probiere es mal damit:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ComboConstants.au3>
    #include <StaticConstants.au3>
    #include <Array.au3>
    #include <IE.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Haus1 = 1
    $Haus2 = 1
    $Haus3 = 1
    $Haus4 = 1
    $Baum1 = 1
    $Baums1 = 1
    Global $MAP

    [/autoit] [autoit][/autoit] [autoit]

    func _map_kulsav()
    $MAP = GUICtrlCreatePic("kulsav.bmp", 0, 0, 850, 600) ; Map
    $Haus1 = GUICtrlCreatePic("Haus1_wiese.bmp", 640, 35, 116, 156) ; Oben rechts
    $Haus2 = GUICtrlCreatePic("Haus1_wiese.bmp", 99, 60, 116, 156) ; Oben Links
    $Haus3 = GUICtrlCreatePic("Haus1_wiese.bmp", 99, 322, 116, 156) ; Unten Links
    $Haus4 = GUICtrlCreatePic("Haus1_wiese.bmp", 640, 322, 116, 156) ; Unten Rechts
    $Baum1 = GUICtrlCreatePic("Baum_wiese.bmp", 272, 216, 108, 124) ; Baum 1
    GUICtrlSetState($MAP, $GUI_DISABLE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _baum1()
    GUICtrlDelete($Baum1)
    GUICtrlSetState($MAP, $GUI_ENABLE)
    $Baums1 = GUICtrlCreatePic("Baumstamm_wiese.bmp", 296, 304, 52, 36) ; Baumstamm 1
    GUICtrlSetState($MAP, $GUI_DISABLE)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    $TG = GUICreate("The Cold", 850, 600, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_SYSMENU,$WS_POPUP,$WS_TABSTOP))
    GUISetBkColor(0x000000)
    $Start = GUICtrlCreateButton("Start", 350, 16, 163, 57)
    GUICtrlSetBkColor(-1,0x000000)
    GUICtrlSetColor(-1,0xff0000)
    $Profil = GUICtrlCreateButton("Profil", 350, 88, 163, 57)
    GUICtrlSetBkColor(-1,0x000000)
    GUICtrlSetColor(-1,0xff0000)
    $Exit = GUICtrlCreateButton("Exit", 350, 160, 163, 57)
    GUICtrlSetBkColor(-1,0x000000)
    GUICtrlSetColor(-1,0xff0000)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE, $Exit
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    ;;;;;;;;;;;;;;;;;;;;;;;; START ;;;;;;;;;;;;;;;;;;;;
    Case $start
    GUICtrlDelete($Start)
    GUICtrlDelete($Profil)
    GUICtrlDelete($Exit)
    _map_kulsav()
    $Exit = GUICtrlCreateButton("X", 808, 0, 27, 25)
    GUICtrlSetBkColor(-1,0x000000)
    GUICtrlSetColor(-1,0xff0000)

    [/autoit] [autoit][/autoit] [autoit]

    Case $Haus1
    MsgBox(0,"x","x1")

    [/autoit] [autoit][/autoit] [autoit]

    Case $Haus2
    MsgBox(0,"x","x2")

    [/autoit] [autoit][/autoit] [autoit]

    Case $Haus3
    MsgBox(0,"x","x3")

    [/autoit] [autoit][/autoit] [autoit]

    Case $Haus4
    MsgBox(0,"x","x4")

    [/autoit] [autoit][/autoit] [autoit]

    Case $Baum1
    _baum1()

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯