QB64.org Forum
Active Forums => Programs => Topic started by: SierraKen on December 09, 2019, 12:26:56 am
-
I believe many months ago someone made something like this, but I thought I would freshen my memory. This is a small example of how to make your mouse pointer have a trail. Use your mouse wheel to increase and decrease the size of it. Thanks to b+ who once showed me how to make a fading trail.
_TITLE "Mouse Trail - Use Mouse Wheel to change size." mouseWheel = 0
IF mouseWheel
> 0 THEN mwheel
= mwheel
+ 5 IF mouseWheel
< 0 THEN mwheel
= mwheel
- 5 IF mwheel
> 300 THEN mwheel
= 300
-
Wouldn’t this be an excellent case of using multiple screens for your work?
DisplayScreen = _NEWIMAGE(800, 600, 32)
WorkScreen = _NEWIMAGE(800, 600, 32)
MouseScreen = _NEWIMAGE(800, 600, 32)
SCREEN DisplayScreen
DO
_SOURCE WorkScreen: _DEST WorkScreen
‘Draw on your work screen
_SOURCE MouseScreen
‘Draw the mouse trails
_PUTIMAGE , WorkScreen, DisplayScreen
_PUTIMAGE , MouseScreen, DisplayScreen
LOOP
Then you’d preserve the original screen while being able to fade out the trails that your mouse poops out behind itself.
-
OMG! I CAN'T GET AWAY FROM IT! ;)
Nice job there. I'll be studying this one for future reference.
-
Ha, yeah learned that from Fellippe's fireworks I think and then warping through the stars. I was trying to do those trails without alpha fading (but I can do with different colors).
-
Thanks everyone. I just made my own Cats and Mouse game using this code. SMMcNeil, I also used your code, thanks! I'm going to make a new thread for my new game.