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 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 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 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); }