Example #1
0
		public static LNFollow Action(LNNode followedNode, RectBox rect) {
			LNFollow follow = new LNFollow();
			follow._followedNode = followedNode;
			follow._boundarySet = true;
			follow._boundaryFullyCovered = false;
	
			follow.winRect = LSystem.screenRect;
			follow.fullScreenSize = new Vector2f(follow.winRect.width,
					follow.winRect.height);
            follow.halfScreenSize = follow.fullScreenSize.Mul(0.5f);
	
			follow.leftBoundary = -((rect.x + rect.width) - follow.fullScreenSize.x);
			follow.rightBoundary = -rect.x;
			follow.topBoundary = -rect.y;
			follow.bottomBoundary = -((rect.y + rect.height) - follow.fullScreenSize.y);
	
			if (follow.rightBoundary < follow.leftBoundary) {
				follow.rightBoundary = follow.leftBoundary = (follow.leftBoundary + follow.rightBoundary) / 2;
			}
	
			if (follow.topBoundary < follow.bottomBoundary) {
				follow.topBoundary = follow.bottomBoundary = (follow.topBoundary + follow.bottomBoundary) / 2;
			}
			if ((follow.topBoundary == follow.bottomBoundary)
					&& (follow.leftBoundary == follow.rightBoundary)) {
				follow._boundaryFullyCovered = true;
			}
			return follow;
		}
Example #2
0
 public override void SetTarget(LNNode node)
 {
     base._firstTick = true;
     base._isEnd     = false;
     base._target    = node;
     _other.SetTarget(node);
 }
Example #3
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			base._orgPos = node.GetPosition();
			base._pos = base._orgPos.Add(base._diff);
		}
Example #4
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			this._orgOpacity = node._alpha * 255f;
			this._diff = this._tarOpacity - this._orgOpacity;
		}
Example #5
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			base._orgAngle = node.GetRotation();
			base._tarAngle = base._diff + base._orgAngle;
		}
Example #6
0
 public override void SetTarget(LNNode node)
 {
     base._firstTick = true;
     base._isEnd     = false;
     base._target    = node;
     this._action.SetTarget(base._target);
 }
Example #7
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			this._orgPos = node.GetPosition();
			this._diff = this._pos.Sub(this._orgPos);
		}
Example #8
0
        public virtual List <LNNode> GetNodes(Type clazz)
        {
            if (content == null)
            {
                return(null);
            }
            if (clazz == null)
            {
                return(null);
            }
            LNNode[]      nodes = content.childs;
            int           size  = nodes.Length;
            List <LNNode> l     = new List <LNNode>(size);

            for (int i = size; i > 0; i--)
            {
                LNNode node = nodes[i - 1];
                Type   cls  = node.GetType();
                if (clazz == null || clazz == cls || clazz.IsInstanceOfType(node) ||
                    clazz.Equals(cls))
                {
                    l.Add(node);
                }
            }
            return(l);
        }
Example #9
0
 public override void SetTarget(LNNode node)
 {
     base.SetTarget(node);
     if (_action != null)
     {
         _action.SetTarget(node);
     }
 }
Example #10
0
 public override void SetTarget(LNNode node)
 {
     base._firstTick = true;
     base._isEnd     = false;
     base._target    = node;
     base._orgAngle  = node.GetRotation();
     base._tarAngle  = base._diff + base._orgAngle;
 }
Example #11
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			base._orgPos = node.GetPosition();
			base._delta.Set(this._delta.x - this._orgPos.x, this._delta.y
					- this._orgPos.y);
		}
Example #12
0
 public override void SetTarget(LNNode node)
 {
     base.SetTarget(node);
     if (_action != null)
     {
         _action.SetTarget(node);
     }
 }
Example #13
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			if (base._target   is  LNSprite) {
				((LNSprite) base._target).SetFlipY(_flipY);
			}
		}
Example #14
0
 public virtual void SetNode(LNNode node)
 {
     if (content == node)
     {
         return;
     }
     this.content = node;
 }
Example #15
0
 public override void SetTarget(LNNode node)
 {
     base._firstTick  = true;
     base._isEnd      = false;
     base._target     = node;
     this._orgOpacity = node._alpha * 255f;
     this._diff       = this._tarOpacity - this._orgOpacity;
 }
