Interacting with zoomed-in item in inventory (SOLVED)

Started by auriond, Sun 22/10/2006 01:56:36

Previous topic - Next topic

auriond

Hi all,

I'm currently working on a custom Inventory GUI, and I'm using a new Zoom GUI for zooming into objects. I'm using the method recommended by Ashen in this thread:
http://americangirlscouts.org/bbc.com/yabb/index.php?topic=16531.0

method #3, so that the player can interact with the object (mainly to look at it, and to operate it).

So far I've managed to make the Zoom GUI's button show the correct sprite when I LookAt the item in the inventory. But now I'm stuck, because on the Zoom GUI, I don't know how to make it so that a message shows when I click the cursor on the button (the zoomed-in item). I've searched the forums and the manual, and I tried doing this:

function interface_click(int interface, int button)
  {
if (btnShowItem.Graphic == (29)) {
  if (mouse.IsButtonDown(eMouseLeft)) {
if (mouse.Mode == (eModeLookat))
DisplayMy("Item description.");
}
}
}

- but while it doesn't return errors, it also doesn't do a thing.

Any help would be greatly appreciated.  :)

edit: Searched the BFaq and it stopped at explaining how to get as far as zooming in on the item. If there's another page detailing how to actually interact with the item after that, please direct me to it, because I can't find it!

Theeph

I'd say your problem is you're not turning your gui off and the text is displaying but the gui is over it and you can't see it.

Your code looks ok apart from that...

auriond

#2
Thanks, Theeph. If I understand you correctly, you're saying the message is showing, but under the Zoom GUI, is that it?

But the DisplayMy is a custom function to show messages at the bottom of the screen, so shouldn't it show there? Both my inventory and my Zoom GUIs are relatively small boxes in the middle of the screen.

edit: I've figured it out. For anyone else who might be doing what I'm doing, here's how I made it work:

The variable button that shows the zoomed image is called btnShowItem. So in my global script I have:

function btnShowItem_Click(GUIControl *control, MouseButton button)
  {
      // zoom in on item   
      if (btnShowItem.Graphic == (29)) {
         if (mouse.Mode == (eModeLookat))
         Display ("Item description");
         else if (mouse.Mode == (eModeInteract))
         Display ("Item interaction");
      }
  }

That's it :)

SMF spam blocked by CleanTalk