Forum rules - please read before posting.

Displaying a "close-up" image of inventory items

Hi everyone,

I'm looking for some advice for a feature I want to implement in my game. I use a simple inventory grid, with right-click to examine inventory items. At the moment each examine action shows a text description when the player right-clicks, through a dialogue action.

What I'd like to do as well is show an enlarged version of the inventory image. Ideally I'd use a single image for each inventory item, at about 1024x1024, which is automatically scaled down in the inventory grid, and then the full-size version is shown when the user right-clicks on it, along with a text description.

I can't for the life of me figure out how to go about doing this. Would this require a custom action, or is there something in the magical AC pot that can already handle this sort of thing? 

I know that I could create a separate menu with individual images for each item, but that seems like a very inefficient way to go about things, especially since I aim to have about 30-40 inventory items in my game. I'd also then need to make sure that each element is hidden afterwards, which would be a somewhat nightmarish action list.

Any advice would be appreciated. Thanks!

Comments

  • This discussion might be of help, looks like it could be related :)

    http://www.adventurecreator.org/forum/discussion/526/solved-popup-inventory-object
  • Thanks for the link, @Eastman, but that method uses the sort of labour-intensive method I'm trying to avoid - it requires creating elements for each and every inventory item. I'm looking for something more like parametised sprites that can be assigned at runtime to the image element.

    Although if that is the only way to do this, then I'll resort to it. Just that I'm poking around to see if there's a more efficient way to take care of things.
  • Coming to AC v1.51 are a bunch of event listeners, including one that gets called whenever an inventory item is interacted with.  You might be able to do this by adding a listener of the form, e.g:

    void OnInventoryInteract (InvItem theItem, int cursorID)
    {
      if (cursorID == myLookCursorID)
      {
        // Item was examined
      }
    }
  • Okay cool, thanks Chris. I'll poke around when 1.51 is released and see what I can do!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.