protected override bool LeaveContextDone(MenuNode node)
        {
            if (node.Position.X + node.GetSize().X <= 0)
            {
                return(true);
            }

            return(false);
        }
示例#2
0
        public Menu(List <MenuNode> linkedNodes, SpriteFont font, SpriteBatch sb)
        {
            Font               = font;
            _nodes             = linkedNodes;
            _spriteBatch       = sb;
            CurrentNode        = _nodes.First();
            CurrentNode.Active = true;

            foreach (MenuNode node in _nodes)
            {
                node.Menu = this;
            }

            InputSystem.KeyUp     += KeyPress;
            InputSystem.MouseMove += Move;
            InputSystem.MouseDown += Click;
        }
示例#3
0
 protected abstract bool EnterContextDone(MenuNode node);
示例#4
0
 protected abstract bool LeaveContextDone(MenuNode node);
示例#5
0
 protected virtual void LeaveContext(MenuNode node, int pos)
 {
     node.LeaveContext(pass, pos);
     pass += 0.1f;
 }
示例#6
0
 protected virtual void EnterContext(MenuNode node)
 {
     _init = true;
     node.EnterContext(pass, 1);
 }
示例#7
0
 /// <summary>
 /// Changes the active menu node.
 /// </summary>
 /// <param name="newNode">The new node to be active.</param>
 protected virtual void ChangeActive(MenuNode newNode)
 {
     CurrentNode.Active = false;
     newNode.Active     = true;
     CurrentNode        = newNode;
 }
 protected override bool EnterContextDone(MenuNode node)
 {
     return(true);
 }