mouseover object [SOLVED]

Started by Doctor Oakroot, Thu 16/12/2004 00:44:50

Previous topic - Next topic

Doctor Oakroot

OK, so I've got a switch - an object - that I want the player to be able to move. And I want the cursor to change to interact mode when it's over the object. But I don't see a way to do that.

I tried putting a hotspot around the object and using:

SaveCursor(whatever the function is - don't have the manual in front of me)
SetCursorMode(2);

The result is that the cursor changes when over the hotspot until it reaches the object when it changes back.

I tried putting the script on the hotspot, which works except if the cursor is actually over the object. If I could make the object completely transparent to the cursor (but not visually) this would work, but didn't see a way to do this.

Any ideas?

strazer

Don't use a hotspot but the object itself:

Code: ags

//...
  // script for room: Repeatedly execute

if (GetObjectAt(mouse.x, mouse.y) == 0) { // if mouse is over object 0
  SaveCursorForLocationChange();
  SetCursorMode(MODE_USE);  
}

//...

Candle

Thanks strazer, I was thinking how I could do that  .
Thank you again for all your help here .

Doctor Oakroot

Thanks. I'll go try that now.

SMF spam blocked by CleanTalk