Jump to content

Scrolling Banner


Skrip
 Share

Recommended Posts

Check it out..

Dim $test
Dim $set

Banner("Thank you for using our program.", 500, 17, @DesktopWidth / 2 - 250, @DesktopHeight / 2 + 222, 1, 0.075, 1)
Banner("Written by Firestorm, with AutoIt", 500, 17, @DesktopWidth / 2 - 250, @DesktopHeight / 2 + 222, 1, 0.075, 0)

Func Banner($text, $w, $h, $posx, $posy, $opt, $wait = 0.075, $unscroll = 1)
    $set = 0
    $stop = 0
    Do
        $set = $set + 1
        $string = StringLeft($text, $set)
        SplashTextOn("", $string, $w, $h, $posx, $posy, $opt)
        Sleep($wait * 1000)
        If $string = $text Then
            Sleep(750)
            $stop = 1
        EndIf
    Until $stop = 1
    $stop = 0
    If $unscroll = 1 Then
        Do
            $set = $set - 1
            $string = StringLeft($text, $set)
            SplashTextOn("", $string, $w, $h, $posx, $posy, $opt)
            Sleep($wait * 1000 / 2)
            If $string = "" Then
                $stop = 1
            EndIf
        Until $stop = 1
    EndIf
    SplashOff()
EndFunc ;==>Banner
Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

I'm not getting a flicker here...lol.

EDIT: Well, the text does flicker a bit. Not too noticable on my PC though.

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

I get the flicker too but I suspect that it's hardware related. Monitor refresh rate perhaps?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

i've always fixed flickering by playing with wm_paint, but each time its hard to do.

-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]
Link to comment
Share on other sites

Nice work but ... it flickers here too :D

EDIT: After playing a little with the code i managed to eliminate the flicker :D

Dim $test
Dim $set

_Banner("Thank you for using our program.", 500, 17, @DesktopWidth / 2 - 250, @DesktopHeight / 2 + 222, 1, 0.075, 1)
_Banner("Written by Firestorm & Updated by L|M|TER", 500, 17, @DesktopWidth / 2 - 250, @DesktopHeight / 2 + 222, 1, 0.075, 0)

Func _Banner($text, $w, $h, $posx, $posy, $opt, $wait = 0.075, $unscroll = 1)
    $set = 0
    $stop = 0
 SplashTextOn("L|M|TER Banner", "", $w, $h, $posx, $posy, $opt)
    Do
        $set = $set + 1
        $string = StringLeft($text, $set)
        ControlSetText("L|M|TER Banner", "", "Static1", $string)
        Sleep($wait * 1000)
        If $string = $text Then
            Sleep(750)
            $stop = 1
        EndIf
  Sleep(20)
    Until $stop = 1
 $stop = 0
    If $unscroll = 1 Then
        Do
            $set = $set - 1
            $string = StringLeft($text, $set)
            ControlSetText("L|M|TER Banner", "", "Static1", $string)
            Sleep($wait * 1000 / 2)
            If $string = "" Then
                $stop = 1
            EndIf
   Sleep(10)
        Until $stop = 1
    EndIf
    SplashOff()
EndFunc
Edited by LIMITER
Link to comment
Share on other sites

Nice work but ... it flickers here too :D

EDIT: After playing a little with the code i managed to eliminate the flicker :D

Dim $test
Dim $set

_Banner("Thank you for using our program.", 500, 17, @DesktopWidth / 2 - 250, @DesktopHeight / 2 + 222, 1, 0.075, 1)
_Banner("Written by Firestorm & Updated by L|M|TER", 500, 17, @DesktopWidth / 2 - 250, @DesktopHeight / 2 + 222, 1, 0.075, 0)

Func _Banner($text, $w, $h, $posx, $posy, $opt, $wait = 0.075, $unscroll = 1)
    $set = 0
    $stop = 0
 SplashTextOn("L|M|TER Banner", "", $w, $h, $posx, $posy, $opt)
    Do
        $set = $set + 1
        $string = StringLeft($text, $set)
        ControlSetText("L|M|TER Banner", "", "Static1", $string)
        Sleep($wait * 1000)
        If $string = $text Then
            Sleep(750)
            $stop = 1
        EndIf
  Sleep(20)
    Until $stop = 1
 $stop = 0
    If $unscroll = 1 Then
        Do
            $set = $set - 1
            $string = StringLeft($text, $set)
            ControlSetText("L|M|TER Banner", "", "Static1", $string)
            Sleep($wait * 1000 / 2)
            If $string = "" Then
                $stop = 1
            EndIf
   Sleep(10)
        Until $stop = 1
    EndIf
    SplashOff()
EndFunc
Ah ha! Very nice (I think..I don't get the flicker) I do not see any flicker here, or on my version, but if this works better..by all means! :)

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...