kunkel321 wrote: ↑18 Sep 2021, 13:03
Pretty cool -- Thanks for sharing. It seems to be working correctly on my multi-monitor setup.
I see that you can assign what color to use for the circles... Is it possible to use burn(darken) or dodge(lighten) rather than a particular color? A burn followed immediately by a dodge would give the effect of shadows and reflections -- thus giving a visual appearance more similar to looking through the ripples in water.
You could probably get an effect like that by using this gdip brush type.
Code: Select all
Brush := Gdip_CreateLineBrush( X1 , Y1 , X2 , Y2 , Color1 , Color2 , 1 )
Changing the positions of two points back and forth.
On a slightly related note to this topic.
I have this prototype I was playing around with awhile ago that can perhaps be useful to some people that are looking for cursor highlighting.
It currently only works on your main monitor.
You can change the colors of things and their transparencies.
You can reduce or increase the number of circles.
You can change the speed and range of speeds the circles travel.
- Temp (1).gif (120.67 KiB) Viewed 2353 times
Requires
GDIP and this
Layered Window Class to run.
Code:
.
Code: Select all
;***************************************************************************************************
#Include <My Altered Gdip Lib> ;<------ Replace with your copy of GDIP
;***************************************************************************************************
#Include <LayeredWindow Class> ;Layered window class
;***************************************************************************************************
#SingleInstance, Force
SetBatchLines, -1
CoordMode, Mouse, Screen
OnExit, GuiClose
MainWindow := New LayeredWindow(x := -1 , y := -1 , w := A_ScreenWidth+1 , h := A_ScreenHeight+1 , window := 1 , title := "Cursor Tracker" , smoothing := 2 , options := "+AlwaysOnTop -DPIScale +E0x20" , autoShow := 1 , GdipStart := 1)
;~ Brush := Gdip_BrushCreateSolid("0x2200FF00")
Brush := Gdip_BrushCreateSolid("0x3300FF00")
Brush2 := Gdip_BrushCreateSolid("0x77ffff00")
MouseGetPos, x, y
Circles := []
Loop, 50
Circles[A_Index] := New Circle(x,y,MainWindow.G,Brush)
SetTimer, Always, 300
SetTimer, WatchCursor, 30
return
GuiClose:
MainWindow.DeleteWindow( TurnOffGdip := 1 )
ExitApp
Always:
Gui,1:Show,NA
return
WatchCursor:
MouseGetPos,tx,ty
MainWindow.ClearWindow()
Gdip_FillEllipse(MainWindow.G, Brush2 , tx-20, ty-20 , 40, 40)
Loop, % Circles.Length() {
(Circles[A_Index].Move(tx,ty))?((Circles[A_Index].Active)?(Circles[A_Index].Draw()))
}
MainWindow.UpdateWindow()
return
class Circle {
__New(x,y,pGraphics,Brush){
This.D := This._Random(3,15)
This.Position := New HB_Vector(x - This.D / 2, y - This.D / 2)
;~ This.Speed := This._Random(10.00,20.00)
This.Speed := This._Random(20.00,40.00)
;~ This.Speed := This._Random(5.00,20.00)
This.Acc := New HB_Vector()
This.Target := New HB_Vector()
This.Graphics := pGraphics
This.Brush := Brush
This.Distance := 0
This._SetTarget( x, y)
}
Draw(){
Gdip_FillEllipse(This.Graphics, This.Brush, This.Position.X, This.Position.Y, This.D, This.D)
}
_SetTarget(tx,ty){
local dist
This.Target := ""
if(This.LastTX=tx&&This.LastTY=ty){
This.Position.X := tx - (This.D/2)
This.Position.Y := ty - (This.D/2)
This.Active := 0
return
}
This.Active := 1
This.LastTX := tx
This.LastTY := ty
This.Target := New HB_Vector(tx-(This.D / 2),ty-( This.D /2))
dist := This.Position.dist(This.Target)
This.Distance := dist / This.Speed
}
Move(tx,ty){
if(--This.Distance>0){
This.Acc.X := This.Target.X
This.Acc.Y := This.Target.Y
This.Acc.Sub(This.Position)
This.Acc.SetMag(This.Speed)
This.Position.Add(This.Acc)
}else{
This._SetTarget(tx,ty)
}
return 1
}
_Random(Min,Max){
local Out
Random,Out,Min,Max
return Out
}
}
Class HB_Vector {
__New(x:=0,y:=0){
This.X:=x
This.Y:=y
}
Add(Other_HB_Vector){
This.X+=Other_HB_Vector.X
This.Y+=Other_HB_Vector.Y
}
Sub(Other_HB_Vector){
This.X-=Other_HB_Vector.X
This.Y-=Other_HB_Vector.Y
}
mag(){
return Sqrt(This.X*This.X + This.Y*This.Y)
}
magsq(){
return This.Mag()**2
}
setMag(in1){
m:=This.Mag()
This.X := This.X * in1/m
This.Y := This.Y * in1/m
return This
}
mult(in1,in2:="",in3:="",in4:="",in5:=""){
if(IsObject(in1)&&in2=""){
This.X*=In1.X
This.Y*=In1.Y
}else if(!IsObject(In1)&&In2=""){
This.X*=In1
This.Y*=In1
}else if(!IsObject(In1)&&IsObject(In2)){
This.X*=In1*In2.X
This.Y*=In1*In2.Y
}else if(IsObject(In1)&&IsObject(In2)){
This.X*=In1.X*In2.X
This.Y*=In1.Y*In2.Y
}
}
div(in1,in2:="",in3:="",in4:="",in5:=""){
if(IsObject(in1)&&in2=""){
This.X/=In1.X
This.Y/=In1.Y
}else if(!IsObject(In1)&&In2=""){
This.X/=In1
This.Y/=In1
}else if(!IsObject(In1)&&IsObject(In2)){
This.X/=In1/In2.X
This.Y/=In1/In2.Y
}else if(IsObject(In1)&&IsObject(In2)){
This.X/=In1.X/In2.X
This.Y/=In1.Y/In2.Y
}
}
dist(in1){
return Sqrt(((This.X-In1.X)**2) + ((This.Y-In1.Y)**2))
}
dot(in1){
return (This.X*in1.X)+(This.Y*In1.Y)
}
cross(in1){
return This.X*In1.Y-This.Y*In1.X
}
Norm(){
m:=This.Mag()
This.X/=m
This.Y/=m
}
}