Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Can't get Item GetHoverSprite to work  (Read 3227 times)

0 Members and 1 Guest are viewing this topic.

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Can't get Item GetHoverSprite to work
« on: October 08, 2011, 02:24:37 PM »

Hi all

In Items.items I have:
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "/INV_GARLIC/"
   NAME = "GarlicBulb"
   IMAGE = "items\Graphics\Plain\Garlic48.png"
   CURSOR = "items\Graphics\Plain\Garlic48.png"
   CURSOR_HOVER = "items\Graphics\Highlighted\Garlic64.png"
   SCRIPT = "items\Scripts\GarlicBulb.script"
}

Later I try to query this and grab its image to display in a window, thus:
var ItsName = InvObject.Monicker;
var Itself = Game.QueryItem(ItsName);
var ItsPicture = Itself.GetHoverSprite();
ObjX.SetImage(ItsPicture);
CaptionBox.Text = Itself.Caption;

The caption works, so I know the QueryItem's doing its thing, but the GetHoverSprite returns null. If I change it to GetSprite, it gets the image just fine, so the syntax is OK. Game.SmartItemCursor is set to true.

Anybody know why GetSprite works but GetHoverSprite doesn't?

Thanks


Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Can't get Item GetHoverSprite to work
« Reply #1 on: October 08, 2011, 02:34:50 PM »

Because you're not setting the hover sprite, only the mouse pointer (=cursor). You need to add something like this:

SPRITE_HOVER = "items\hover_image.png"
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Can't get Item GetHoverSprite to work
« Reply #2 on: October 08, 2011, 06:24:44 PM »

Duh. Course it is. Thanks.
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com
 

Page created in 0.035 seconds with 20 queries.