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

Username:   Password: 
 RegisterRegister   
 Help with cursor animation
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MrHat




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sat Oct 29, 2005 5:13 pm   Post subject: (No 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
Cervantes




PostPosted: Sat Oct 29, 2005 6:14 pm   Post subject: (No 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?
MrHat




PostPosted: Sun Oct 30, 2005 10:58 am   Post subject: (No 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
Cervantes




PostPosted: Sun Oct 30, 2005 11:13 am   Post subject: (No 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.
MysticVegeta




PostPosted: Sun Oct 30, 2005 12:24 pm   Post subject: (No subject)

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




PostPosted: Sun Oct 30, 2005 3:09 pm   Post subject: (No subject)

Probably because older versions were DOS-based.
beard0




PostPosted: Sun Oct 30, 2005 4:04 pm   Post subject: (No subject)

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


Exactly. Full screen was all you could do.
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sun Oct 30, 2005 5:51 pm   Post subject: (No 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).
beard0




PostPosted: Sun Oct 30, 2005 8:25 pm   Post subject: (No 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.
RedRogueXIII




PostPosted: Sat Nov 05, 2005 1:54 pm   Post subject: (No 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. ....
Cervantes




PostPosted: Sat Nov 05, 2005 6:22 pm   Post subject: (No 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
Albrecd




PostPosted: Fri Nov 11, 2005 10:28 am   Post subject: (No subject)

How did you make the mouse dissapear?
do_pete




PostPosted: Fri Nov 11, 2005 12:02 pm   Post subject: (No subject)

he didn't
The_Triangle




PostPosted: Thu Nov 24, 2005 5:57 am   Post subject: (No subject)

do_pete wrote:
he didn't


lol. anyone know how to make the dissapear?
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 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: