Jump to content


Photo

Hide the cursor?


  • Please log in to reply
2 replies to this topic

#1 Kolink

Kolink

    Almighty Shinx

  • GMC Member
  • 2351 posts

Posted 22 September 2010 - 07:25 PM

It wasn't working in my game, so I tested it independantly:

One object. Global Left Down is "window_set_cursor(cr_none);", Global Left Release is "window_set_cursor(cr_default);"
Expected behaviour: When I click in the window, the cursor disappears until I release the mouse button.
What happened: Bugger all. The cursor did not disappear.

Any explanations?
  • 0

#2 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8993 posts
  • Version:GM:Studio

Posted 22 September 2010 - 07:38 PM

Maybe you have something else that keeps resetting it to the default?
  • 0

#3 Kolink

Kolink

    Almighty Shinx

  • GMC Member
  • 2351 posts

Posted 22 September 2010 - 07:41 PM

That's why I tested it in an independent game, so nothing could interfere.
I've added the following to the Draw event of my test object (which I remind you is all alone in the game, the only object in the room): "draw_text(0,0,window_get_cursor());" - it corrctly shows the value of cr_default and cr_none as needed. But the cursor is not disappearing.

EDIT: I unchecked "Show cursor" in the global game settings. window_get_cursor returns -1 (cr_none) and the cursor is gone. Then I click. When I release the mouse, the cursor value becomes 0 (cr_default) and the cursor appears, but doesn't disappear again on the next click.

ANOTHER EDIT: I've added this to the Step event:
if(mouse_x > 200) window_set_cursor(cr_none);
The cursor disappears as it should.

The object info is now:
Information about object: object0

Sprite: <no sprite>
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

 Step Event:
execute code:

if(mouse_x > 200) window_set_cursor(cr_none);
else window_set_cursor(cr_default);


Mouse Event for Glob Left Pressed:
execute code:

window_set_cursor(cr_none);


Mouse Event for Glob Left Released:
execute code:

window_set_cursor(cr_default);


Draw Event:
execute code:

draw_text(0,0,window_get_cursor());
It appears to have something to do with clicking...

Edited by Kolink, 22 September 2010 - 07:47 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users