andybiochem Posted January 27, 2009 Share Posted January 27, 2009 Thought I'd give transcribing some Javascript into AutoIT a try. Have fun: expandcollapse popup;====== 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! Link to comment Share on other sites More sharing options...
Achilles Posted January 27, 2009 Share Posted January 27, 2009 That's a pretty cool effect... Not very useful (that I can think of), but cool! My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
BrettF Posted January 27, 2009 Share Posted January 27, 2009 Cool! Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Valuater Posted January 27, 2009 Share Posted January 27, 2009 That's really neat, looks like something I would have done!! ... but, not real useful... Thanks for sharing!! Valuater 8) Link to comment Share on other sites More sharing options...
AlmarM Posted January 27, 2009 Share Posted January 27, 2009 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. Link to comment Share on other sites More sharing options...
yehia Posted January 27, 2009 Share Posted January 27, 2009 yeah it looks like its using gravity rules My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
KaFu Posted January 27, 2009 Share Posted January 27, 2009 Really nice effect ... 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' (entropy ?) of that string. Â OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13)Â BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16)Â ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
trancexx Posted January 27, 2009 Share Posted January 27, 2009 Wants it back? lol Looks so real. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Ibrahim Posted January 29, 2009 Share Posted January 29, 2009 nice work man! [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker Link to comment Share on other sites More sharing options...
Yashied Posted February 10, 2009 Share Posted February 10, 2009 Well done. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
WideBoyDixon Posted February 11, 2009 Share Posted February 11, 2009 Completely useless but I really like it! Nice piece of work. [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
jvanegmond Posted February 11, 2009 Share Posted February 11, 2009 (edited) expandcollapse popup;====== 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 February 11, 2009 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
trancexx Posted February 11, 2009 Share Posted February 11, 2009 expandcollapse popup;====== 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 EndFuncCool! You meant this? expandcollapse popup;====== 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 Link to comment Share on other sites More sharing options...
sandin Posted February 11, 2009 Share Posted February 11, 2009 (edited) or this expandcollapse popup;====== 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 February 11, 2009 by sandin Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
jvanegmond Posted February 11, 2009 Share Posted February 11, 2009 (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 February 11, 2009 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
trancexx Posted February 11, 2009 Share Posted February 11, 2009 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 Link to comment Share on other sites More sharing options...
corgano Posted February 11, 2009 Share Posted February 11, 2009 the overwelming potential asomness outweighs any uselessnes. well done definatly gonna make it use buttons.......or labels......that say ball....... 0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e Link to comment Share on other sites More sharing options...
yehia Posted February 12, 2009 Share Posted February 12, 2009 (edited) this is just too creative but can this be done using pics i mean icons following mouse or something? i guess yeah but using GDI+ for layered images ... Edited February 12, 2009 by yehia My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
youknowwho4eva Posted February 12, 2009 Share Posted February 12, 2009 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 Link to comment Share on other sites More sharing options...
Champak Posted February 14, 2009 Share Posted February 14, 2009 I've done this for a couple websites. I can't find any use for this, but bloody brilliant applying this stuff to autoit!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now