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; }
public override void SetTarget(LNNode node) { base._firstTick = true; base._isEnd = false; base._target = node; _other.SetTarget(node); }
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); }
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; }
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; }
public override void SetTarget(LNNode node) { base._firstTick = true; base._isEnd = false; base._target = node; this._action.SetTarget(base._target); }
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); }
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); }
public override void SetTarget(LNNode node) { base.SetTarget(node); if (_action != null) { _action.SetTarget(node); } }
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); }
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); } }
public virtual void SetNode(LNNode node) { if (content == node) { return; } this.content = node; }
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); } }
public virtual void AddNode(LNNode node, int z) { if (node == null) { return; } this.content.AddNode(node, z); this.ProcessTouchMotionEvent(); }
internal void DeselectNode() { if (this.selectedNode == null) { return; } this.selectedNode.SetSelected(false); this.selectedNode = null; }
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 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; }
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); } }
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); } }
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); } }
public virtual int RemoveNode(LNNode node) { int removed = this.RemoveNode(this.content, node); if (removed != -1) { this.ProcessTouchMotionEvent(); } return(removed); }
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 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); }
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; }
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); }
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]); } } }
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); }
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(); }
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; } } } }
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 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(); } }
public virtual void Add(LNNode node) { AddNode(node, 0); }
public override void SetTarget(LNNode node) { base._firstTick = true; base._isEnd = false; base._target = node; _from = node.GetColor(); }
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; }
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; }
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 virtual void SetTarget(LNNode node) { this._firstTick = true; this._isEnd = false; this._target = node; }