void AddActiveHeadline(Headline headline)
{
// Same stuff. make button, put in place, get positions, etc.
// int width = uipLine.Background.width;//get width for positioning, tweens//TODO returns INCORRECT WIDTH, not yet resized according to anchors, so I have to do the hardcoded solution below
int width = 40 + 6 + uipLine.Label.width + 10;//icon+spacing+label+spacing
//slide headlines
for (int i = ActiveHeadlines.Count-1; i>=0; i--)
{
UIPHeadlineButton hdln = ActiveHeadlines [i];
if (hdln.transform.localPosition.x > this.TickerBarRightSide)//remove offscreens
RemoveActiveHeadline(hdln);//takes headlines that roll off the screen away
else //the tweens
{
//get "to" pos
Vector3 pos = hdln.transform.localPosition;
pos.x += width;
hdln.TweenPos.to = pos;
//play
TweenPosition tween = TweenPosition.Begin(hdln.gameObject, 1, pos);
//manually resetting the nulled values
// tween.steeperCurves = true;
// tween.method = UITweener.Method.EaseInOut;//using these two lines throws an error when the tween is viewed in the inspector
tween.animationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);//not "steeper"
tween.eventReceiver = this.gameObject;
tween.callWhenFinished = "TweenPosComplete";
}
}
}