struct AnimateBubbleConstraint
{
public:
- AnimateBubbleConstraint( const Vector3& initialPos, float scale, float size )
+ AnimateBubbleConstraint( const Vector3& initialPos, float scale )
: mInitialX( initialPos.x ),
- mScale( scale ),
- mShapeSize( size )
+ mScale( scale )
{
}
void operator()( Vector3& position, const PropertyInputContainer& inputs )
{
const Vector3& parentSize = inputs[1]->GetVector3();
+ const Vector3& childSize = inputs[2]->GetVector3();
// Wrap bubbles verically.
- if( position.y + mShapeSize * 0.5f < -parentSize.y * 0.5f )
+ if( position.y + childSize.y * 0.5f < -parentSize.y * 0.5f )
{
- position.y = parentSize.y * 0.5f + mShapeSize * 0.5f;
+ position.y = parentSize.y * 0.5f + childSize.y * 0.5f;
}
// Bubbles X position moves parallax to horizontal
// scrollview occupying the majority of the screen
mScrollView = ScrollView::New();
- mScrollView.SetRelayoutEnabled( true );
mScrollView.SetAnchorPoint( AnchorPoint::CENTER );
mScrollView.SetParentOrigin( ParentOrigin::CENTER );
// Populate background and bubbles - needs to be scrollViewLayer so scroll ends show
Actor bubbleContainer = Actor::New();
- bubbleContainer.SetRelayoutEnabled( true );
bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER );
bubbleContainer.SetParentOrigin( ParentOrigin::CENTER );
content.SetName( name );
content.SetAnchorPoint( AnchorPoint::CENTER );
content.SetParentOrigin( ParentOrigin::CENTER );
- content.SetRelayoutEnabled( true );
content.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
content.SetSizeModeFactor( sizeMultiplier );
{
Actor child = actor.GetChildAt( i );
- const Vector3 childSize = child.GetTargetSize();
-
// Calculate a random position
Vector3 childPos( Random::Range( -size.x * 0.5f * BACKGROUND_SPREAD_SCALE, size.x * 0.5f * BACKGROUND_SPREAD_SCALE ),
- Random::Range( -size.y * 0.5f - childSize.height, size.y * 0.5f + childSize.height ),
+ Random::Range( -size.y, size.y ),
Random::Range( BUBBLE_MIN_Z, BUBBLE_MAX_Z ) );
child.SetPosition( childPos );
// Define bubble horizontal parallax and vertical wrapping
- Constraint animConstraint = Constraint::New < Vector3 > ( child, Actor::Property::POSITION, AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ), childSize.height ) );
+ Constraint animConstraint = Constraint::New < Vector3 > ( child, Actor::Property::POSITION, AnimateBubbleConstraint( childPos, Random::Range( -0.85f, 0.25f ) ) );
animConstraint.AddSource( Source( mScrollView, ScrollView::Property::SCROLL_POSITION ) );
animConstraint.AddSource( Dali::ParentSource( Dali::Actor::Property::SIZE ) );
+ animConstraint.AddSource( Dali::LocalSource( Dali::Actor::Property::SIZE ) );
animConstraint.Apply();
// Kickoff animation
Vector4 randColour( hue, hue * 0.5, 0.0f, Random::Range( 0.3f, 0.6f ));
ImageActor dfActor = ImageActor::New( distanceField );
- dfActor.SetRelayoutEnabled( false );
dfActor.SetSize( Vector2( randSize, randSize ) );
dfActor.SetParentOrigin( ParentOrigin::CENTER );
{
Animation anim = *animIter;
- anim.Pause();
+ anim.Stop();
}
mBackgroundAnimsPlaying = false;
mVersionPopup.HideTail();
mVersionPopup.OutsideTouchedSignal().Connect( this, &DaliTableView::HideVersionPopup );
mVersionPopup.HiddenSignal().Connect( this, &DaliTableView::PopupHidden );
-
- mVersionPopup.MarkDirtyForRelayout();
}
mVersionPopup.Show();
mLevelContainer = Actor::New();
mLevelContainer.SetAnchorPoint( AnchorPoint::CENTER );
mLevelContainer.SetParentOrigin( ParentOrigin::CENTER );
- mLevelContainer.SetRelayoutEnabled( true );
mLevelContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+
mContentLayer.Add( mLevelContainer );
mBrickCount = 0;
ImageActor brick = ImageActor::New(img);
brick.SetParentOrigin(ParentOrigin::TOP_LEFT);
brick.SetAnchorPoint(AnchorPoint::CENTER);
- brick.SetRelayoutEnabled( false );
brick.SetSize( brickSize );
brick.SetPosition( Vector3( position ) );
ImageActor actor = ImageActor::New(img);
actor.SetParentOrigin(ParentOrigin::TOP_LEFT);
actor.SetAnchorPoint(AnchorPoint::CENTER);
- actor.SetRelayoutEnabled( false );
return actor;
}
mFiles.clear();
mItemView = ItemView::New(*this);
- mItemView.SetRelayoutEnabled( false );
stage.Add( mItemView );
mItemView.SetParentOrigin(ParentOrigin::CENTER);
mItemView.SetAnchorPoint(AnchorPoint::CENTER);
}
builder.AddActors( layer );
-
- // Force relayout on layer
- layer.RelayoutRequestTree();
}
mBigImage3 = ResourceImage::New( BIG_IMAGE_3 );
mImage = ImageActor::New( mBigImage1 );
- mImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
- mImage.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::WIDTH );
+ mImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
radioGroup2Background.AddChild( mImage, Toolkit::TableView::CellPosition( 0, 1, 2, 1 ) );
// The enable/disable radio group
contentTable.Add( toggleBackground );
-
Toolkit::PushButton toggleButton = Toolkit::PushButton::New();
toggleButton.SetTogglableButton( true );
toggleButton.SetLabel( "Unselected" );
// create and setup the scroll view...
mScrollView = ScrollView::New();
- mScrollView.SetRelayoutEnabled( false );
mScrollView.SetSize(stageSize);
// attach Wobble Effect to ScrollView
mScrollView.SetParentOrigin(ParentOrigin::CENTER);
// Scale ScrollView to fit parent (mContentLayer)
- mScrollView.SetRelayoutEnabled( true );
mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Add the scroll view to the content layer
/**
* Helper to create the cluster actors
*/
- Cluster CreateClusterActor(ClusterType clusterType, ClusterStyle style)
+ Cluster CreateClusterActor(ClusterType clusterType, ClusterStyle style, Vector3& clusterSize)
{
// Create the cluster actor with the given cluster style
Cluster clusterActor = Cluster::New(style);
clusterActor.SetParentOrigin(ParentOrigin::CENTER);
clusterActor.SetAnchorPoint(AnchorPoint::CENTER);
- clusterActor.SetRelayoutEnabled( false );
Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
float minStageDimension = std::min(stageSize.x, stageSize.y);
- clusterActor.SetSize(minStageDimension * CLUSTER_RELATIVE_SIZE, minStageDimension * CLUSTER_RELATIVE_SIZE, 0.0f);
+
+ clusterSize.x = minStageDimension * CLUSTER_RELATIVE_SIZE;
+ clusterSize.y = minStageDimension * CLUSTER_RELATIVE_SIZE;
+
+ clusterActor.SetSize( clusterSize );
DALI_ASSERT_ALWAYS(clusterType < CLUSTER_COUNT);
const char **paths = IMAGE_GROUPS[clusterType];
backgroundAttributes.SetScalingMode( Dali::ImageAttributes::ShrinkToFit );
Image bg = ResourceImage::New( CLUSTER_BACKGROUND_IMAGE_PATH );
ImageActor image = ImageActor::New(bg);
- image.SetRelayoutEnabled( false );
clusterActor.SetBackgroundImage(image);
// Add actors (pictures) as the children of the cluster
mScrollView.Add(pageView);
pageView.SetParentOrigin(ParentOrigin::CENTER);
pageView.SetPosition(Vector3(stageSize.width * column, 0.0f, 0.0f));
- pageView.SetRelayoutEnabled( true );
pageView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Create cluster actors, add them to scroll view, and set the shear effect with the given center point.
- Cluster cluster = CreateClusterActor(clusterType, style);
+ Vector3 clusterSize;
+ Cluster cluster = CreateClusterActor( clusterType, style, clusterSize );
cluster.SetParentOrigin(ParentOrigin::TOP_LEFT);
cluster.SetAnchorPoint(AnchorPoint::TOP_LEFT);
cluster.SetPosition( clusterPosition );
pageView.Add(cluster);
- Vector3 clusterSize = cluster.GetCurrentSize();
- mClusterInfo.push_back(ClusterInfo( cluster, mClusterCount, clusterPosition, clusterSize ));
+ mClusterInfo.push_back( ClusterInfo( cluster, mClusterCount, clusterPosition, clusterSize ) );
mClusterCount++;
}
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION);
mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- mNextImage.SetRelayoutEnabled( false );
mCurrentEffect.SetTargetImage(mNextImage);
if( image.GetLoadingState() == ResourceLoadingSucceeded )
{
// show the first image
mCurrentImage = ImageActor::New( LoadStageFillingImage( IMAGES[mIndex] ) );
- mCurrentImage.SetRelayoutEnabled( false );
mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mCurrentImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mCurrentImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
Image image = LoadStageFillingImage( IMAGES[ mIndex ] );
mNextImage = ImageActor::New( image );
- mNextImage.SetRelayoutEnabled( false );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
// coordinates in a frame defined by a parent actor:
Actor gridActor = Actor::New();
- gridActor.SetRelayoutEnabled( true );
gridActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
gridActor.SetParentOrigin( ParentOrigin::CENTER );
gridActor.SetAnchorPoint( AnchorPoint::CENTER );
// Create the item view actor
mImageAtlas = CreateImageAtlas();
mItemView = ItemView::New(*this);
- mItemView.SetRelayoutEnabled( false );
mItemView.SetParentOrigin(ParentOrigin::CENTER);
mItemView.SetAnchorPoint(AnchorPoint::CENTER);
// Add a checkbox child actor; invisible until edit-mode is enabled
ImageActor checkbox = ImageActor::New( mWhiteImage );
- checkbox.SetRelayoutEnabled( false );
checkbox.SetName( "CheckBox" );
checkbox.SetColor( Vector4(0.0f,0.0f,0.0f,0.6f) );
checkbox.SetParentOrigin( ParentOrigin::TOP_RIGHT );
actor.Add( checkbox );
ImageActor tick = ImageActor::New( ResourceImage::New(SELECTED_IMAGE) );
- tick.SetRelayoutEnabled( false );
tick.SetColorMode( USE_OWN_COLOR );
tick.SetName( "Tick" );
tick.SetParentOrigin( ParentOrigin::TOP_RIGHT );
slider.Add( text );
Actor textContainer = Actor::New();
- textContainer.SetRelayoutEnabled( true );
textContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mAlphaFunctionText = TextLabel::New( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] );
mAlphaFunctionText.SetAnchorPoint( ParentOrigin::CENTER );
text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y );
textContainer.Add( text );
- mMenu.MarkDirtyForRelayout();
mMenu.Show();
mMenuShown = true;
}
// Create magnifier (controlled by human touch)
Layer overlay = Layer::New();
- overlay.SetRelayoutEnabled( false );
overlay.SetSensitive(false);
overlay.SetParentOrigin( ParentOrigin::CENTER );
overlay.SetSize(mStageSize);
Stage::GetCurrent().Add(overlay);
mMagnifier = Toolkit::Magnifier::New();
- mMagnifier.SetRelayoutEnabled( false );
mMagnifier.SetSourceActor( mView.GetBackgroundLayer() );
mMagnifier.SetSize( MAGNIFIER_SIZE * mStageSize.width ); // Size of magnifier is in relation to stage width
mMagnifier.SetMagnificationFactor( MAGNIFICATION_FACTOR );
overlay.Add( mMagnifier );
// Apply constraint to animate the position of the magnifier.
- Constraint constraint = Constraint::New<Vector3>( mMagnifier, Actor::Property::POSITION, ConfinementConstraint(ParentOrigin::CENTER, Vector2::ONE * MAGNIFIER_INDENT, Vector2::ONE * MAGNIFIER_INDENT) );
+ Constraint constraint = Constraint::New<Vector3>( mMagnifier, Actor::Property::POSITION, ConfinementConstraint(Vector3( 0.5f, 0.5f, 0.0f ), Vector2::ONE * MAGNIFIER_INDENT, Vector2::ONE * MAGNIFIER_INDENT) );
constraint.AddSource( LocalSource(Actor::Property::SIZE) );
constraint.AddSource( LocalSource(Actor::Property::PARENT_ORIGIN) );
constraint.AddSource( LocalSource(Actor::Property::ANCHOR_POINT) );
// Create bouncing magnifier automatically bounces around screen.
mBouncingMagnifier = Toolkit::Magnifier::New();
- mBouncingMagnifier.SetRelayoutEnabled( false );
mBouncingMagnifier.SetSourceActor( mView.GetBackgroundLayer() );
mBouncingMagnifier.SetSize( MAGNIFIER_SIZE * mStageSize.width ); // Size of magnifier is in relation to stage width
mBouncingMagnifier.SetMagnificationFactor( MAGNIFICATION_FACTOR );
page = ImageActor::New( ResourceImage::New( PAGE_IMAGES_PORTRAIT[ (pageId-1) % NUMBER_OF_PORTRAIT_IMAGE ] ) );
}
- page.SetRelayoutEnabled( false );
-
return page;
}
};
}
pageFront.Add(pageBack);
- pageFront.SetRelayoutEnabled( false );
- pageBack.SetRelayoutEnabled( false );
-
return pageFront;
}
};
// Create default View.
mView = View::New();
- mView.SetRelayoutEnabled( false );
stage.Add( mView );
Dali::Window winHandle = app.GetWindow();
mView.OrientationAnimationStartedSignal().Connect( this, &PageTurnController::OnOrientationAnimationStarted );
mPageTurnPortraitView = PageTurnPortraitView::New( mPortraitPageFactory, stageSize );
- mPageTurnPortraitView.SetRelayoutEnabled( false );
mPageTurnPortraitView.SetSpineShadowParameter( Vector2(70.f, 30.f) );
mPageTurnPortraitView.PageTurnStartedSignal().Connect( this, &PageTurnController::OnPageStartedTurn );
mPageTurnPortraitView.PageTurnFinishedSignal().Connect( this, &PageTurnController::OnPageFinishedTurn );
mPageTurnPortraitView.SetPositionInheritanceMode( USE_PARENT_POSITION );
mPageTurnLandscapeView = PageTurnLandscapeView::New( mLandscapePageFactory, Vector2(stageSize.y*0.5f, stageSize.x) );
- mPageTurnLandscapeView.SetRelayoutEnabled( false );
mPageTurnLandscapeView.PageTurnStartedSignal().Connect( this, &PageTurnController::OnPageStartedTurn );
mPageTurnLandscapeView.PageTurnFinishedSignal().Connect( this, &PageTurnController::OnPageFinishedTurn );
mPageTurnLandscapeView.PagePanStartedSignal().Connect( this, &PageTurnController::OnPageStartedPan );
text.SetColor( Vector4(0.0f,0.0f,0.0f,1.0f));
Slider slider = Slider::New();
- slider.SetRelayoutEnabled( false );
slider.SetAnchorPoint( AnchorPoint::CENTER_LEFT);
slider.SetParentOrigin( ParentOrigin::CENTER_RIGHT);
slider.SetProperty(Slider::Property::LOWER_BOUND, -1.0f );
//TextInput
Dali::Layer controlsLayer = Dali::Layer::New();
- controlsLayer.SetRelayoutEnabled( false );
- controlsLayer.SetSize( stage.GetSize().x, stage.GetSize().y*0.3f, 0.0 );
+ controlsLayer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ controlsLayer.SetSizeModeFactor( Vector3( 1.0f, 0.3f, 1.0f ) );
controlsLayer.SetPosition( 0.0f, stage.GetSize().y*0.8f, 0.0f );
controlsLayer.SetAnchorPoint( AnchorPoint::TOP_LEFT);
controlsLayer.SetParentOrigin( ParentOrigin::TOP_LEFT);
if( !mControlPoint[index] )
{
mControlPoint[index] = Toolkit::CreateSolidColorActor(Vector4(1.0f,1.0f,1.0f,1.0f));
- mControlPoint[index].SetRelayoutEnabled( false );
mControlPoint[index].SetParentOrigin( ParentOrigin::TOP_LEFT);
mControlPoint[index].SetAnchorPoint( AnchorPoint::CENTER );
mControlPoint[index].SetSize( 20.0f, 20.0f );
if( !mControlPoint[index])
{
mControlPoint[index] = Toolkit::CreateSolidColorActor(Vector4(1.0f,1.0f,1.0f,1.0f));
- mControlPoint[index].SetRelayoutEnabled( false );
mControlPoint[index].SetParentOrigin( ParentOrigin::TOP_LEFT);
mControlPoint[index].SetAnchorPoint( AnchorPoint::CENTER );
mControlPoint[index].SetSize( 20.0f, 20.0f );
ImageAttributes attributes;
Image img = ResourceImage::New(ACTOR_IMAGE, attributes );
mActor = ImageActor::New( img );
- mActor.SetRelayoutEnabled( false );
mActor.SetAnchorPoint( AnchorPoint::CENTER );
mActor.SetSize( 100, 50, 1 );
stage.Add( mActor );
}
RadialSweepViewImpl::RadialSweepViewImpl( float duration, float diameter, Degree initialAngle, Degree finalAngle, Degree initialSector, Degree finalSector )
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
mDuration(duration),
mDiameter(diameter),
mInitialAngle(initialAngle),
Vector2 stageSize = stage.GetSize();
mScrollView = ScrollView::New();
- mScrollView.SetRelayoutEnabled( false );
mScrollView.SetAnchorPoint(AnchorPoint::CENTER);
mScrollView.SetParentOrigin(ParentOrigin::CENTER);
mContentLayer.Add( mScrollView );
Actor CreatePage()
{
Actor page = Actor::New();
- page.SetRelayoutEnabled( true );
page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
page.SetParentOrigin( ParentOrigin::CENTER );
page.SetAnchorPoint( AnchorPoint::CENTER );
void ApplyEffectToPage(Actor page)
{
page.RemoveConstraints();
- page.SetRelayoutEnabled( true );
page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
switch( mEffectMode )
attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
Image img = ResourceImage::New(filename, attributes);
ImageActor actor = ImageActor::New(img);
- actor.SetRelayoutEnabled( false );
actor.SetName( filename );
actor.SetParentOrigin(ParentOrigin::CENTER);
actor.SetAnchorPoint(AnchorPoint::CENTER);
mShadowView.SetName("Container");
mShadowView.SetParentOrigin(ParentOrigin::CENTER);
mShadowView.SetAnchorPoint(AnchorPoint::CENTER);
- mShadowView.SetRelayoutEnabled( true );
mShadowView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mShadowView.SetPointLightFieldOfView( Math::PI / 2.0f);
mContents.Add(mShadowView);
]
},
{
- "type": "TextView",
- "text": "<font size='20' color='#fea011'><b>Touch</b></font>",
- "markup-enabled": true,
+ "type": "TextLabel",
+ "text": "Touch",
"name": "Instruction",
"parent-origin": "BOTTOM_CENTER",
"anchor-point": "BOTTOM_CENTER",
+ "text-color": [1, 0, 0, 1],
"position": [
0,
0,
toolBarLayer.SetName( "TOOLBAR_LAYER" );
toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
toolBarLayer.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
- toolBarLayer.SetSize( 0.0f, style.mToolBarHeight );
toolBarLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::WIDTH );
+ toolBarLayer.SetSize( 0.0f, style.mToolBarHeight );
// Raise tool bar layer to the top.
toolBarLayer.RaiseToTop();