Example #16
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			if (base._target   is  LNSprite) {
				((LNSprite) base._target).SetAnimation(_ans);
			}
		}
Example #17
0
 public virtual void AddNode(LNNode node, int z)
 {
     if (node == null)
     {
         return;
     }
     this.content.AddNode(node, z);
     this.ProcessTouchMotionEvent();
 }
Example #18
0
 internal void DeselectNode()
 {
     if (this.selectedNode == null)
     {
         return;
     }
     this.selectedNode.SetSelected(false);
     this.selectedNode = null;
 }
Example #19
0
 public virtual void SetModal(LNNode node)
 {
     if (node != null && !node.IsVisible())
     {
         throw new Exception(
                   "Can't set invisible node as modal node!");
     }
     this.modal = node;
 }
Example #20
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			_startX = base._target.GetScaleX();
			_startY = base._target.GetScaleY();
			_deltaX = _endX - _startX;
			_deltaY = _endY - _startY;
		}
Example #21
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			this._index = 0;
			base._isEnd = false;
			base._target = node;
			if (this._actionList.Count > 0) {
				this._actionList[0].SetTarget(base._target);
			}
		}
Example #22
0
 public override void SetTarget(LNNode node)
 {
     base._firstTick = true;
     base._isEnd     = false;
     base._target    = node;
     if (base._target   is  LNSprite)
     {
         ((LNSprite)base._target).SetFlipX(_flipX);
     }
 }
Example #23
0
 public override void SetTarget(LNNode node)
 {
     base._firstTick = true;
     base._isEnd     = false;
     base._target    = node;
     if (base._target   is  LNSprite)
     {
         ((LNSprite)base._target).SetAnimation(_ans);
     }
 }
Example #24
0
        public virtual int RemoveNode(LNNode node)
        {
            int removed = this.RemoveNode(this.content, node);

            if (removed != -1)
            {
                this.ProcessTouchMotionEvent();
            }
            return(removed);
        }
Example #25
0
 public virtual bool SelectNode(LNNode node)
 {
     if (!node.IsVisible() || !node.IsEnabled() || !node.IsFocusable())
     {
         return(false);
     }
     this.DeselectNode();
     node.SetSelected(true);
     this.selectedNode = node;
     return(true);
 }
Example #26
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			this._startPosition = base._target._position;
			this._a = ((this._refPoint.y / this._refPoint.x) - (this._delta.y / this._delta.x))
					/ (this._refPoint.x - this._delta.x);
			this._b = (this._delta.y / this._delta.x)
					- ((this._delta.x + (2f * this._startPosition.x)) * this._a);
			this._c = (this._startPosition.y - ((this._a * this._startPosition.x) * this._startPosition.x))
					- (this._b * this._startPosition.x);
		}
Example #27
0
		public static LNFollow Action(LNNode followedNode) {
			LNFollow follow = new LNFollow();
			follow._followedNode = followedNode;
			follow._boundarySet = false;
			follow._boundaryFullyCovered = false;
	
			follow.winRect = LSystem.screenRect;
	
			follow.fullScreenSize = new Vector2f(follow.winRect.width,
					follow.winRect.height);
			follow.halfScreenSize = Vector2f.Mul(follow.fullScreenSize, 0.5f);
			return follow;
		}
Example #28
0
        public virtual LNNode FindNode(int x, int y)
        {
            if (content == null)
            {
                return(null);
            }
            if (this.modal != null && !this.modal.IsContainer())
            {
                return(content.FindNode(x, y));
            }
            LNNode panel = (this.modal == null) ? this.content
                    : (this.modal);
            LNNode node = panel.FindNode(x, y);

            return(node);
        }
Example #29
0
        internal void ValidateContainer(LNNode container)
        {
            if (content == null)
            {
                return;
            }
            LNNode[] nodes = container.childs;
            int      size  = container.GetNodeCount();

            for (int i = 0; i < size; i++)
            {
                if (nodes[i].IsContainer())
                {
                    this.ValidateContainer(nodes[i]);
                }
            }
        }
Example #30
0
        private int RemoveNode(LNNode container, Type clazz)
        {
            int removed = container.RemoveNode(clazz);

            LNNode[] nodes = container.childs;
            int      i     = 0;

            while (removed == -1 && i < nodes.Length - 1)
            {
                if (nodes[i].IsContainer())
                {
                    removed = this.RemoveNode(nodes[i], clazz);
                }
                i++;
            }
            return(removed);
        }
Example #31
0
 public override void Dispose()
 {
     if (usePhysics)
     {
         _manager.SetStart(false);
         _manager.SetEnableGravity(false);
         _Bodys.Clear();
     }
     this.keySize = 0;
     if (batch != null)
     {
         batch.Dispose();
         batch = null;
     }
     if (content != null)
     {
         content.Dispose();
         content = null;
     }
     if (indexTile != null)
     {
         indexTile.Dispose();
         indexTile = null;
     }
     if (objects != null)
     {
         objects.Clear();
         objects = null;
     }
     if (pendingAdd != null)
     {
         pendingAdd.Clear();
         pendingAdd = null;
     }
     if (pendingRemove != null)
     {
         pendingRemove.Clear();
         pendingRemove = null;
     }
     tiles.Clear();
     Close();
 }
Example #32
0
 private void ProcessTouchMotionEvent()
 {
     if (this.hoverNode != null && this.hoverNode.IsEnabled() &&
         this.GetInput().IsMoving())
     {
         if (GetTouchDY() != 0 || GetTouchDY() != 0)
         {
             this.hoverNode.ProcessTouchDragged();
         }
     }
     else
     {
         if (Touch.IsDrag() || Touch.IsMove() || Touch.IsDown())
         {
             LNNode node = this.FindNode(GetTouchX(), GetTouchY());
             if (node != null)
             {
                 this.hoverNode = node;
             }
         }
     }
 }
Example #33
0
 public virtual void SetNodeStat(LNNode node, bool active)
 {
     if (!active)
     {
         if (this.hoverNode == node)
         {
             this.ProcessTouchMotionEvent();
         }
         if (this.selectedNode == node)
         {
             this.DeselectNode();
         }
         this.clickNode[0] = null;
         if (this.modal == node)
         {
             this.modal = null;
         }
     }
     else
     {
         this.ProcessTouchMotionEvent();
     }
     if (node == null)
     {
         return;
     }
     if (node.IsContainer())
     {
         LNNode[] nodes = (node).childs;
         int      size  = (node).GetNodeCount();
         for (int i = 0; i < size; i++)
         {
             this.SetNodeStat(nodes[i], active);
         }
     }
 }
Example #34
0
 public override void Dispose()
 {
     this.keySize = 0;
     if (batch != null)
     {
         batch.Dispose();
         batch = null;
     }
     if (content != null)
     {
         content.Dispose();
         content = null;
     }
     if (indexTile != null)
     {
         indexTile.Dispose();
         indexTile = null;
     }
     if (objects != null)
     {
         objects.Clear();
         objects = null;
     }
     if (pendingAdd != null)
     {
         pendingAdd.Clear();
         pendingAdd = null;
     }
     if (pendingRemove != null)
     {
         pendingRemove.Clear();
         pendingRemove = null;
     }
     tiles.Clear();
     Close();
 }
        public virtual void ClearNodesStat(LNNode[] node)
        {
            bool checkTouchMotion = false;
            for (int i = 0; i < node.Length; i++)
            {
                if (this.hoverNode == node[i])
                {
                    checkTouchMotion = true;
                }

                if (this.selectedNode == node[i])
                {
                    this.DeselectNode();
                }

                this.clickNode[0] = null;

            }

            if (checkTouchMotion)
            {
                this.ProcessTouchMotionEvent();
            }
        }
Example #36
0
 public virtual void Add(LNNode node)
 {
     AddNode(node, 0);
 }
Example #37
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			_from = node.GetColor();
		}
 public virtual void AddNode(LNNode node, int z)
 {
     if (node == null)
     {
         return;
     }
     this.content.AddNode(node, z);
     this.ProcessTouchMotionEvent();
 }
Example #39
0
		public void AssignTarget(LNNode node) {
			this._target = node;
		}
 public virtual int RemoveNode(LNNode node)
 {
     int removed = this.RemoveNode(this.content, node);
     if (removed != -1)
     {
         this.ProcessTouchMotionEvent();
     }
     return removed;
 }
Example #41
0
		public override void SetTarget(LNNode node) {
			base._firstTick = true;
			base._isEnd = false;
			base._target = node;
			_other.SetTarget(node);
		}
 private void ProcessTouchMotionEvent()
 {
     if (this.hoverNode != null && this.hoverNode.IsEnabled()
             && this.GetInput().IsMoving())
     {
         if (GetTouchDY() != 0 || GetTouchDY() != 0)
         {
             this.hoverNode.ProcessTouchDragged();
         }
     }
     else
     {
         if (Touch.IsDrag() || Touch.IsMove() || Touch.IsDown())
         {
             LNNode node = this.FindNode(GetTouchX(), GetTouchY());
             if (node != null)
             {
                 this.hoverNode = node;
             }
         }
     }
 }
 private int RemoveNode(LNNode container, Type clazz)
 {
     int removed = container.RemoveNode(clazz);
     LNNode[] nodes = container.childs;
     int i = 0;
     while (removed == -1 && i < nodes.Length - 1)
     {
         if (nodes[i].IsContainer())
         {
             removed = this.RemoveNode(nodes[i], clazz);
         }
         i++;
     }
     return removed;
 }
 internal void DeselectNode()
 {
     if (this.selectedNode == null)
     {
         return;
     }
     this.selectedNode.SetSelected(false);
     this.selectedNode = null;
 }
 internal void ValidateContainer(LNNode container)
 {
     if (content == null)
     {
         return;
     }
     LNNode[] nodes = container.childs;
     int size = container.GetNodeCount();
     for (int i = 0; i < size; i++)
     {
         if (nodes[i].IsContainer())
         {
             this.ValidateContainer(nodes[i]);
         }
     }
 }
 public virtual void Add(LNNode node)
 {
     AddNode(node, 0);
 }
 public virtual void SetNodeStat(LNNode node, bool active)
 {
     if (!active)
     {
         if (this.hoverNode == node)
         {
             this.ProcessTouchMotionEvent();
         }
         if (this.selectedNode == node)
         {
             this.DeselectNode();
         }
         this.clickNode[0] = null;
         if (this.modal == node)
         {
             this.modal = null;
         }
     }
     else
     {
         this.ProcessTouchMotionEvent();
     }
     if (node == null)
     {
         return;
     }
     if (node.IsContainer())
     {
         LNNode[] nodes = (node).childs;
         int size = (node).GetNodeCount();
         for (int i = 0; i < size; i++)
         {
             this.SetNodeStat(nodes[i], active);
         }
     }
 }
 public virtual void SetNode(LNNode node)
 {
     if (content == node)
     {
         return;
     }
     this.content = node;
 }
 public virtual void SetModal(LNNode node)
 {
     if (node != null && !node.IsVisible())
     {
         throw new Exception(
                 "Can't set invisible node as modal node!");
     }
     this.modal = node;
 }
 public virtual bool SelectNode(LNNode node)
 {
     if (!node.IsVisible() || !node.IsEnabled() || !node.IsFocusable())
     {
         return false;
     }
     this.DeselectNode();
     node.SetSelected(true);
     this.selectedNode = node;
     return true;
 }
 public override void Dispose()
 {
     this.keySize = 0;
     if (batch != null)
     {
         batch.Dispose();
         batch = null;
     }
     if (content != null)
     {
         content.Dispose();
         content = null;
     }
     if (indexTile != null)
     {
         indexTile.Dispose();
         indexTile = null;
     }
     if (objects != null)
     {
         objects.Clear();
         objects = null;
     }
     if (pendingAdd != null)
     {
         pendingAdd.Clear();
         pendingAdd = null;
     }
     if (pendingRemove != null)
     {
         pendingRemove.Clear();
         pendingRemove = null;
     }
     tiles.Clear();
     Close();
 }
Example #52
0
		public virtual void SetTarget(LNNode node) {
			this._firstTick = true;
			this._isEnd = false;
			this._target = node;
		}