Sign in to follow this  
Followers 0
andybiochem

Elastic Radio Buttons!

20 posts in this topic

Thought I'd give transcribing some Javascript into AutoIT a try.

Have fun:

;====== Elastic Trail script ======
; Original Javascript by Philip Winston - pwinston@yahoo.com
; Adapted for AutoIT by AndyBiochem

#include <GUIConstantsEx.au3>

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

;----- Variables -----
Global $iDots = 7       ;Number of dots
Global $aDots[$iDots][5] ;Dots array
Global $iXpos = 0
Global $iYpos = 0
Global $iDeltaT = 0.01
Global $iSegLen = 10
Global $iSpringK = 10
Global $iMass = 1
Global $iXGravity = 0
Global $iYGravity = 50
Global $iRes = 10
Global $iStopVel = 0.1
Global $iStopAcc = 0.1
Global $iDotSize = 13
Global $iBounce = 0.75

Global $iHeight = 700
Global $iWidth = 700

;----- GUI -----
GUICreate("",$iHeight,$iWidth)
GUISetOnEvent($GUI_EVENT_CLOSE,"_Close")

;----- 'Dots' -----
For $i = 1 to ($iDots - 1)
    $aDots[$i][0] = GUICtrlCreateRadio("", 144, 160,$iDotSize,$iDotSize)
Next

GUISetState(@SW_SHOW)
;############### LOOP ###############
While 1
    
    Sleep(20)
    
    $m = MouseGetPos()
    $iXpos = $m[0]
    $iYpos = $m[1]
    
    _Animate()
    
WEnd
;####################################


Func _Animate() 

    $aDots[0][1] = $iXpos
    $aDots[0][2] = $iYpos
    
    GUICtrlSetPos($aDots[0][0],$aDots[0][1],$aDots[0][2])

    for $i = 1 to ($iDots - 1)
        
        Dim $spring[3]
        $spring[1] = 0
        $spring[2] = 0

        _Spring_Force($i-1, $i, $spring)
        If $i < ($iDots - 1) Then _Spring_Force($i+1, $i, $spring)
        
        Dim $resist[3]
        $resist[1] = -$aDots[$i][3] * $iRes
        $resist[2] = -$aDots[$i][4] * $iRes
        

        Dim $accel[3]
        $accel[1] = ($spring[1] + $resist[1])/$iMass + $iXGravity
        $accel[2] = ($spring[2] + $resist[2])/ $iMass + $iYGravity
        
        $aDots[$i][3] += ($iDeltaT * $accel[1])
        $aDots[$i][4] += ($iDeltaT * $accel[2])
        

        If abs($aDots[$i][3]) < $iStopVel And abs($aDots[$i][4]) < $iStopVel And abs($accel[1]) < $iStopAcc And abs($accel[2]) < $iStopAcc Then
            $aDots[$i][3] = 0
            $aDots[$i][4] = 0
        EndIf
        
        $aDots[$i][1] += $aDots[$i][3]
        $aDots[$i][2]+= $aDots[$i][4]
        
        if ($aDots[$i][2] <  0) Then
            if ($aDots[$i][4] < 0) Then $aDots[$i][4]= $iBounce * -$aDots[$i][4]
            $aDots[$i][2]= 0
        EndIf

        if ($aDots[$i][2] >=  $iHeight - $iDotSize - 1) Then
            if ($aDots[$i][4] > 0) Then $aDots[$i][4]= $iBounce * -$aDots[$i][4]
            $aDots[$i][2]= $iHeight - $iDotSize - 1
        EndIf
        
        if ($aDots[$i][1] >= $iWidth - $iDotSize) Then
            if ($aDots[$i][3]> 0) Then $aDots[$i][3]= $iBounce * -$aDots[$i][3]
            $aDots[$i][1]= $iWidth - $iDotSize - 1
        EndIf
        
        if ($aDots[$i][1] < 0) Then
            if ($aDots[$i][3] < 0) Then $aDots[$i][3]= $iBounce * -$aDots[$i][3]
            $aDots[$i][1]= 0
        EndIf
        
        GUICtrlSetPos($aDots[$i][0],$aDots[$i][1],$aDots[$i][2])
    
    Next

EndFunc


Func _Spring_Force($i, $j, ByRef $spring)
    
    Local $springF

    $dx = $aDots[$i][1] - $aDots[$j][1]
    $dy = $aDots[$i][2] - $aDots[$j][2]
    $len = Sqrt($dx^2 + $dy^2)
    
    If Not ($len > $iSegLen) Then Return
    
    $springF = $iSpringK * ($len - $iSegLen)
    $spring[1] += ($dx / $len) * $springF
    $spring[2] += ($dy / $len) * $springF

EndFunc


Func _Close()
    Exit
EndFunc

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites



That's really neat, looks like something I would have done!!

... but, not real useful... :)

Thanks for sharing!!

Valuater

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thats realy cool :)

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

Really nice effect :think:... maybe I could be useful. Creating a container with TrueCrypt, TC always asks to move the move on the TC window to create a random encryption string. Adding this function might imho enhance the 'randomness' :):lmao: (entropy ?) of that string.

Share this post


Link to post
Share on other sites

Wants it back? lol

Looks so real.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Completely useless but I really like it! Nice piece of work.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

;====== Elastic Trail script ======
; Original Javascript by Philip Winston - pwinston@yahoo.com
; Adapted for AutoIT by AndyBiochem

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>

;----- Variables -----
Global $iDots = 7         ;Number of dots
Global $aDots[$iDots][5] ;Dots array
Global $iXpos = 0
Global $iYpos = 0
Global $iDeltaT = 0.01
Global $iSegLen = 10
Global $iSpringK = 10
Global $iMass = 1
Global $iXGravity = 0
Global $iYGravity = 50
Global $iRes = 10
Global $iStopVel = 0.1
Global $iStopAcc = 0.1
Global $iDotSize = 5
Global $iBounce = 0.75

Global $iHeight = @DesktopHeight
Global $iWidth = @DesktopWidth

;----- 'Dots' -----
For $i = 1 to ($iDots - 1)
    $aDots[$i][0] = GUICreate("",$iDotSize,$iDotSize,144,160,$WS_POPUP,$WS_EX_TOOLWINDOW)
    GUISetBkColor(_RandomColor())
    GUISetState(@SW_SHOW)
Next

;############### LOOP ###############
While 1
    
    Sleep(20)
    
    $m = MouseGetPos()
    $iXpos = $m[0]
    $iYpos = $m[1]
    
    _Animate()
    
WEnd
;####################################


Func _Animate()    

    $aDots[0][1] = $iXpos
    $aDots[0][2] = $iYpos
    
    WinMove($aDots[0][0],"",$aDots[0][1],$aDots[0][2])

    for $i = 1 to ($iDots - 1)
        
        Dim $spring[3]
        $spring[1] = 0
        $spring[2] = 0

        _Spring_Force($i-1, $i, $spring)
        If $i < ($iDots - 1) Then _Spring_Force($i+1, $i, $spring)
        
        Dim $resist[3]
        $resist[1] = -$aDots[$i][3] * $iRes
        $resist[2] = -$aDots[$i][4] * $iRes
        

        Dim $accel[3]
        $accel[1] = ($spring[1] + $resist[1])/$iMass + $iXGravity
        $accel[2] = ($spring[2] + $resist[2])/ $iMass + $iYGravity
        
        $aDots[$i][3] += ($iDeltaT * $accel[1])
        $aDots[$i][4] += ($iDeltaT * $accel[2])
        

        If abs($aDots[$i][3]) < $iStopVel And abs($aDots[$i][4]) < $iStopVel And abs($accel[1]) < $iStopAcc And abs($accel[2]) < $iStopAcc Then
            $aDots[$i][3] = 0
            $aDots[$i][4] = 0
        EndIf
        
        $aDots[$i][1] += $aDots[$i][3]
        $aDots[$i][2]+= $aDots[$i][4]
        
        if ($aDots[$i][2] <  0) Then
            if ($aDots[$i][4] < 0) Then $aDots[$i][4]= $iBounce * -$aDots[$i][4]
            $aDots[$i][2]= 0
        EndIf

        if ($aDots[$i][2] >=  $iHeight - $iDotSize - 1) Then
            if ($aDots[$i][4] > 0) Then $aDots[$i][4]= $iBounce * -$aDots[$i][4]
            $aDots[$i][2]= $iHeight - $iDotSize - 1
        EndIf
        
        if ($aDots[$i][1] >= $iWidth - $iDotSize) Then
            if ($aDots[$i][3]> 0) Then $aDots[$i][3]= $iBounce * -$aDots[$i][3]
            $aDots[$i][1]= $iWidth - $iDotSize - 1
        EndIf
        
        if ($aDots[$i][1] < 0) Then
            if ($aDots[$i][3] < 0) Then $aDots[$i][3]= $iBounce * -$aDots[$i][3]
            $aDots[$i][1]= 0
        EndIf
        
        WinMove($aDots[$i][0],"",$aDots[$i][1],$aDots[$i][2])
    
    Next

