Hide and Show Mouse

All about the core api and animation, input, sound, effect, collision and physics engines.
You can also post here your feature requests.

Moderator: Brume Dev Team

Hide and Show Mouse

Postby dcboy on Sat Feb 17, 2007 9:15 pm

Is there a way that I can hide and show the mouse?

I tried to set:
this.IsMouseInBrume = false;

but I get an error that says it's a method group??

Thanks for the help,
Dan
Dan Castellon - owner of thegtaspot.com
dcboy
Brume Rookie
 
Posts: 7
Joined: Wed Feb 14, 2007 2:13 pm

Postby Silmaryls on Tue Feb 20, 2007 10:12 pm

Hi dcboy !

In fact, IsMouseInBrume is a metho so you can't assign it :

Code: Select all
public bool IsMouseInBrume()


The method returns true if mouse cursor is located inside the Brume window.

What you want to do must be done with the Windows Forms api.
Just try something like that :

Code: Select all
using System.Windows.Forms;
...
...
Cursor.Hide();


This works for me.
User avatar
Silmaryls
Brume Team Member
 
Posts: 340
Joined: Tue Feb 21, 2006 10:09 pm
Location: Paris - France

Postby dcboy on Tue Feb 20, 2007 11:57 pm

ok, it works, thanks...

and...

brume = the best!
Dan Castellon - owner of thegtaspot.com
dcboy
Brume Rookie
 
Posts: 7
Joined: Wed Feb 14, 2007 2:13 pm

Re: Hide and Show Mouse

Postby dafreeman on Fri Jan 04, 2008 2:48 pm

My computer needs more than 5 seconds for hiding or showing the cursor.

The game continues and after some seconds the cursor disappears (when cursor.hide called). strange

Is there a way to hide cursor faster?
Last edited by dafreeman on Sat Jan 05, 2008 6:58 am, edited 1 time in total.
dafreeman
Brume Rookie
 
Posts: 11
Joined: Sun Dec 30, 2007 5:07 pm

Re: Hide and Show Mouse

Postby Gero on Sat Jan 05, 2008 3:24 am

Same here but I used the WinAPI for hiding and showing. Didn't know the Cursor.Hide() function.
Maybe the IsMouseInBrume doesn't work as expected?
User avatar
Gero
Brume user
 
Posts: 27
Joined: Thu Dec 06, 2007 10:11 pm

Re: Hide and Show Mouse

Postby Silmaryls on Tue Jan 08, 2008 8:44 pm

Can you give me your OS ?
This may be the problem.

And have you tried that :


Code: Select all
  public Test()
    {
        this.MouseEnter += new System.EventHandler(this.event_MouseEnter);
        this.MouseLeave += new System.EventHandler(this.event_MouseLeave);
    }

    private void event_MouseEnter(object sender, System.EventArgs e)
    {
        System.Windows.Forms.Cursor.Hide();
    }

    private void event_MouseLeave(object sender, System.EventArgs e)
    {
        System.Windows.Forms.Cursor.Show();
    }



I found many related problems on Google, tell me the results and I will check that !
User avatar
Silmaryls
Brume Team Member
 
Posts: 340
Joined: Tue Feb 21, 2006 10:09 pm
Location: Paris - France


Return to Technical discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron