public override bool TouchesEnded(MouseState touch, Point point) { //Debug.Assert(State == MGMenuState.MenuStateTrackingTouch, "[Menu ccTouchEnded] -- invalid state"); if (m_pSelectedItem != null) { m_pSelectedItem.unselected(); m_pSelectedItem.Activate(); } State = MGMenuState.MenuStateWaiting; return base.TouchesMoved(touch, point); }
public override bool TouchesBegan(Microsoft.Xna.Framework.Input.MouseState touch, Point point) { //if (!CanClick) //{ // return false; //} if (State != MGMenuState.MenuStateWaiting || !Visible) { return false; } for (MGNode c = this.Parent; c != null; c = c.Parent) { if (c.Visible == false) { return false; } } m_pSelectedItem = this.ItemForTouch(touch); if (m_pSelectedItem != null) { State = MGMenuState.MenuStateTrackingTouch; m_pSelectedItem.selected(); return true; } return false; }