EndFunc


Func _Spring_Force($i, $j, ByRef $spring)
    
    Local $springF

    $dx = $aDots[$i][1] - $aDots[$j][1]
    $dy = $aDots[$i][2] - $aDots[$j][2]
    $len = Sqrt($dx^2 + $dy^2)
    
    If Not ($len > $iSegLen) Then Return
    
    $springF = $iSpringK * ($len - $iSegLen)
    $spring[1] += ($dx / $len) * $springF
    $spring[2] += ($dy / $len) * $springF

EndFunc

Func _RandomColor()
    $r = "0x"
    For $i = 0 to 2
        $r &= Hex(Random(0,255),2)
    Next
    Return $r
EndFunc


Func _Close()
    Exit
EndFunc

Edited by Manadar

Share this post


Link to post
Share on other sites

;====== Elastic Trail script ======
; Original Javascript by Philip Winston - pwinston@yahoo.com
; Adapted for AutoIT by AndyBiochem

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>

;----- Variables -----
Global $iDots = 7         ;Number of dots
Global $aDots[$iDots][5] ;Dots array
Global $iXpos = 0
Global $iYpos = 0
Global $iDeltaT = 0.01
Global $iSegLen = 10
Global $iSpringK = 10
Global $iMass = 1
Global $iXGravity = 0
Global $iYGravity = 50
Global $iRes = 10
Global $iStopVel = 0.1
Global $iStopAcc = 0.1
Global $iDotSize = 5
Global $iBounce = 0.75

Global $iHeight = @DesktopHeight
Global $iWidth = @DesktopWidth

;----- 'Dots' -----
For $i = 1 to ($iDots - 1)
    $aDots[$i][0] = GUICreate("",$iDotSize,$iDotSize,144,160,$WS_POPUP,$WS_EX_TOOLWINDOW)
    GUISetBkColor(_RandomColor())
    GUISetState(@SW_SHOW)
Next

;############### LOOP ###############
While 1
    
    Sleep(20)
    
    $m = MouseGetPos()
    $iXpos = $m[0]
    $iYpos = $m[1]
    
    _Animate()
    
WEnd
;####################################


Func _Animate()    

    $aDots[0][1] = $iXpos
    $aDots[0][2] = $iYpos
    
    WinMove($aDots[0][0],"",$aDots[0][1],$aDots[0][2])

    for $i = 1 to ($iDots - 1)
        
        Dim $spring[3]
        $spring[1] = 0
        $spring[2] = 0

        _Spring_Force($i-1, $i, $spring)
        If $i < ($iDots - 1) Then _Spring_Force($i+1, $i, $spring)
        
        Dim $resist[3]
        $resist[1] = -$aDots[$i][3] * $iRes
        $resist[2] = -$aDots[$i][4] * $iRes
        

        Dim $accel[3]
        $accel[1] = ($spring[1] + $resist[1])/$iMass + $iXGravity
        $accel[2] = ($spring[2] + $resist[2])/ $iMass + $iYGravity
        
        $aDots[$i][3] += ($iDeltaT * $accel[1])
        $aDots[$i][4] += ($iDeltaT * $accel[2])
        

        If abs($aDots[$i][3]) < $iStopVel And abs($aDots[$i][4]) < $iStopVel And abs($accel[1]) < $iStopAcc And abs($accel[2]) < $iStopAcc Then
            $aDots[$i][3] = 0
            $aDots[$i][4] = 0
        EndIf
        
        $aDots[$i][1] += $aDots[$i][3]
        $aDots[$i][2]+= $aDots[$i][4]
        
        if ($aDots[$i][2] <  0) Then
            if ($aDots[$i][4] < 0) Then $aDots[$i][4]= $iBounce * -$aDots[$i][4]
            $aDots[$i][2]= 0
        EndIf

        if ($aDots[$i][2] >=  $iHeight - $iDotSize - 1) Then
            if ($aDots[$i][4] > 0) Then $aDots[$i][4]= $iBounce * -$aDots[$i][4]
            $aDots[$i][2]= $iHeight - $iDotSize - 1
        EndIf
        
        if ($aDots[$i][1] >= $iWidth - $iDotSize) Then
            if ($aDots[$i][3]> 0) Then $aDots[$i][3]= $iBounce * -$aDots[$i][3]
            $aDots[$i][1]= $iWidth - $iDotSize - 1
        EndIf
        
        if ($aDots[$i][1] < 0) Then
            if ($aDots[$i][3] < 0) Then $aDots[$i][3]= $iBounce * -$aDots[$i][3]
            $aDots[$i][1]= 0
        EndIf
        
        WinMove($aDots[$i][0],"",$aDots[$i][1],$aDots[$i][2])
    
    Next

EndFunc


Func _Spring_Force($i, $j, ByRef $spring)
    
    Local $springF

    $dx = $aDots[$i][1] - $aDots[$j][1]
    $dy = $aDots[$i][2] - $aDots[$j][2]
    $len = Sqrt($dx^2 + $dy^2)
    
    If Not ($len > $iSegLen) Then Return
    
    $springF = $iSpringK * ($len - $iSegLen)
    $spring[1] += ($dx / $len) * $springF
    $spring[2] += ($dy / $len) * $springF

EndFunc

Func _RandomColor()
    $r = "0x"
    For $i = 0 to 2
        $r &= Hex(Random(0,255),2)
    Next
    Return $r
EndFunc


Func _Close()
    Exit
EndFunc
Cool!

You meant this?

;====== Elastic Trail script ======
; Original Javascript by Philip Winston - pwinston@yahoo.com
; Adapted for AutoIT by AndyBiochem

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>

;----- Variables -----
Global $iDots = 7;Number of dots
Global $aDots[$iDots][5];Dots array
Global $iXpos = 0
Global $iYpos = 0
Global $iDeltaT = 0.01
Global $iSegLen = 10
Global $iSpringK = 10
Global $iMass = 1
Global $iXGravity = 0
Global $iYGravity = 50
Global $iRes = 10
Global $iStopVel = 0.1
Global $iStopAcc = 0.1
Global $iDotSize = 5
Global $iBounce = 0.75

Global $iHeight = @DesktopHeight
Global $iWidth = @DesktopWidth

;----- 'Dots' -----
For $i = 1 To ($iDots - 1)
    $aDots[$i][0] = GUICreate("", $iDotSize, $iDotSize, 144, 160, $WS_POPUP, $WS_EX_TOOLWINDOW)
    GUISetBkColor(_RandomColor())
    GUISetState(@SW_SHOW)
Next

;############### LOOP ###############
While 1

    Sleep(20)

    $m = MouseGetPos()
    $iXpos = $m[0]
    $iYpos = $m[1]

    _Animate()

WEnd
;####################################


Func _Animate()

    $aDots[0][1] = $iXpos
    $aDots[0][2] = $iYpos

    For $i = 1 To ($iDots - 1)

        Local $spring[3]
        $spring[1] = 0
        $spring[2] = 0

        _Spring_Force($i - 1, $i, $spring)
        If $i < ($iDots - 1) Then _Spring_Force($i + 1, $i, $spring)

        Local $resist[3]
        $resist[1] = -$aDots[$i][3] * $iRes
        $resist[2] = -$aDots[$i][4] * $iRes


        Local $accel[3]
        $accel[1] = ($spring[1] + $resist[1]) / $iMass + $iXGravity
        $accel[2] = ($spring[2] + $resist[2]) / $iMass + $iYGravity

        $aDots[$i][3] += ($iDeltaT * $accel[1])
        $aDots[$i][4] += ($iDeltaT * $accel[2])


        If Abs($aDots[$i][3]) < $iStopVel And Abs($aDots[$i][4]) < $iStopVel And Abs($accel[1]) < $iStopAcc And Abs($accel[2]) < $iStopAcc Then
            $aDots[$i][3] = 0
            $aDots[$i][4] = 0
        EndIf

        $aDots[$i][1] += $aDots[$i][3]
        $aDots[$i][2] += $aDots[$i][4]

        If ($aDots[$i][2] < 0) Then
            If ($aDots[$i][4] < 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4]
            $aDots[$i][2] = 0
        EndIf

        If ($aDots[$i][2] >= $iHeight - $iDotSize - 1) Then
            If ($aDots[$i][4] > 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4]
            $aDots[$i][2] = $iHeight - $iDotSize - 1
        EndIf

        If ($aDots[$i][1] >= $iWidth - $iDotSize) Then
            If ($aDots[$i][3] > 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3]
            $aDots[$i][1] = $iWidth - $iDotSize - 1
        EndIf

        If ($aDots[$i][1] < 0) Then
            If ($aDots[$i][3] < 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3]
            $aDots[$i][1] = 0
        EndIf

        WinMove($aDots[$i][0], 0, $aDots[$i][1], $aDots[$i][2])

    Next

EndFunc  ;==>_Animate


Func _Spring_Force($i, $j, ByRef $spring)

    Local $springF

    $dx = $aDots[$i][1] - $aDots[$j][1]
    $dy = $aDots[$i][2] - $aDots[$j][2]
    $len = Sqrt($dx ^ 2 + $dy ^ 2)

    If Not ($len > $iSegLen) Then Return

    $springF = $iSpringK * ($len - $iSegLen)
    $spring[1] += ($dx / $len) * $springF
    $spring[2] += ($dy / $len) * $springF

EndFunc  ;==>_Spring_Force

Func _RandomColor()
    $r = "0x"
    For $i = 0 To 2
        $r &= Hex(Random(0, 255), 2)
    Next
    Return $r
EndFunc  ;==>_RandomColor


Func _Close()
    Exit
EndFunc  ;==>_Close

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

or this :)

;====== Elastic Trail script ======
; Original Javascript by Philip Winston - pwinston@yahoo.com
; Adapted for AutoIT by AndyBiochem

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>

;----- Variables -----
Global $iDots = 7;Number of dots
Global $aDots[$iDots][5];Dots array
Global $iXpos = 0
Global $iYpos = 0
Global $iDeltaT = 0.01
Global $iSegLen = 10
Global $iSpringK = 10
Global $iMass = 1
Global $iXGravity = 0
Global $iYGravity = 50
Global $iRes = 10
Global $iStopVel = 0.1
Global $iStopAcc = 0.1
Global $iDotSize = 25
Global $iBounce = 0.75

Global $iHeight = @DesktopHeight
Global $iWidth = @DesktopWidth

