mScrollView.SetParentOrigin( ParentOrigin::CENTER );
// Note: Currently, changing mScrollView to use SizeMode RELATIVE_TO_PARENT
// will cause scroll ends to appear in the wrong position.
- mScrollView.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::RelativeToConstraint( SCROLLVIEW_RELATIVE_SIZE ) ) );
+ mScrollView.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::Property::Size, Dali::ParentSource( Dali::Actor::Property::Size ), Dali::RelativeToConstraint( SCROLLVIEW_RELATIVE_SIZE ) ) );
mScrollView.SetAxisAutoLock( true );
mScrollView.ScrollCompletedSignal().Connect( this, &DaliTableView::OnScrollComplete );
mScrollView.ScrollStartedSignal().Connect( this, &DaliTableView::OnScrollStart );
dfActor.SetPosition( actorPos );
// Define bubble horizontal parallax and vertical wrapping
- Constraint animConstraint = Constraint::New < Vector3 > ( Actor::POSITION,
+ Constraint animConstraint = Constraint::New < Vector3 > ( Actor::Property::Position,
Source( mScrollView, mScrollView.GetPropertyIndex( ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
- Dali::ParentSource( Dali::Actor::SIZE ),
+ Dali::ParentSource( Dali::Actor::Property::Size ),
AnimateBubbleConstraint( actorPos, Random::Range( -0.85f, 0.25f ), randSize ) );
dfActor.ApplyConstraint( animConstraint );
Vector3 toPos( actorPos );
toPos.y -= ( size.y + randSize );
keyframes.Add( 1.0f, toPos );
- animation.AnimateBetween( Property( dfActor, Actor::POSITION ), keyframes );
+ animation.AnimateBetween( Property( dfActor, Actor::Property::Position ), keyframes );
animation.SetLooping( true );
animation.Play();
mBackgroundAnimations.push_back( animation );
mPaddleImage.SetSize( mPaddleFullSize );
mWobbleProperty = mPaddle.RegisterProperty(WOBBLE_PROPERTY_NAME, 0.0f);
- Constraint wobbleConstraint = Constraint::New<Quaternion>( Actor::ROTATION,
+ Constraint wobbleConstraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
LocalSource(mWobbleProperty),
WobbleConstraint(10.0f));
mPaddle.ApplyConstraint(wobbleConstraint);
const float margin(BALL_SIZE.width * stageSize.width * 0.5f);
// Set up notifications for ball's collisions against walls.
- PropertyNotification leftNotification = mBall.AddPropertyNotification( Actor::POSITION_X, LessThanCondition(margin) );
+ PropertyNotification leftNotification = mBall.AddPropertyNotification( Actor::Property::PositionX, LessThanCondition(margin) );
leftNotification.NotifySignal().Connect( this, &ExampleController::OnHitLeftWall );
- PropertyNotification rightNotification = mBall.AddPropertyNotification( Actor::POSITION_X, GreaterThanCondition(stageSize.width - margin) );
+ PropertyNotification rightNotification = mBall.AddPropertyNotification( Actor::Property::PositionX, GreaterThanCondition(stageSize.width - margin) );
rightNotification.NotifySignal().Connect( this, &ExampleController::OnHitRightWall );
- PropertyNotification topNotification = mBall.AddPropertyNotification( Actor::POSITION_Y, LessThanCondition(margin) );
+ PropertyNotification topNotification = mBall.AddPropertyNotification( Actor::Property::PositionY, LessThanCondition(margin) );
topNotification.NotifySignal().Connect( this, &ExampleController::OnHitTopWall );
- PropertyNotification bottomNotification = mBall.AddPropertyNotification( Actor::POSITION_Y, GreaterThanCondition(stageSize.height + margin) );
+ PropertyNotification bottomNotification = mBall.AddPropertyNotification( Actor::Property::PositionY, GreaterThanCondition(stageSize.height + margin) );
bottomNotification.NotifySignal().Connect( this, &ExampleController::OnHitBottomWall );
// Set up notification for ball colliding against paddle.
stage.Add(delegate);
Property::Index property = delegate.RegisterProperty(COLLISION_PROPERTY_NAME, Vector3::ZERO);
Constraint constraint = Constraint::New<Vector3>( property,
- Source(mBall, Actor::POSITION),
- Source(mPaddle, Actor::POSITION),
- Source(mBall, Actor::SIZE),
- Source(mPaddle, Actor::SIZE),
+ Source(mBall, Actor::Property::Position),
+ Source(mPaddle, Actor::Property::Position),
+ Source(mBall, Actor::Property::Size),
+ Source(mPaddle, Actor::Property::Size),
CollisionCircleRectangleConstraint( -Vector3(0.0f, mPaddleHitMargin.height * 0.575f, 0.0f),-Vector3(mPaddleHitMargin) ));
delegate.ApplyConstraint(constraint);
// Add a constraint on the brick between it and the ball generating a collision-property
Property::Index property = brick.RegisterProperty(COLLISION_PROPERTY_NAME, Vector3::ZERO);
Constraint constraint = Constraint::New<Vector3>( property,
- Source(mBall, Actor::POSITION),
- Source(brick, Actor::POSITION),
- Source(mBall, Actor::SIZE),
- Source(brick, Actor::SIZE),
+ Source(mBall, Actor::Property::Position),
+ Source(brick, Actor::Property::Position),
+ Source(mBall, Actor::Property::Size),
+ Source(brick, Actor::Property::Size),
CollisionCircleRectangleConstraint(BRICK_COLLISION_MARGIN));
brick.ApplyConstraint(constraint);
}
mBallAnimation = Animation::New(MAX_ANIMATION_DURATION);
- mBallAnimation.AnimateBy( Property( mBall, Actor::POSITION ), mBallVelocity * MAX_ANIMATION_DURATION);
+ mBallAnimation.AnimateBy( Property( mBall, Actor::Property::Position ), mBallVelocity * MAX_ANIMATION_DURATION);
mBallAnimation.Play();
}
mDragActor = actor;
mDragAnimation = Animation::New(0.25f);
- mDragAnimation.AnimateTo( Property(mDragActor, Actor::SCALE), Vector3(1.1f, 1.1f, 1.0f), AlphaFunctions::EaseOut);
- mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::COLOR), Vector4(1.0f, 1.0f, 1.0f, 0.0f), AlphaFunctions::EaseOut);
+ mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::Scale), Vector3(1.1f, 1.1f, 1.0f), AlphaFunctions::EaseOut);
+ mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::Property::Color), Vector4(1.0f, 1.0f, 1.0f, 0.0f), AlphaFunctions::EaseOut);
mDragAnimation.Play();
}
}
if(point.state==TouchPoint::Up) // Stop dragging
{
mDragAnimation = Animation::New(0.25f);
- mDragAnimation.AnimateTo( Property(mDragActor, Actor::SCALE), Vector3(1.0f, 1.0f, 1.0f), AlphaFunctions::EaseIn);
- mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::COLOR), Vector4(1.0f, 1.0f, 1.0f, 1.0f), AlphaFunctions::EaseOut);
+ mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::Scale), Vector3(1.0f, 1.0f, 1.0f), AlphaFunctions::EaseIn);
+ mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::Property::Color), Vector4(1.0f, 1.0f, 1.0f, 1.0f), AlphaFunctions::EaseOut);
mDragAnimation.Play();
mDragActor.Reset();
}
mBallVelocity = Vector3::ZERO;
Animation shrink = Animation::New(0.5f);
- shrink.AnimateTo( Property(mPaddle, Actor::SIZE_WIDTH), mPaddleFullSize.x * f + mPaddleHitMargin.x);
- shrink.AnimateTo( Property(mPaddleImage, Actor::SIZE_WIDTH), mPaddleFullSize.x * f );
+ shrink.AnimateTo( Property(mPaddle, Actor::Property::SizeWidth), mPaddleFullSize.x * f + mPaddleHitMargin.x);
+ shrink.AnimateTo( Property(mPaddleImage, Actor::Property::SizeWidth), mPaddleFullSize.x * f );
shrink.FinishedSignal().Connect( this, &ExampleController::OnPaddleShrunk );
shrink.Play();
mBall.SetPosition( mBallStartPosition );
mBall.SetColor( Vector4(1.0f, 1.0f, 1.0f, 0.1f) );
Animation appear = Animation::New(0.5f);
- appear.AnimateTo( Property(mBall, Actor::COLOR), Vector4(1.0f, 1.0f, 1.0f, 1.0f) );
+ appear.AnimateTo( Property(mBall, Actor::Property::Color), Vector4(1.0f, 1.0f, 1.0f, 1.0f) );
appear.Play();
if(!mLives)
// fade brick (destroy)
Animation destroyAnimation = Animation::New(0.5f);
- destroyAnimation.AnimateTo( Property( brick, Actor::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn );
+ destroyAnimation.AnimateTo( Property( brick, Actor::Property::ColorAlpha ), 0.0f, AlphaFunctions::EaseIn );
destroyAnimation.Play();
destroyAnimation.FinishedSignal().Connect( this, &ExampleController::OnBrickDestroyed );
mDestroyAnimationMap[destroyAnimation] = brick;
Vector2 shearCenter( Vector2(position.x + size.width * shearAnchor.x, position.y + size.height * shearAnchor.y) );
Property::Index centerProperty = shaderEffect.GetPropertyIndex(shaderEffect.GetCenterPropertyName());
Constraint constraint = Constraint::New<Vector2>( centerProperty,
- Source(mView, Actor::SIZE),
+ Source(mView, Actor::Property::Size),
ShearEffectCenterConstraint(stageSize, shearCenter) );
shaderEffect.ApplyConstraint(constraint);
constraint = Constraint::New<float>( angleXAxisProperty,
Source(mScrollView, scrollOvershootProperty),
- Source(mView, Actor::ROTATION),
+ Source(mView, Actor::Property::Rotation),
ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::XAXIS) );
shaderEffect.ApplyConstraint(constraint);
constraint = Constraint::New<float>( angleYAxisProperty,
Source(mScrollView, scrollOvershootProperty),
- Source(mView, Actor::ROTATION),
+ Source(mView, Actor::Property::Rotation),
ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::YAXIS) );
shaderEffect.ApplyConstraint(constraint);
Property::Index anglePerUnit = shaderEffect.GetPropertyIndex( shaderEffect.GetAnglePerUnitPropertyName() );
shaderEffect.ApplyConstraint( Constraint::New<Vector2>( anglePerUnit,
- Source(mView, Actor::ROTATION),
+ Source(mView, Actor::Property::Rotation),
CarouselEffectOrientationConstraint( angleSweep ) ) );
break;
// dont apply shader effect to scrollview as it might override internal shaders for bounce effect etc
for( std::vector<ClusterInfo>::iterator i = mClusterInfo.begin(); i != mClusterInfo.end(); ++i )
{
- Constraint constraint = Constraint::New<float>(Actor::POSITION_Z, SphereEffectOffsetConstraint(SPHERE_EFFECT_POSITION_Z));
+ Constraint constraint = Constraint::New<float>(Actor::Property::PositionZ, SphereEffectOffsetConstraint(SPHERE_EFFECT_POSITION_Z));
constraint.SetRemoveAction(Constraint::Discard);
Cluster cluster = i->mCluster;
SetShaderEffectRecursively( cluster, shaderEffect );
mViewTimer.TickSignal().Connect( this, &CubeTransitionApp::OnTimerTick );
// show the first image
- mImageConstraint = Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() );
+ mImageConstraint = Constraint::New<Vector3>( Actor::Property::Scale, LocalSource( Actor::Property::Size ), ParentSource( Actor::Property::Size ), ScaleToFitKeepAspectRatioConstraint() );
mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) );
mCurrentImage.SetPositionInheritanceMode( USE_PARENT_POSITION );
mParent.SetPositionInheritanceMode( USE_PARENT_POSITION );
mContent.Add( mParent );
- mSizeConstraint= Constraint::New<Vector3>( Actor::SCALE, LocalSource( Actor::SIZE ), ParentSource( Actor::SIZE ), ScaleToFitKeepAspectRatioConstraint() );
+ mSizeConstraint= Constraint::New<Vector3>( Actor::Property::Scale, LocalSource( Actor::Property::Size ), ParentSource( Actor::Property::Size ), ScaleToFitKeepAspectRatioConstraint() );
// show the first image
mCurrentImage = ImageActor::New( ResourceImage::New( IMAGES[mIndex] ) );
text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft );
text.SetStyleToCurrentText( defaultTextStyle );
text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y );
- text.ApplyConstraint( Dali::Constraint::New<float>( Dali::Actor::SIZE_WIDTH, Dali::ParentSource( Dali::Actor::SIZE_WIDTH ), Dali::EqualToConstraint() ) );
+ text.ApplyConstraint( Dali::Constraint::New<float>( Dali::Actor::Property::SizeWidth, Dali::ParentSource( Dali::Actor::Property::SizeWidth ), Dali::EqualToConstraint() ) );
text.SetZ( -0.9f );
slider.Add( text );
text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft );
text.SetStyleToCurrentText( defaultTextStyle );
text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y );
- text.ApplyConstraint( Dali::Constraint::New<float>( Dali::Actor::SIZE_WIDTH, Dali::ParentSource( Dali::Actor::SIZE_WIDTH ), Dali::EqualToConstraint() ) );
+ text.ApplyConstraint( Dali::Constraint::New<float>( Dali::Actor::Property::SizeWidth, Dali::ParentSource( Dali::Actor::Property::SizeWidth ), Dali::EqualToConstraint() ) );
textContainer.Add( text );
mMenu.Show();
overlay.Add( mMagnifier );
// Apply constraint to animate the position of the magnifier.
- Constraint constraint = Constraint::New<Vector3>(Actor::POSITION,
- LocalSource(Actor::SIZE),
- LocalSource(Actor::PARENT_ORIGIN),
- LocalSource(Actor::ANCHOR_POINT),
- ParentSource(Actor::SIZE),
+ Constraint constraint = Constraint::New<Vector3>(Actor::Property::Position,
+ LocalSource(Actor::Property::Size),
+ LocalSource(Actor::Property::ParentOrigin),
+ LocalSource(Actor::Property::AnchorPoint),
+ ParentSource(Actor::Property::Size),
ConfinementConstraint(ParentOrigin::CENTER, Vector2::ONE * MAGNIFIER_INDENT, Vector2::ONE * MAGNIFIER_INDENT));
constraint.SetRemoveAction(Constraint::Discard);
mMagnifier.ApplyConstraint( constraint );
ContinueAnimation();
// Apply constraint to animate the position of the magnifier.
- constraint = Constraint::New<Vector3>(Actor::POSITION,
- LocalSource(Actor::SIZE),
+ constraint = Constraint::New<Vector3>(Actor::Property::Position,
+ LocalSource(Actor::Property::Size),
LocalSource(mAnimationTimeProperty),
MagnifierPathConstraint(mStageSize, mStageSize * 0.5f));
mBouncingMagnifier.ApplyConstraint( constraint );
// Apply constraint to animate the source of the magnifier.
constraint = Constraint::New<Vector3>(mBouncingMagnifier.GetPropertyIndex( Toolkit::Magnifier::SOURCE_POSITION_PROPERTY_NAME ),
- LocalSource(Actor::SIZE),
+ LocalSource(Actor::Property::Size),
LocalSource(mAnimationTimeProperty),
MagnifierPathConstraint(mStageSize));
mBouncingMagnifier.ApplyConstraint( constraint );
if(!mMagnifierShown)
{
Animation animation = Animation::New(MAGNIFIER_DISPLAY_DURATION);
- animation.AnimateTo(Property(mMagnifier, Actor::SCALE), Vector3::ONE, AlphaFunctions::EaseIn);
+ animation.AnimateTo(Property(mMagnifier, Actor::Property::Scale), Vector3::ONE, AlphaFunctions::EaseIn);
animation.Play();
mMagnifierShown = true;
}
if(mMagnifierShown)
{
Animation animation = Animation::New(MAGNIFIER_DISPLAY_DURATION);
- animation.AnimateTo(Property(mMagnifier, Actor::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(mMagnifier, Actor::Property::Scale), Vector3::ZERO, AlphaFunctions::EaseOut);
animation.Play();
mMagnifierShown = false;
}
mActorTapMovementAnimation = Animation::New( animDuration );
if ( mMotionBlurImageActor )
{
- mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageActor, Actor::POSITION), destPos, AlphaFunctions::EaseInOutSine, TimePeriod(animDuration) );
+ mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageActor, Actor::Property::Position), destPos, AlphaFunctions::EaseInOutSine, TimePeriod(animDuration) );
}
mActorTapMovementAnimation.SetEndAction( Animation::Bake );
mActorTapMovementAnimation.Play();
mActorTapMovementAnimation = Animation::New( animDuration );
if ( mMotionStretchImageActor )
{
- mActorTapMovementAnimation.AnimateTo( Property(mMotionStretchImageActor, Actor::POSITION), destPos, AlphaFunctions::EaseInOutSine, TimePeriod(animDuration) );
+ mActorTapMovementAnimation.AnimateTo( Property(mMotionStretchImageActor, Actor::Property::Position), destPos, AlphaFunctions::EaseInOutSine, TimePeriod(animDuration) );
}
mActorTapMovementAnimation.SetEndAction( Animation::Bake );
mActorTapMovementAnimation.Play();
// Constrain the vertices of the square mesh to sweep out a sector as the
// rotation angle is animated.
- mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(1, AnimatableVertex::POSITION),
+ mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(1, AnimatableVertex::Property::Position),
srcStart, srcStart, SquareFanConstraint(0)));
- mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(2, AnimatableVertex::POSITION),
+ mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(2, AnimatableVertex::Property::Position),
srcStart, srcRot, SquareFanConstraint(0)));
- mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(3, AnimatableVertex::POSITION),
+ mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(3, AnimatableVertex::Property::Position),
srcStart, srcRot, SquareFanConstraint(1)));
- mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(4, AnimatableVertex::POSITION),
+ mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(4, AnimatableVertex::Property::Position),
srcStart, srcRot, SquareFanConstraint(2)));
- mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(5, AnimatableVertex::POSITION),
+ mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(5, AnimatableVertex::Property::Position),
srcStart, srcRot, SquareFanConstraint(3)));
- mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(6, AnimatableVertex::POSITION),
+ mMesh.ApplyConstraint(Constraint::New<Vector3>( mMesh.GetPropertyIndex(6, AnimatableVertex::Property::Position),
srcStart, srcRot, SquareFanConstraint(4)));
mStencilActor.SetDrawMode( DrawMode::STENCIL );
handle.SetUniform( "uEffectStrength", 0.f );
handle.SetUniform( "uLightIntensity", 2.5f );
- Property::Index index = handle.RegisterProperty( "uSpinAngle", 0.f );
+ Dali::Property::Index index = handle.RegisterProperty( "uSpinAngle", 0.f );
Constraint constraint = Constraint::New<Vector2>( handle.GetPropertyIndex("uLightSpinOffset"),
LocalSource(index),
LightOffsetConstraint(stageSize.x*0.1f));
// Hack to force screen refresh.
Animation animation = Animation::New(1.0f);
- animation.AnimateTo(Property(mContentLayer, Actor::POSITION), Vector3::ZERO );
+ animation.AnimateTo(Property(mContentLayer, Actor::Property::Position), Vector3::ZERO );
animation.Play();
}
Property::Index angleIndex = mImageActor2.RegisterProperty("angle", Property::Value(30.0f));
Source angleSrc( mImageActor2, angleIndex );
- mImageActor1.ApplyConstraint(Constraint::New<Quaternion>( Actor::ROTATION, angleSrc,
+ mImageActor1.ApplyConstraint(Constraint::New<Quaternion>( Actor::Property::Rotation, angleSrc,
RotationConstraint(-1.0f)));
- mImageActor3.ApplyConstraint(Constraint::New<Quaternion>( Actor::ROTATION, angleSrc,
+ mImageActor3.ApplyConstraint(Constraint::New<Quaternion>( Actor::Property::Rotation, angleSrc,
RotationConstraint(+1.0f)));
mSceneAnimation = Animation::New(2.5f);
Dali::Layer toolBarLayer = Dali::Layer::New();
toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
toolBarLayer.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
- toolBarLayer.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::SourceWidthFixedHeight( style.mToolBarHeight ) ) );
+ toolBarLayer.ApplyConstraint( Dali::Constraint::New<Dali::Vector3>( Dali::Actor::Property::Size, Dali::ParentSource( Dali::Actor::Property::Size ), Dali::SourceWidthFixedHeight( style.mToolBarHeight ) ) );
toolBarLayer.SetSize( 0.0f, style.mToolBarHeight );
// Raise tool bar layer to the top.