Computer Science Canada

Help with cursor animation

Author:  MrHat [ Sat Oct 29, 2005 4:55 pm ]
Post subject:  Help with cursor animation

I am making a simple reflex testing program and i would like to make my cursor disappear and in its place a cross hair appear. I know how to make the cursor dissapear but i dont know how to put a cursor in its place. I don't know if this affects anything but i am using an earlier version of Turing (3.1.1a) If you have any ideas at all they would be greatly appreciated. Thanks.

Author:  [Gandalf] [ Sat Oct 29, 2005 5:13 pm ]
Post subject: 

You know how to make the 'arrow' cursor disappear? From Turing? I didn't know that was possible, how did you do it?

To put something in it's place, why not draw something at mouse.x, mouse.y?

This reminds me of a target practice program I made, I may post it if I can find it Laughing

Author:  Cervantes [ Sat Oct 29, 2005 6:14 pm ]
Post subject: 

Check out Mouse.Where. There's the help file, or there's the compsci.ca tutorial, found via the Turing Walkthrough, found in the Turing tutorials section.

Don't forget to put a delay in your loop, or things will appear very slow. Sort of contradictory, eh?

Author:  MrHat [ Sun Oct 30, 2005 10:58 am ]
Post subject: 

lmao just yesterday i looked at the mousewhere code and never thought of it that way. BTW i believe the code for getting rid of a cursor, at least in 3.1.1a is
setscreen("nocursor")

or at least something similar to that

Author:  Cervantes [ Sun Oct 30, 2005 11:13 am ]
Post subject: 

In the newer versions of Turing, setscreen ("nocursor") gets rid of the blinking cursor present in things like get. Mind you, in previous versions you could do things like fullscreen (or so I hear), that you can't do in the newer versions.

Author:  MysticVegeta [ Sun Oct 30, 2005 12:24 pm ]
Post subject: 

seriously? we could do fullscreen in old versions? i wonder why they removed it then..

Author:  blaster009 [ Sun Oct 30, 2005 3:09 pm ]
Post subject: 

Probably because older versions were DOS-based.

Author:  beard0 [ Sun Oct 30, 2005 4:04 pm ]
Post subject: 

blaster009 wrote:
Probably because older versions were DOS-based.


Exactly. Full screen was all you could do.

Author:  [Gandalf] [ Sun Oct 30, 2005 5:51 pm ]
Post subject: 

beard0 wrote:
blaster009 wrote:
Probably because older versions were DOS-based.


Exactly. Full screen was all you could do.

Nope. (Well, as long as no graphics were involved).

Author:  beard0 [ Sun Oct 30, 2005 8:25 pm ]
Post subject: 

Errr.... So yeah, you can run it in a DOS window under windows, but that's really just a DOS emulation. To note: If you change the background coulour of your Command Prompt window, running your program causes a large section (maxcol X maxrow) to go black. It is a fullscreen program, being run in an emulation window.

Author:  RedRogueXIII [ Sat Nov 05, 2005 1:54 pm ]
Post subject: 

code:

var mx,my,mb:int
drawfillbox(0,0,maxx,maxy,black)

loop
mousewhere(mx,my,mb)
drawfillbox(0,my+1,mx-1,maxy,black)
drawfillbox(0,0,mx-1,my-1,black)
drawfillbox(mx+1,my+1,maxx,maxy,black)
drawfillbox(mx+1,0,maxx,my-1,black)
drawline(mx-30,my,mx-20,my,black)
drawline(mx+20,my,mx+30,my,black)
drawline(mx,my+30,mx,my+20,black)
drawline(mx,my-20,mx,my-30,black)

drawline(mx,my-20,mx,my+20,green)
drawline(mx-20,my,mx+20,my,green)
drawfilloval(mx,my,5,5,black)
end loop


this should work, except you'd have to change how the background refreshs itself. ....

Author:  Cervantes [ Sat Nov 05, 2005 6:22 pm ]
Post subject: 

Why so much drawing? Methinks you should check out View.Update.

code:

setscreen ("offscreenonly")
colourback (black)
var mx, my, mb : int


loop
    mousewhere (mx, my, mb)

    cls
    drawline (mx + 5, my, mx + 20, my, green)
    drawline (mx - 5, my, mx - 20, my, green)
    drawline (mx, my + 5, mx, my + 20, green)
    drawline (mx, my - 5, mx, my - 20, green)
    View.Update
    delay (10)
   
end loop

Author:  Albrecd [ Fri Nov 11, 2005 10:28 am ]
Post subject: 

How did you make the mouse dissapear?

Author:  do_pete [ Fri Nov 11, 2005 12:02 pm ]
Post subject: 

he didn't

Author:  The_Triangle [ Thu Nov 24, 2005 5:57 am ]
Post subject: 

do_pete wrote:
he didn't


lol. anyone know how to make the dissapear?

Author:  The_Triangle [ Thu Nov 24, 2005 5:58 am ]
Post subject: 

I meant to say how to make the mouse dissappear, dont blame me for double posting here.. somehow the edit button wasnt there :S ?

Author:  do_pete [ Thu Nov 24, 2005 1:05 pm ]
Post subject: 

as far as I know, it's impossible


: