Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Fading MouseTrails
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Monkeyf4ce




PostPosted: Thu Mar 10, 2016 7:19 pm   Post subject: Fading MouseTrails

I made a Mouse trail but I need help trying to fade it so we can see the background.

This is what I have so far:
procedure MouseTrail

var x, y, oldx, oldy, b : int := -1
var c : int := 0
loop
% Get the current location of the mouse
mousewhere (x, y, b)
% if the mouse has moved and the button is pressed.
if (x not= oldx or y not= oldy) then
% Draw a circle around the mouse location
drawfilloval (x, y, 8, 8, c)
% Change the color
c := (c + 1) mod 16
oldx := x
oldy := y
end if

end loop


end MouseTrail
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri Mar 11, 2016 2:46 pm   Post subject: RE:Fading MouseTrails

Fading is actually pretty difficult in Turing. The easiest method I think is to use transparent gif images instead of drawing ovals.
Dreadnought




PostPosted: Sun Mar 13, 2016 12:56 pm   Post subject: Re: Fading MouseTrails

As insectoid said, fading is difficult. Something not quite as difficult (still not easy) would be to do what Windows does for mouse pointer trails and only show the last few mouse pointers.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: