Jump to content

Screensaver With Text


Recommended Posts

#include <GUIConstants.au3>
$gSpeed   = (50)
$gFieldColor = (0)
$gRandColor  = (1)
$gFontSize   = (25)
Func SaverWindow($nWidth, $nHeight, $nLeft, $nTop, $hParent = 0)
    MouseMove($nWidth + 1, $nHeight + 1, 0)
    $mPos = MouseGetPos() 
    $hGUI = GUICreate("", $nWidth, $nHeight, $nLeft, $nTop, $WS_POPUPWINDOW, $WS_EX_TOPMOST, $hParent)
    GUISetBkColor($gFieldColor)
    Local $labelx = Random(0, $nWidth), $labely = Random(0, $nHeight)
    Local $label = GUICtrlCreateLabel ( "AutoIt is simple, subtle, elegant.", $labelx, $labely, 1000, 300)
    GUICtrlSetColor ( $label, 0xFFFFFF)
    GUICtrlSetFont ($label, $gFontSize )

    GUISetState()
    
    While 1
        $msg = GuiGetMsg()
        $mcPos = MouseGetPos()
        If $mPos[0] <> $mcPos[0] or $mPos[1] <> $mcPos[1] or $msg = $GUI_EVENT_CLOSE Then
            GUIDelete($hGUI)
            Return
        EndIf
        $labelx = $labelx + 5
        If $labelx > $nWidth Then
            $labelx = 0
            $labely = Random(0, $nHeight)
        EndIf
        GUICtrlSetPos ( $label, $labelx, $labely )
        Sleep(50 - $gSpeed)
    WEnd
EndFunc
SaverWindow(@DesktopWidth, @DesktopHeight, 0, 0)

EDIT (05:25 PM): Tested code, corrected errors, posted new code.

EDIT (05:47 PM): Spelling error: subtile -> subtle

#)

Edited by nfwu
Link to comment
Share on other sites

D@/\/\N, way to go all out

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

#include <GUIConstants.au3>
$gSpeed   = (50)
$gFieldColor = (0)
$gRandColor  = (1)
$gFontSize   = (25)
Func SaverWindow($nWidth, $nHeight, $nLeft, $nTop, $hParent = 0)
    MouseMove($nWidth + 1, $nHeight + 1, 0)
    $mPos = MouseGetPos() 
    $hGUI = GUICreate("", $nWidth, $nHeight, $nLeft, $nTop, $WS_POPUPWINDOW, $WS_EX_TOPMOST, $hParent)
    GUISetBkColor($gFieldColor)
    Local $labelx = Random(0, $nWidth), $labely = Random(0, $nHeight)
    Local $label = GUICtrlCreateLabel ( "AutoIt is simple, subtle, elegant.", $labelx, $labely, 1000, 300)
    GUICtrlSetColor ( $label, 0xFFFFFF)
    GUICtrlSetFont ($label, $gFontSize )

    GUISetState()
    
    While 1
        $msg = GuiGetMsg()
        $mcPos = MouseGetPos()
        If $mPos[0] <> $mcPos[0] or $mPos[1] <> $mcPos[1] or $msg = $GUI_EVENT_CLOSE Then
            GUIDelete($hGUI)
            Return
        EndIf
        $labelx = $labelx + 5
        If $labelx > $nWidth Then
            $labelx = 0
            $labely = Random(0, $nHeight)
        EndIf
        GUICtrlSetPos ( $label, $labelx, $labely )
        Sleep(50 - $gSpeed)
    WEnd
EndFunc
SaverWindow(@DesktopWidth, @DesktopHeight, 0, 0)

EDIT (05:25 PM): Tested code, corrected errors, posted new code.

EDIT (05:47 PM): Spelling error: subtile -> subtle

#)

Thanks

And is it possible that the text turning around or moving diagonal over the screen?

Sapiente vince, rex, noli vincere ferro!

Link to comment
Share on other sites

Thanks

And is it possible that the text turning around or moving diagonal over the screen?

Why not just use the 3D Text that comes with Windows. :think:


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Thanks

And is it possible that the text turning around or moving diagonal over the screen?

That sounds like what my AutoIt3D was planned to be capable of... problem is that I haven't completed it.

(It's been on hold for 3 months?)

@BigDod: Good Alternative!

#)

Link to comment
Share on other sites

$labelx = $labelx + 5
        If $labelx > $nWidth Then
            $labelx = 0                <=== This Line
            $labely = Random(0, $nHeight)

Changed to -500 and instead of starting at the far left of the screen it scrolled onto the screen, this value only worked for the message "AutoIt is simple, subtle, elegant." for any other you would have to do some width calculation based on the length of the text and then multiply that by the pixel width of the font chosen, or something like that ... LOL

Just saw this post and I like what this script does :think:

Laterzzz,

Onoitsu2

Things I have made:[font="Trebuchet Ms"]_CheckTimeBlock UDF(LT)MOH Call Ignore List (MOH = Modem On Hold)[/font]

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...