• Hi,

    bin grade dabei ein Multiplayer RPG zu machen. Der Titel und die Story stehen noch nicht ganz fest. Werde hier immer mal wieder den aktuellen Stand posten und auch nach und nach Sachen zum selbst ausprobieren rausgeben. Der Anfang macht mal die erste Grundversion des Mapeditors. Einfach rechts das "Objekt" auswählen und links die Map zusammen klicken. Beim schließen des Fensters wird das ganze dann gespeichert. Viel Spaß beim ausprobieren hehe.

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <Misc.au3>

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

    Opt("GuiOnEventMode", 1)
    Opt("MouseCoordMode", 2)

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

    OnAutoItExitRegister("_end")

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

    $Gui = GUICreate("Beispiel", 736, 608)
    GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "Chipsetauswahl")
    GUISetState(@SW_SHOW)

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

    Dim $selectedposx, $selectedposy

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

    _GDIPlus_Startup()

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

    $chipset = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\1.png")

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

    $graphic = _GDIPlus_GraphicsCreateFromHWND($Gui)
    $bitmap = _GDIPlus_BitmapCreateFromGraphics(736, 608, $graphic)
    $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)

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

    _GDIPlus_GraphicsClear($buffer, 0xFF000000)
    _GDIPlus_GraphicsDrawImageRectRect($buffer, $chipset, 0, 0, 256, 1024, 608, 0, 128, 512)
    _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    $pen = _GDIPlus_PenCreate(0xFFFFFF33,2)

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

    $mouscordsalt = MouseGetPos()
    $xposalt = 0
    $xposalt = 0
    While 1
    $mouscords = MouseGetPos()
    If $mouscordsalt[0] <> $mouscords[0] Or $mouscordsalt[1] <> $mouscords[1] Then
    $mouscordsalt[0] = $mouscords[0]
    $mouscordsalt[1] = $mouscords[1]

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

    If $mouscords[0] > 608 And $mouscords[1] > -1 And $mouscords[0] < 801 And $mouscords[1] < 513 Then
    $xpos = 608 + 16 * Round((($mouscords[0] - 7 - 608) / 16), 0)
    $ypos = 16 * Round((($mouscords[1] - 7) / 16), 0)
    If $xposalt <> $xpos Or $yposalt <> $ypos Then
    $xposalt = $xpos
    $yposalt = $ypos
    _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    _GDIPlus_GraphicsDrawRect($graphic, $xpos, $ypos, 16, 16,$pen)
    EndIf
    ElseIf $mouscords[0] > 0 And $mouscords[1] > -1 And $mouscords[0] < 608 And $mouscords[1] < 608 And $selectedposx <> "" Then
    $xpos = 16 * Round((($mouscords[0] - 7) / 16), 0)
    $ypos = 16 * Round((($mouscords[1] - 7) / 16), 0)
    If $xposalt <> $xpos Or $yposalt <> $ypos Then
    $xposalt = $xpos
    $yposalt = $ypos
    _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    _GDIPlus_GraphicsDrawImageRectRect($graphic, $chipset, ($selectedposx - 608) * 2, $selectedposy * 2, 32, 32, $xpos, $ypos, 16, 16)
    EndIf
    EndIf
    EndIf
    Sleep(100)
    WEnd

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

    Func Chipsetauswahl()
    If $mouscords[0] > 608 And $mouscords[1] > -1 And $mouscords[0] < 801 And $mouscords[1] < 513 Then
    _GDIPlus_GraphicsFillRect($buffer, 608, 0, 128, 512)
    _GDIPlus_GraphicsDrawImageRectRect($buffer, $chipset, 0, 0, 256, 1024, 608, 0, 128, 512)
    $selectedposx = 608 + 16 * Round((($mouscords[0] - 5 - 608) / 16), 0)
    $selectedposy = 16 * Round((($mouscords[1] - 5) / 16), 0)
    _GDIPlus_GraphicsDrawRect($buffer, $selectedposx, $selectedposy, 16, 16,$pen)
    _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    ElseIf $mouscords[0] > 0 And $mouscords[1] > -1 And $mouscords[0] < 608 And $mouscords[1] < 608 And $selectedposx <> "" Then
    $xpos = 16 * Round((($mouscords[0] - 7) / 16), 0)
    $ypos = 16 * Round((($mouscords[1] - 7) / 16), 0)
    _GDIPlus_GraphicsDrawImageRectRect($buffer, $chipset, ($selectedposx - 608) * 2, $selectedposy * 2, 32, 32, $xpos, $ypos, 16, 16)
    _GDIPlus_GraphicsDrawImage($graphic, $bitmap, 0, 0)
    EndIf
    EndFunc ;==>Chipsetauswahl

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

    Func CLOSEClicked()
    Exit
    EndFunc ;==>CLOSEClicked

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

    Func _end()
    $klon = _GDIPlus_BitmapCloneArea($bitmap, 0, 0, 608, 608)
    _GDIPlus_ImageSaveToFile($klon, @ScriptDir & "\GDIPlus_Image.png")
    _GDIPlus_PenDispose($pen)
    _GDIPlus_ImageDispose($chipset)
    _GDIPlus_GraphicsDispose($graphic)
    _GDIPlus_GraphicsDispose($buffer)
    _GDIPlus_BitmapDispose($bitmap)
    _GDIPlus_BitmapDispose($klon)
    _GDIPlus_Shutdown()
    EndFunc ;==>_end

    [/autoit]

    Bilder

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • Hab mal was ähnliches gemacht, wirklich teilnehmen kann ich leider nicht da ich im Moment 3 Sachen am machen bin... aber bei fragen oder so kann ich evtl helfen ;) Hab deine letzten Threads zum Thema verfolgt.

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake