Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Gosu hiding my mouse pointer?

I'm doing some graphics programming using the Gosu gem. The thing is, when I create a Window my mouse pointer is hidden. I can guess where the mouse is at a certain moment, and I can intuitively click, but my users may not.

How can I show the pointer?

like image 325
Geo Avatar asked Sep 09 '09 16:09

Geo


People also ask

Why does my mouse pointer disappear?

Check the Cable or Batteries. For a wired mouse, check the cable and ensure that it doesn't have any signs of damage. If you're using a wireless mouse, then you need to take a different approach. If the mouse pointer disappears, try using new batteries and see if this resolves the issue.

How do I stop my mouse from hiding?

Sprinkle scents they don't like A great way to bring mice out of hiding and steer them in the direction you want them to go is to sprinkle potent scents they find particularly unpleasant. Mice don't like the smell of garlic, onions, cayenne pepper, cloves, ammonia and alcohol.

Why can't I see my cursor in League of Legends?

Setting up your mouse settings: Click on Mouse. Click on the Pointer Options tab. Uncheck the Display Pointer Trails option. Uncheck the Hide Pointer While Typing option.

Why does my cursor disappear in fall guys?

UPDATE: If you use add-ons program for other games or content creation (such as Overwolf) then please disable these programs before loading Fall Guys. They may interfere with your cursor in the game, and we've found that turning off these has helped resolve the issue with your cursor being stuck or invisible.


2 Answers

If you want to use the system cursor you can do this

class Window < Gosu::Window
  def initialize
    super 320, 240, false
  end

  def needs_cursor?
    true
  end
end

Check out the documentation at libgosu

RubyGosu rdoc Reference / Window

like image 185
Arrow Avatar answered Oct 03 '22 07:10

Arrow


I'm using something like this:

class Game < Gosu::Window
  def initialize
    super 800, 600, false
    @cursor = Gosu::Image.new(self, 'media/cursor.png')
  end

  def draw
    @cursor.draw self.mouse_x, self.mouse_y, 0
  end
end

Game.new.show
like image 45
Ariel H. Pillet Avatar answered Oct 03 '22 07:10

Ariel H. Pillet