;----- 'Dots' -----
For $i = 1 To ($iDots - 1)
    $iDotSize-=2
    $aDots[$i][0] = GUICreate("", $iDotSize, $iDotSize, 144, 160, $WS_POPUP, $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
    _GuiRoundCorners($aDots[$i][0], $iDotSize/2, $iDotSize/2, $iDotSize/2, $iDotSize/2)
    GUISetBkColor(_RandomColor())
    GUISetState(@SW_SHOW)
Next

;############### LOOP ###############
While 1

    Sleep(10)

    $m = MouseGetPos()
    $iXpos = $m[0]
    $iYpos = $m[1]

    _Animate()

WEnd
;####################################


Func _Animate()

    $aDots[0][1] = $iXpos
    $aDots[0][2] = $iYpos

    For $i = 1 To ($iDots - 1)

        Local $spring[3]
        $spring[1] = 0
        $spring[2] = 0

        _Spring_Force($i - 1, $i, $spring)
        If $i < ($iDots - 1) Then _Spring_Force($i + 1, $i, $spring)

        Local $resist[3]
        $resist[1] = -$aDots[$i][3] * $iRes
        $resist[2] = -$aDots[$i][4] * $iRes


        Local $accel[3]
        $accel[1] = ($spring[1] + $resist[1]) / $iMass + $iXGravity
        $accel[2] = ($spring[2] + $resist[2]) / $iMass + $iYGravity

        $aDots[$i][3] += ($iDeltaT * $accel[1])
        $aDots[$i][4] += ($iDeltaT * $accel[2])


        If Abs($aDots[$i][3]) < $iStopVel And Abs($aDots[$i][4]) < $iStopVel And Abs($accel[1]) < $iStopAcc And Abs($accel[2]) < $iStopAcc Then
            $aDots[$i][3] = 0
            $aDots[$i][4] = 0
        EndIf

        $aDots[$i][1] += $aDots[$i][3]
        $aDots[$i][2] += $aDots[$i][4]

        If ($aDots[$i][2] < 0) Then
            If ($aDots[$i][4] < 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4]
            $aDots[$i][2] = 0
        EndIf

        If ($aDots[$i][2] >= $iHeight - $iDotSize - 1) Then
            If ($aDots[$i][4] > 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4]
            $aDots[$i][2] = $iHeight - $iDotSize - 1
        EndIf

        If ($aDots[$i][1] >= $iWidth - $iDotSize) Then
            If ($aDots[$i][3] > 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3]
            $aDots[$i][1] = $iWidth - $iDotSize - 1
        EndIf

        If ($aDots[$i][1] < 0) Then
            If ($aDots[$i][3] < 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3]
            $aDots[$i][1] = 0
        EndIf

        WinMove($aDots[$i][0], "", $aDots[$i][1], $aDots[$i][2])

    Next

EndFunc  ;==>_Animate


Func _Spring_Force($i, $j, ByRef $spring)

    Local $springF

    $dx = $aDots[$i][1] - $aDots[$j][1]
    $dy = $aDots[$i][2] - $aDots[$j][2]
    $len = Sqrt($dx ^ 2 + $dy ^ 2)

    If Not ($len > $iSegLen) Then Return

    $springF = $iSpringK * ($len - $iSegLen)
    $spring[1] += ($dx / $len) * $springF
    $spring[2] += ($dy / $len) * $springF

EndFunc  ;==>_Spring_Force

Func _RandomColor()
    $r = "0x"
    For $i = 0 To 2
        $r &= Hex(Random(0, 255), 2)
    Next
    Return $r
EndFunc  ;==>_RandomColor


Func _Close()
    Exit
EndFunc  ;==>_Close

Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3);==>_GuiRoundCorners
   Dim $pos, $ret, $ret2
   $pos = WinGetPos($h_win)
   $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long",  $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3,  "long", $i_y3)
   If $ret[0] Then
      $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1)
      If $ret2[0] Then
         Return 1
      Else
         Return 0
      EndIf
   Else
      Return 0
   EndIf
EndFunc;==>_GuiRoundCorners
Edited by sandin

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Cool!

You meant this?

No, help file says:

WinMove ( "title", "text", x, y [, width [, height[, speed]]] )

"text" is a string, so not to specify it you would put an empty string like so "" or pass the Default keyword. In any case, any number (including 0) is wrong because it is the same as "0" even if it works.

Edit: If you made any other changes, then I haven't noticed.

Edited by Manadar

Share this post


Link to post
Share on other sites

No, help file says:

WinMove ( "title", "text", x, y [, width [, height[, speed]]] )

"text" is a string, so not to specify it you would put an empty string like so "" or pass the Default keyword. In any case, any number (including 0) is wrong because it is the same as "0" even if it works.

Edit: If you made any other changes, then I haven't noticed.

You are wrong. Read this.

Important part in this case would be: "When you use a window handle for the title parameter then the text parameter is completely ignored."

Ok for the edit. You should have.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

the overwelming potential asomness outweighs any uselessnes. well done

definatly gonna make it use buttons.......or labels......that say ball.......


0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Share this post


Link to post
Share on other sites

I've skipped over this one a few times but finally gave it a look. I'd say the potential is there for animation. If you've played with any animation programs, they use points and you can determine the "bond" I guess of the points. They can be solid, so say you raise the elbow, the forearm follows, along with any joints attached below that. Then you can make an elastic bond such as used here which is used for like hair animation and such. I think that's a lot more work then your looking to do though :)


Giggity

Share this post


Link to post
Share on other sites

I've done this for a couple websites. I can't find any use for this, but bloody brilliant applying this stuff to autoit!!!

Share this post


Link to post
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
Sign in to follow this  
Followers 0