How do we animate widgets that are part of a layout. My goal is to add a widget to a layout that is set up to align the widget to the top middle of the screen.
What I then want to do then is grab this position, offset the widget so that it is outside (above) the visible content area and animate it back to the position determined by the given layout. some example code that results in the view animating to bottom left of screen instead of to its original top middle position is below (what is the recommended way to fix this?):
//note this._instructionsView is a cc.Widget derived view class
var mainLayout = new ccui.Layout();
mainLayout.setLayoutType(ccui.Layout.RELATIVE);
mainLayout.setSize( cc.size( 960, 640 ) );
this.addChild(mainLayout);
mainLayout.addChild(this._instructionsView);
var rp_TopMiddle= new ccui.RelativeLayoutParameter();
rp_TopMiddle.setAlign(ccui.RelativeLayoutParameter.PARENT_TOP_CENTER_HORIZONTAL);
this._instructionsView.setLayoutParameter(rp_TopMiddle);
var position = this._instructionsView.getPosition();
var m = new cc.moveTo(0, cc.p(position.x, position.y -this._instructionsView.getContentSize().height) ); // move view off screen
var mt = new cc.moveTo(2, cc.p(position.x, position.y)); // animate view back into screen
var seq = new cc.sequence(m,mt);
this._instructionsView.runAction(seq);