Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: If ActiveObject is a window, cursor cannot be set?  (Read 2153 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'
If ActiveObject is a window, cursor cannot be set?
« on: July 06, 2008, 09:48:36 AM »

Hi all,

According to the docs, SetCursor changes the standard cursor of a window object. I can't get that to work and I've added my experimental code below. Game.SetActiveCursor also has no effect. I thought I'd followed the docs and Metamorphium's example (http://forum.dead-code.org/index.php?topic=2700.0) but no matter what I do, the cursor does not change from that set by the items.items entry.

Got to accept that I may be doing something really daft, (I'm rather hoping that I am) but also beginning to suspect it may be a bug. I've used similar constructs successfuly before on other active objects but never on a window. So is a window not really an active object or can anybody point out my error?

// SlatePart1 window
while(true)
  {
  if(Game.ActiveObject != null)
    {
    var w = Game.ActiveObject;
    Game.Msg("Object is "+w.Name);
    var y = Game.SelectedItem;
    Game.Msg("Selected is "+y.Name);   
    if(w.Name == "SlatePart1")
      {
      if(y.Name == "SlatePart2")
       {
        Game.Msg("Slate Two");
        // w.SetCursor("items\SlatePart2.png");               
        Game.SetActiveCursor("sprites\!Items\YellowBowl.sprite");
        }
      }
    }
  Sleep(20);
  }

In the example above, all conditions are met, as shown by the Game.Msg("Slate Two"); displaying. So I believe the cursor should change, but it doesn't.

Hope you can help chaps.

Cheers
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: If ActiveObject is a window, cursor cannot be set?
« Reply #1 on: July 07, 2008, 07:42:14 AM »

If I remember correctly, windows themselves don't appear active, because under normal conditions it would kind of beat the purpose (you can't really "activate" windows). Setting normal cursor instead should do the trick.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.126 seconds with 23 queries.