Forum rules - please read before posting.

Inventory slide in

Hi,

Wondering how you would go about making the default inventory that shows when mouse at top of the screen to slide in from the top of the screen?

That possible?

Thanks

Gavin

Comments

  • Nevermind i got it ;P

    Set to Pan 
  • gonna extend the question and ask how i could make an inventory that slides down when scroll wheel is used?

    Like deponia, the game.
  • edited August 2015
    AC allows for Menus to be turned on when it detects an Input button is pressed, but the mouse scrollwheel is not classified as a "button" (see this thread).  Therefore, you'd have to have a custom scripting running in your scene that detects this manually, and turns on the Menu.

    Fortunately, this is very simple.  It would something along the lines of this, within a C# script class:

    AC.Menu myInventoryMenu;

    void Start ()
    {
      myInventoryMenu = AC.PlayerMenus.GetMenuWithName ("Inventory");
    }

    void Update ()
    {
      if (Input.GetAxis ("myScrollWheel") > 0f)
      {
        if (myInventoryMenu.IsOn () == false)
        {
          myInventoryMenu.TurnOn (true);
        }
      }
    }



    Where "Inventory" is the name of your inventory menu, and "myScrollWheel" is the name of your Input input axis mapped to the scroll wheel.
  • thx!

    i now put it into a c# script (in my asset folder) and put it on an game object, but nothing happens except a failure of nullreference.

    I put the appear type of inventory on manual.

    sry for the question, but still getting a hang of unity and coding...

    "
    using UnityEngine;
    using System.Collections;

    public class inventory_slidedown : MonoBehaviour {

    AC.Menu myInventoryMenu;
    void Start ()
    {
    myInventoryMenu = AC.PlayerMenus.GetMenuWithName ("Inventory");
    }

    void Update ()
    {
    if (Input.GetAxis ("Mouse ScrollWheel") > 0f)
    {
    if (myInventoryMenu.IsOn () == false)
    {
    myInventoryMenu.TurnOn (true);
    }

    else

    {
    myInventoryMenu.TurnOn (false);
    }
    }
    }
    }

    "
  • edited August 2015
    Hi Vozer,

    Do you have a menu called Inventory? renamed it ?


    ------------------------------------------------------------
    And since im here:

    How can i create a lip for the inventroy to always be showing like seen in:
    http://www.gamezebo.com/wp-content/uploads/2010/06/a/games-1663-JollyRover6_0.jpg

    The bottom lip. and when over, it shows menu?

    End of my question.
    --------------------------------------

    Sorry vozer :P
  • @klarax: Please post unrelated questions in a new thread.  But this would be done by creating a separate Menu to act as the lip, and having the "proper" Inventory menu Pan transition upwards when it enables.

    @vozer: You'll have to rename the "Inventory" menu to your own, if it's differently named.  Please post the full error message you get - I can only advise on an error if I can see the exact console output you get.
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.