protected override bool LeaveContextDone(MenuNode node) { if (node.Position.X + node.GetSize().X <= 0) { return(true); } return(false); }
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; }
protected abstract bool EnterContextDone(MenuNode node);
protected abstract bool LeaveContextDone(MenuNode node);
protected virtual void LeaveContext(MenuNode node, int pos) { node.LeaveContext(pass, pos); pass += 0.1f; }
protected virtual void EnterContext(MenuNode node) { _init = true; node.EnterContext(pass, 1); }
/// <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); }