Jump to content



Photo

Gradient Color Box thing


  • Please log in to reply
4 replies to this topic

#1 Jex

Jex

    Polymath

  • Active Members
  • PipPipPipPip
  • 206 posts

Posted 03 November 2007 - 11:02 PM

I'm bored and created that useless thing but good example for gradient color change in my opinion. ( If cursor pointer change, box vibrating )
My objective is creating box cursor but i cant hide cursor and if im hide click functions not work.

AutoIt         
#include <Color.au3> #include <GUIConstants.au3> Global $Width = 50, $Height = 50 HotKeySet("{ESC}", "_Exit") GUICreate("Test", $Width, $Height, -1, -1, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST) WinSetTrans("Test", "", 175) GUISetState() Func Colors($Color1 = "0xFF0000", $Color2 = "0xFFFF00", $Step = 50, $Delay = 15, $Vib = 1)     Local $ColorR = _ColorGetRed($Color1)     Local $ColorG = _ColorGetGreen($Color1)     Local $ColorB = _ColorGetBlue($Color1)     Local $StepR = (_ColorGetRed($Color2) - $ColorR) / $Step     Local $StepG = (_ColorGetGreen($Color2) - $ColorG) / $Step     Local $StepB = (_ColorGetBlue($Color2) - $ColorB) / $Step     For $i = 0 To $Step         $sColor = "0x" & StringFormat("%02X%02X%02X", $ColorR + $StepR * $i, $ColorG + $StepG * $i, $ColorB + $StepB * $i)         GUISetBkColor($sColor)         Sleep($Delay)         $Pos = MouseGetPos()         If $Vib = 1 And MouseGetCursor() <> 2 Then             WinMove("Test", "", ($Pos[0] - $Width) - Random(2, 5, 1), ($Pos[1] - $Height) - Random(2, 5, 1))         Else             WinMove("Test", "", ($Pos[0] - $Width) - 2, ($Pos[1] - $Height) - 2)         EndIf     Next EndFunc   ;==>Colors While 1     Colors("0xFF0000", "0x00FF00")     Colors("0x00FF00", "0x0000FF")     Colors("0x0000FF", "0xFF0000") WEnd Func _Exit()     Exit EndFunc   ;==>_Exit

Edited by Jex, 04 November 2007 - 02:04 AM.






#2 gseller

gseller

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,057 posts

Posted 03 November 2007 - 11:21 PM

Yep I see that if the curser changes it make the curser start jumping.. LOL Smooth gradient tho... <_<

#3 Achilles

Achilles

    Achilles == Ichigo

  • Active Members
  • PipPipPipPipPipPip
  • 2,897 posts

Posted 04 November 2007 - 01:38 AM

Nice script! I like the transparency/smoothness!


EDIT: Why the vibrating effect? I thought it was a mistake but then saw the code and saw that you did it on purpose?

Edited by Piano_Man, 04 November 2007 - 01:41 AM.


#4 Jex

Jex

    Polymath

  • Active Members
  • PipPipPipPip
  • 206 posts

Posted 04 November 2007 - 01:54 AM

Haven't reason, i'm just tested MouseGetCursor function. ( By the way im changed box position, now staying on left upper side. )

Edited by Jex, 04 November 2007 - 01:59 AM.


#5 _Kurt

_Kurt

    I can only imagine the world without Autoit (see above)

  • Active Members
  • PipPipPipPipPipPip
  • 865 posts

Posted 04 November 2007 - 02:40 PM

Very cool, really like the effect! Great example of color change.

Kurt
Awaiting Diablo III..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users