Cursor change over Room Edge

Started by Adorewood, Sat 25/03/2006 21:43:40

Previous topic - Next topic

Adorewood

I want the cursor in a game I'm making to change into an arrow everytime it is passed over an edge of the room. This shall happen only over edges that, well, um, lead into other rooms. How do I do this? (I promise, this is the last time that I shall ask a question as stupid as this one :D)

strazer

There's an outstanding request on the tracker for an automatic cursor change but it has not been implemented yet.
And you can't currently get the position of the room edges (tracker entry), let alone check if crossing them would lead to another room.

For now, you would have to do everything manually, for example:

Code: ags

// room script

#define EDGE_RIGHT 300;


Code: ags

// script for room: Repeatedly execute

  if (GetViewportX() + mouse.x >= EDGE_RIGHT) { // if mouse over right edge
    mouse.UseModeGraphic(eModeArrowRight); // eModeArrowRight is a custom cursor you have to create in the editor
  }
  else mouse.UseDefaultGraphic(); // if not over right edge, revert current mode to its default graphic


You will have to tweak things depending on what control interface you're using (MI-style, Sierra-style etc.).

SMF spam blocked by CleanTalk