Texte einblenden

  • Meine Frage ist folgende:
    lassen sich mit Auto it Texte in eine Grafische Anwendung (Game im Vollbild) ohne größeren Aufwand einblenden?

    So in der Richtung wie Teamspeak overlay.

    2 Mal editiert, zuletzt von Vollnoob (1. August 2007 um 16:15)

  • hat jemand ein Bsp, zum Posten, in dem das ein bisschen nachvollziehbar dargestellt wird?

  • Also der Tooltip funzt schon, aber nur wenn er dauernd aktualisiert wird,

    [autoit]

    while 1
    sleep (1)
    tooltip ("hallo")
    wend

    [/autoit]


    und dann nur flackernd.

  • Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>
    #NoTrayIcon

    AutoItSetOption("TrayMenuMode",1)
    dim $Title,$OldTitle
    dim $song
    dim $hwnd

    $exititem = TrayCreateItem("Exit")
    TraySetState()
    $hwnd = GUICreate("Winamp Tool",500,20,(@DesktopWidth-550),1,$WS_POPUP,BitOR($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
    GUISetBkColor(0xFF0000)
    GUISetState()

    While 1
    $msg = TrayGetMsg()
    Select
    Case $msg = $exititem
    ExitLoop
    EndSelect
    $OldTitle=$Title
    AutoItSetOption("WinTitleMatchMode", 4)

    $Title=WinGetTitle("classname=Winamp v1.x")
    if $OldTitle<>$Title then
    $song=ParseTitle($Title)
    $rgn = CreateTextRgn($hwnd,$song,20,"Arial",1000)
    SetWindowRgn($hwnd,$rgn)
    EndIf
    WEnd
    Func ParseTitle($Title)
    $loc=StringInstr($Title,". ")
    $ParsedTitle=StringTrimLeft($Title,$loc+1)
    $loc=StringInstr($ParsedTitle," - Winamp",0,-1)
    $ParsedTitle=StringLeft($ParsedTitle,$loc)
    Return $ParsedTitle
    EndFunc
    Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
    EndFunc

    ;Func CombineRgn(ByRef $rgn1, ByRef $rgn2)
    ; DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 2)
    ;EndFunc

    Func CreateTextRgn(ByRef $CTR_hwnd,$CTR_Text,$CTR_height,$CTR_font="Microsoft Sans Serif",$CTR_weight=1000)
    Local Const $ANSI_CHARSET = 0
    Local Const $OUT_CHARACTER_PRECIS = 2
    Local Const $CLIP_DEFAULT_PRECIS = 0
    Local Const $PROOF_QUALITY = 2
    Local Const $FIXED_PITCH = 1
    Local Const $RGN_XOR = 3

    If $CTR_font = "" Then $CTR_font = "Microsoft Sans Serif"
    If $CTR_weight = -1 Then $CTR_weight = 1000
    Local $gdi_dll = DLLOpen("gdi32.dll")
    Local $CTR_hDC= DLLCall("user32.dll","int","GetDC","hwnd",$CTR_hwnd)
    Local $CTR_hMyFont = DLLCall($gdi_dll,"hwnd","CreateFont","int",$CTR_height,"int",0,"int",0,"int",0, _
    "int",$CTR_weight,"int",0,"int",0,"int",0,"int",$ANSI_CHARSET,"int",$OUT_CHARACTER_PRECIS, _
    "int",$CLIP_DEFAULT_PRECIS,"int",$PROOF_QUALITY,"int",$FIXED_PITCH,"str",$CTR_font )
    Local $CTR_hOldFont = DLLCall($gdi_dll,"hwnd","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hMyFont[0])
    DLLCall($gdi_dll,"int","BeginPath","int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","TextOut","int",$CTR_hDC[0],"int",0,"int",0,"str",$CTR_Text,"int",StringLen($CTR_Text))
    DLLCall($gdi_dll,"int","EndPath","int",$CTR_hDC[0])
    Local $CTR_hRgn1 = DLLCall($gdi_dll,"hwnd","PathToRegion","int",$CTR_hDC[0])
    Local $CTR_rc = DLLStructCreate("int;int;int;int")
    DLLCall($gdi_dll,"int","GetRgnBox","hwnd",$CTR_hRgn1[0],"ptr",DllStructGetPtr($CTR_rc))
    Local $CTR_hRgn2 = DLLCall($gdi_dll,"hwnd","CreateRectRgnIndirect","ptr",DllStructGetPtr($CTR_rc))
    DLLCall($gdi_dll,"int","CombineRgn","hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn2[0],"hwnd",$CTR_hRgn1[0],"int",$RGN_XOR)
    DLLCall($gdi_dll,"int","DeleteObject","hwnd",$CTR_hRgn1[0])
    DLLCall("user32.dll","int","ReleaseDC","hwnd",$CTR_hwnd,"int",$CTR_hDC[0])
    DLLCall($gdi_dll,"int","SelectObject","int",$CTR_hDC[0],"hwnd",$CTR_hOldFont[0])
    DLLClose($gdi_dll)
    Return $CTR_hRgn2[0]
    EndFunc

    [/autoit]

    ob es nachvollziehbar für dich ist weis ich nicht aber ich denke sowas suchst du? für weiteres kann man ja mal im englischen Forum suchen

  • Ich glaube, da komme ich später nochmal darauf zurück ;)
    Da muss ich wohl noch einiges lernen.

    Danke trotzdem.

    Ich geh mal davon aus, dass Splashtext, die sellbe Überblendwirkung hat wie Tooltip, oder?

    Einmal editiert, zuletzt von Vollnoob (2. August 2007 um 09:58)