Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Cursor for characters/entities  (Read 5099 times)

0 Members and 1 Guest are viewing this topic.

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Cursor for characters/entities
« on: January 11, 2005, 06:58:34 PM »

In Curves, the cursor changes to a talk bubble when its moved over a character - or perhaps in the case of some other character it's changed to a fist. Or at least, that's what should happen. How should I implement this? I put this in the character's script file, and it didn't work...

Code: [Select]
on "MouseEnter"
{

if(Game.GetCursor()=="sprites\cursors\others\arrow.sprite")
{
Game.SetCursor("sprites\cursors\Others\talk.sprite");
}

}

on "MouseLeave"
{

Game.SetCursor("sprites\cursors\Others\arrow.sprite");

}



The problem is with the GetCursor thing. How does it work?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Cursor for characters/entities
« Reply #1 on: January 11, 2005, 10:22:45 PM »

GetCursor should indeed return the filename of currently assigned cursor sprite.
But...but, why not to use directly the SetCursor method of the character?
Like:

Jaf.SetCursor("sprites\cursors\Others\talk.sprite");

That way you don't have to mess with those MouseEntry/MouseLeave events.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re: Cursor for characters/entities
« Reply #2 on: January 12, 2005, 03:25:33 PM »

Wat if the cursor is an inventory item? Wouldn't it mess it up then?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Cursor for characters/entities
« Reply #3 on: January 12, 2005, 04:15:03 PM »

Wat if the cursor is an inventory item? Wouldn't it mess it up then?
If there is an inventory item selected, it will override the cursor setting. But I suppose that's what you want, or not?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re: Cursor for characters/entities
« Reply #4 on: January 12, 2005, 04:29:27 PM »

But if I WANT to use an item with a character, and I don't want the cursor to change from the item picture to the talk bubble? In that case I need to use the checkup, but it's not working...
« Last Edit: January 12, 2005, 04:43:43 PM by deadworm222 »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Cursor for characters/entities
« Reply #5 on: January 12, 2005, 05:01:32 PM »

Try using Game.SetActiveCursor / Game.GetActiveCursor instead.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

deadworm222

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 197
  • Wintermute Army
    • View Profile
Re: Cursor for characters/entities
« Reply #6 on: January 13, 2005, 01:04:51 AM »

All right, thanks! :)
Logged
 

Page created in 0.026 seconds with 23 queries.