if(!layer)
{
layer = Layer::New();
- layer.SetParentOrigin(ParentOrigin::CENTER);
- layer.SetAnchorPoint(AnchorPoint::CENTER);
- layer.SetSize( stage.GetRootLayer().GetCurrentSize() );
+ layer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+ layer.SetSize( stage.GetRootLayer().GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) );
stage.GetRootLayer().Add(layer);
// render tasks may have been setup last load so remove them
mImageView = Toolkit::ImageView::New();
mImageView.SetSize(200, 200);
- mImageView.SetParentOrigin( ParentOrigin::CENTER );
+ mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
stage.Add(mImageView);
mImageLabel = Toolkit::TextLabel::New();
- mImageLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mImageLabel.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER );
+ mImageLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mImageLabel.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER );
mImageLabel.SetPosition( Vector3( 0.0f, -50.0f, 0.0f ) );
mImageLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK );
stage.Add(mImageLabel);
mMaskLabel = Toolkit::TextLabel::New();
- mMaskLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mMaskLabel.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER );
+ mMaskLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mMaskLabel.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER );
mMaskLabel.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
mMaskLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK );
stage.Add(mMaskLabel);
FONT_SCALE = 0.25f * STAGE_SIZE.y / STAGE_SIZE.x;
mBackground = Control::New();
- mBackground.SetParentOrigin( ParentOrigin::CENTER );
- mBackground.SetAnchorPoint( AnchorPoint::CENTER );
+ mBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mBackground.SetSize( STAGE_SIZE );
mStage.Add( mBackground );
{
mButtonIconDecall = ImageView::New();
mButtonIconDecall.SetImage( ICON_DECALL_IMAGE );
- mButtonIconDecall.SetParentOrigin( ParentOrigin::CENTER );
- mButtonIconDecall.SetAnchorPoint( AnchorPoint::CENTER );
+ mButtonIconDecall.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mButtonIconDecall.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mButtonIconDecall.SetSize( ICON_DECALL_SIZE * SCALED_WIDTH );
mButtonIconDecall.SetPosition( ICON_DECALL_POSITION * SCALED_WIDTH );
mButtonIconBattery = ImageView::New();
mButtonIconBattery.SetImage( ICON_BATTERY_IMAGE );
- mButtonIconBattery.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mButtonIconBattery.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mButtonIconBattery.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mButtonIconBattery.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mButtonIconBattery.SetSize( ICON_BATTERY_SIZE * SCALED_WIDTH );
mButtonIconBattery.SetPosition( ICON_BATTERY_POSITION * SCALED_WIDTH );
mCallStartButton = PushButton::New();
- mCallStartButton.SetParentOrigin( ParentOrigin::CENTER );
- mCallStartButton.SetAnchorPoint( AnchorPoint::CENTER );
+ mCallStartButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mCallStartButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mCallStartButton.SetSize( BUTTON_CALL_START_SIZE * SCALED_WIDTH );
mCallStartButton.SetPosition( BUTTON_CALL_START_POSITION * SCALED_WIDTH );
mCallStartButton.ClickedSignal().Connect( this, &CallController::OnButtonClicked );
mStage.Add( mButtonIconBattery );
mLabelIncoming = TextLabel::New( LABEL_INCOMING_STR );
- mLabelIncoming.SetParentOrigin( ParentOrigin::CENTER );
- mLabelIncoming.SetAnchorPoint( AnchorPoint::CENTER );
+ mLabelIncoming.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mLabelIncoming.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLabelIncoming.SetSize( LABEL_INCOMING_SIZE * SCALED_STAGE_SIZE );
mLabelIncoming.SetPosition( LABEL_INCOMING_POSITION * SCALED_STAGE_SIZE_3 );
- mLabelIncoming.SetVisible( true );
+ mLabelIncoming.SetProperty( Actor::Property::VISIBLE, true );
mLabelIncoming.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_INCOMING_FONT_COLOR );
mLabelIncoming.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_INCOMING_FONT_SIZE * FONT_SCALE );
mLabelIncoming.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mLabelIncoming.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mLabelName = TextLabel::New( LABEL_NAME_STR );
- mLabelName.SetParentOrigin( ParentOrigin::CENTER );
- mLabelName.SetAnchorPoint( AnchorPoint::CENTER );
+ mLabelName.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mLabelName.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLabelName.SetSize( LABEL_NAME_SIZE * SCALED_STAGE_SIZE );
mLabelName.SetPosition( LABEL_NAME_POSITION * SCALED_STAGE_SIZE_3 );
- mLabelName.SetVisible( true );
+ mLabelName.SetProperty( Actor::Property::VISIBLE, true );
mLabelName.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_NAME_FONT_COLOR );
mLabelName.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_NAME_FONT_SIZE * FONT_SCALE );
mLabelName.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mLabelName.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mLabelNumber = TextLabel::New( LABEL_NUMBER_STR );
- mLabelNumber.SetParentOrigin( ParentOrigin::CENTER );
- mLabelNumber.SetAnchorPoint( AnchorPoint::CENTER );
+ mLabelNumber.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mLabelNumber.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLabelNumber.SetSize( LABEL_NUMBER_SIZE * SCALED_STAGE_SIZE );
mLabelNumber.SetPosition( LABEL_NUMBER_POSITION * SCALED_STAGE_SIZE_3 );
- mLabelNumber.SetVisible( true );
+ mLabelNumber.SetProperty( Actor::Property::VISIBLE, true );
mLabelNumber.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_NUMBER_FONT_COLOR );
mLabelNumber.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_NUMBER_FONT_SIZE * FONT_SCALE );
mLabelNumber.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mLabelNumber.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mLabelDecline = TextLabel::New( LABEL_DECLINE_STR );
- mLabelDecline.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mLabelDecline.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mLabelDecline.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mLabelDecline.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mLabelDecline.SetSize( LABEL_DECLINE_SIZE * SCALED_STAGE_SIZE );
mLabelDecline.SetPosition( LABEL_DECLINE_POSITION * SCALED_WIDTH );
- mLabelDecline.SetVisible( true );
+ mLabelDecline.SetProperty( Actor::Property::VISIBLE, true );
mLabelDecline.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_DECLINE_FONT_COLOR );
mLabelDecline.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_DECLINE_FONT_SIZE * FONT_SCALE );
mLabelDecline.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
void SetupActiveActors()
{
mButtonClip = Control::New();
- mButtonClip.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mButtonClip.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER );
+ mButtonClip.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mButtonClip.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER );
mButtonClip.SetSize( BUTTON_DECALL_SIZE * SCALED_WIDTH );
mButtonClip.SetPosition( BUTTON_DECALL_CLIP_POSITION * SCALED_WIDTH );
mButtonIcon = ImageView::New();
mButtonIcon.SetImage( BUTTON_DECALL_ICON_IMAGE );
- mButtonIcon.SetParentOrigin( ParentOrigin::CENTER );
- mButtonIcon.SetAnchorPoint( AnchorPoint::CENTER );
+ mButtonIcon.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mButtonIcon.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mButtonIcon.SetSize( BUTTON_DECALL_ICON_SIZE * SCALED_WIDTH );
mButtonIcon.SetPosition( BUTTON_DECALL_ICON_POSITION * SCALED_WIDTH );
mCallEndButton = PushButton::New();
- mCallEndButton.SetParentOrigin( ParentOrigin::CENTER );
- mCallEndButton.SetAnchorPoint( AnchorPoint::CENTER );
+ mCallEndButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mCallEndButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mCallEndButton.SetSize( BUTTON_DECALL_SIZE * SCALED_WIDTH );
mCallEndButton.SetPosition( BUTTON_DECALL_POSITION * SCALED_WIDTH );
mCallEndButton.ClickedSignal().Connect( this, &CallController::OnButtonClicked );
mButtonClip.Add( mButtonIcon );
mLabelTime = TextLabel::New( LABEL_TIME_STR );
- mLabelTime.SetParentOrigin( ParentOrigin::CENTER );
- mLabelTime.SetAnchorPoint( AnchorPoint::CENTER );
+ mLabelTime.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mLabelTime.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLabelTime.SetSize( LABEL_TIME_SIZE * SCALED_STAGE_SIZE );
mLabelTime.SetPosition( LABEL_TIME_POSITION * SCALED_STAGE_SIZE_3 );
- mLabelTime.SetVisible( false );
+ mLabelTime.SetProperty( Actor::Property::VISIBLE, false );
mLabelTime.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_TIME_FONT_COLOR );
mLabelTime.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_TIME_FONT_SIZE * FONT_SCALE );
mLabelTime.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mCard[k].SetProperty(Toolkit::ImageView::Property::IMAGE, propertyMap);
}
- mCard[k].SetParentOrigin( ParentOrigin::CENTER );
- mCard[k].SetAnchorPoint( AnchorPoint::CENTER );
+ mCard[k].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mCard[k].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mCard[k].SetSize( mSize.x, mSize.y );
mCard[k].SetPosition( mPosition[k].x, mPosition[k].y );
FONT_SCALE = 0.25f * STAGE_SIZE.y / STAGE_SIZE.x;
mBackground = Control::New();
- mBackground.SetParentOrigin( ParentOrigin::CENTER );
- mBackground.SetAnchorPoint( AnchorPoint::CENTER );
+ mBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mBackground.SetSize( STAGE_SIZE );
mStage.Add( mBackground );
{
mAddButton = ImageView::New();
mAddButton.SetImage( BUTTON_ADD_IMAGE );
- mAddButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mAddButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mAddButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mAddButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mAddButton.SetSize( BUTTON_ADD_SIZE * SCALED_WIDTH );
mAddButton.SetPosition( BUTTON_ADD_POSITION * SCALED_WIDTH );
mLabel1 = TextLabel::New( LABEL_TICKET_STR );
- mLabel1.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mLabel1.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mLabel1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mLabel1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mLabel1.SetSize( LABEL_TICKET_SIZE * SCALED_WIDTH );
mLabel1.SetPosition( LABEL_TICKET_POSITION * SCALED_WIDTH );
- mLabel1.SetVisible( true );
+ mLabel1.SetProperty( Actor::Property::VISIBLE, true );
mLabel1.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_TICKET_FONT_COLOR );
mLabel1.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_TICKET_FONT_SIZE * FONT_SCALE );
mLabel1.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mLabel1.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mLabel2 = TextLabel::New( LABEL_HOLD_STR );
- mLabel2.SetParentOrigin( ParentOrigin::CENTER );
- mLabel2.SetAnchorPoint( AnchorPoint::CENTER );
+ mLabel2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mLabel2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLabel2.SetSize( LABEL_HOLD_SIZE * SCALED_WIDTH );
mLabel2.SetPosition( LABEL_HOLD_POSITION * SCALED_WIDTH );
- mLabel2.SetVisible( false );
+ mLabel2.SetProperty( Actor::Property::VISIBLE, false );
mLabel2.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_HOLD_FONT_COLOR );
mLabel2.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_HOLD_FONT_SIZE * FONT_SCALE );
mLabel2.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mLabel2.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mLabel3 = TextLabel::New( LABEL_TERMINAL_STR );
- mLabel3.SetParentOrigin( ParentOrigin::CENTER );
- mLabel3.SetAnchorPoint( AnchorPoint::CENTER );
+ mLabel3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mLabel3.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLabel3.SetSize( LABEL_TERMINAL_SIZE * SCALED_WIDTH );
mLabel3.SetPosition( LABEL_TERMINAL_POSITION * SCALED_WIDTH );
- mLabel3.SetVisible( false );
+ mLabel3.SetProperty( Actor::Property::VISIBLE, false );
mLabel3.SetProperty( TextLabel::Property::TEXT_COLOR, LABEL_TERMINAL_FONT_COLOR );
mLabel3.SetProperty( TextLabel::Property::POINT_SIZE, LABEL_TERMINAL_FONT_SIZE * FONT_SCALE );
mLabel3.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mArrayButton = CreateRadioButton( ARRAY_RADIO_BUTTON_NAME, false );
Toolkit::TableView radioButtonLayout = Toolkit::TableView::New( 1, 2 );
- radioButtonLayout.SetName( "RadioButtonsLayout" );
+ radioButtonLayout.SetProperty( Dali::Actor::Property::NAME, "RadioButtonsLayout" );
radioButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
radioButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- radioButtonLayout.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- radioButtonLayout.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ radioButtonLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ radioButtonLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
radioButtonLayout.SetFitHeight( 0 );
radioButtonLayout.AddChild( mGifButton, TableView::CellPosition( 0, 0 ) );
radioButtonLayout.AddChild( mArrayButton, TableView::CellPosition( 0, 1 ) );
// Create and lay out the image view according to the index
control = Toolkit::ImageView::New();
control.SetProperty( Toolkit::ImageView::Property::IMAGE, SetupViewProperties( mImageType, index ) );
- control.SetAnchorPoint( IMAGE_LAYOUT_INFO[ index ].anchorPoint );
- control.SetParentOrigin( IMAGE_LAYOUT_INFO[ index ].parentOrigin );
+ control.SetProperty( Actor::Property::ANCHOR_POINT, IMAGE_LAYOUT_INFO[ index ].anchorPoint );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, IMAGE_LAYOUT_INFO[ index ].parentOrigin );
control.SetY( IMAGE_LAYOUT_INFO[ index ].yPosition );
// We do not want the animated image playing when it's added to the stage.
Toolkit::PushButton animateButton = Toolkit::PushButton::New();
animateButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON_UNSELECTED );
animateButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED );
- animateButton.SetParentOrigin( ParentOrigin::CENTER );
- animateButton.SetAnchorPoint( AnchorPoint::CENTER );
+ animateButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ animateButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
animateButton.ClickedSignal().Connect( this, &AnimatedImageController::OnPlayButtonClicked );
control.Add( animateButton );
// Creates the background gradient
Toolkit::Control background = Dali::Toolkit::Control::New();
- background.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- background.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ background.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ background.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
Dali::Property::Map map;
map.Insert( Toolkit::Visual::Property::TYPE, Visual::GRADIENT );
// Create a TextLabel for the application title.
Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE );
- label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- label.SetParentOrigin( Vector3( 0.5f, 0.0f, 0.5f ) );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.0f, 0.5f ) );
label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
Actor actor = Actor::New();
actor.SetSize( 400.0f, 400.0f );
actor.SetPosition( center );
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetColor(Vector4(1.0f,1.0f,0.0f,1.0f) );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::COLOR,Vector4(1.0f,1.0f,0.0f,1.0f) );
actor.AddRenderer( renderer );
Stage stage = Stage::GetCurrent();
Actor actor = Actor::New();
actor.SetSize( 400.0f, 400.0f );
actor.SetPosition( center );
- actor.SetAnchorPoint( AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
actor.AddRenderer( renderer );
Stage stage = Stage::GetCurrent();
Actor actor = Actor::New();
actor.SetSize( 400.0f, 400.0f );
actor.SetPosition( center );
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetColor(Vector4(1.0f,0.0f,0.0f,1.0f) );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::COLOR,Vector4(1.0f,0.0f,0.0f,1.0f) );
actor.AddRenderer( renderer );
Stage stage = Stage::GetCurrent();
unsigned int GetControlIndex( Control control )
{
- std::string controlName = control.GetName();
+ std::string controlName = control.GetProperty< std::string >( Dali::Actor::Property::NAME );
unsigned int index = 0;
if ( controlName != "")
// Create a table view to show a pair of buttons above each image.
mTable = TableView::New( CellPlacement::NUMBER_OF_ROWS, NUMBER_OF_IMAGES );
- mTable.SetAnchorPoint( AnchorPoint::CENTER );
- mTable.SetParentOrigin( ParentOrigin::CENTER );
+ mTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mTable.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
Vector3 offset( 0.9f, 0.70f, 0.0f );
mTable.SetSizeModeFactor( offset );
{
mPlayButtons[x] = PushButton::New();
mPlayButtons[x].SetProperty( Button::Property::LABEL, "Play" );
- mPlayButtons[x].SetParentOrigin( ParentOrigin::TOP_CENTER );
- mPlayButtons[x].SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mPlayButtons[x].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mPlayButtons[x].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mPlayButtons[x].ClickedSignal().Connect( this, &AnimatedVectorImageViewController::OnPlayButtonClicked );
mPlayButtons[x].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mPlayButtons[x].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
std::string s = std::to_string(x);
- mPlayButtons[x].SetName( s );
+ mPlayButtons[x].SetProperty( Dali::Actor::Property::NAME, s );
mTable.AddChild( mPlayButtons[x], TableView::CellPosition( CellPlacement::TOP_BUTTON, x ) );
mStopButtons[x] = PushButton::New();
mStopButtons[x].SetProperty( Button::Property::LABEL, "Stop" );
- mStopButtons[x].SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mStopButtons[x].SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mStopButtons[x].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mStopButtons[x].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mStopButtons[x].ClickedSignal().Connect( this, &AnimatedVectorImageViewController::OnStopButtonClicked );
mStopButtons[x].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mStopButtons[x].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- mStopButtons[x].SetName( s );
+ mStopButtons[x].SetProperty( Dali::Actor::Property::NAME, s );
mTable.AddChild( mStopButtons[x], TableView::CellPosition( CellPlacement::LOWER_BUTTON, x ) );
mImageViews[x] = ImageView::New( );
imagePropertyMap.Insert( DevelImageVisual::Property::LOOP_COUNT, 3 );
mImageViews[x].SetProperty( ImageView::Property::IMAGE, imagePropertyMap );
- mImageViews[x].SetParentOrigin( ParentOrigin::CENTER );
- mImageViews[x].SetAnchorPoint( AnchorPoint::CENTER );
+ mImageViews[x].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mImageViews[x].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mImageViews[x].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mImageViews[x].SetName( s );
+ mImageViews[x].SetProperty( Dali::Actor::Property::NAME, s );
DevelControl::VisualEventSignal( mImageViews[x] ).Connect( this, &AnimatedVectorImageViewController::OnVisualEvent );
stage.SetBackgroundColor( Color::WHITE );
mControl = Control::New();
- mControl.SetParentOrigin( ParentOrigin::CENTER );
+ mControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mControl.SetSize( 200.0f, 200.0f );
mControl.SetProperty( Control::Property::BACKGROUND, BACKGROUND );
unsigned int totalColumns = mColumnsPerPage * mPageCount;
- float finalZ = Dali::Stage::GetCurrent().GetRenderTaskList().GetTask(0).GetCameraActor().GetCurrentWorldPosition().z;
+ float finalZ = Dali::Stage::GetCurrent().GetRenderTaskList().GetTask(0).GetCameraActor().GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ).z;
float totalDuration( 5.0f);
float durationPerActor( 0.5f );
float delayBetweenActors = ( totalDuration - durationPerActor) / (mRowsPerPage*mColumnsPerPage);
mContentLayer = Layer::New();
mContentLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mContentLayer.TouchSignal().Connect(this, &BezierCurveExample::OnTouchLayer);
- mContentLayer.SetParentOrigin( ParentOrigin::CENTER );
+ mContentLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
stage.Add( mContentLayer );
// 6 rows: title, grid, coords, play, anim1, anim2
TableView contentLayout = TableView::New(5, 1);
- contentLayout.SetName("contentLayout");
+ contentLayout.SetProperty( Dali::Actor::Property::NAME,"contentLayout");
contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
contentLayout.SetCellPadding( Size( 30, 30 ) );
- contentLayout.SetParentOrigin(ParentOrigin::TOP_CENTER);
- contentLayout.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_CENTER);
+ contentLayout.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER);
mContentLayer.Add( contentLayout );
// Create a TextLabel for the application title.
mGrid.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
mGrid.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
- mGrid.SetParentOrigin(ParentOrigin::CENTER);
- mGrid.SetAnchorPoint(AnchorPoint::CENTER);
+ mGrid.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mGrid.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
mGrid.SetBackgroundColor(GRID_BACKGROUND_COLOR);
contentLayout.Add( mGrid );
mCoefficientLabel.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
mCoefficientLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mCoefficientLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
- mCoefficientLabel.SetParentOrigin(ParentOrigin::CENTER);
+ mCoefficientLabel.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
contentLayout.Add( mCoefficientLabel );
SetLabel( Vector2(0,0), Vector2(1,1));
// Setup Play button and 2 icons to show off current anim and linear anim
PushButton play = PushButton::New();
- play.SetName("Play");
- play.SetParentOrigin(ParentOrigin::CENTER);
+ play.SetProperty( Dali::Actor::Property::NAME,"Play");
+ play.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
play.SetProperty( Button::Property::LABEL, "Play");
play.ClickedSignal().Connect( this, &BezierCurveExample::OnPlayClicked );
contentLayout.SetFitHeight(3);
auto animContainer = Control::New();
- animContainer.SetName("AnimationContainer");
- animContainer.SetParentOrigin( ParentOrigin::CENTER );
+ animContainer.SetProperty( Dali::Actor::Property::NAME,"AnimationContainer");
+ animContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
animContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
auto animRail = Control::New();
.Add( ImageVisual::Property::URL, ANIMATION_BACKGROUND ) );
animRail.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
animRail.SetSizeModeFactor( Vector3( 0.666f, 0.2f, 1.0f ) );
- animRail.SetParentOrigin( ParentOrigin::CENTER );
+ animRail.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
animContainer.Add( animRail );
contentLayout.Add( animContainer );
contentLayout.SetFixedHeight(4, 150 );
mAnimIcon1 = ImageView::New( CIRCLE1_IMAGE );
- mAnimIcon1.SetParentOrigin( ParentOrigin::CENTER );
- mAnimIcon1.SetAnchorPoint( AnchorPoint::CENTER );
+ mAnimIcon1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mAnimIcon1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
// Would like some means of setting and animating position as a percentage of
// parent size without using constraints, but this will have to suffice for the moment.
void CreateBackground( Stage stage )
{
Toolkit::Control background = Dali::Toolkit::Control::New();
- background.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- background.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ background.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ background.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
Property::Map map;
// Create a mesh to draw the cubic as a single line
mCurve = Actor::New();
mCurve.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mCurve.SetParentOrigin( ParentOrigin::CENTER );
+ mCurve.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Shader shader = Shader::New( CURVE_VERTEX_SHADER, CURVE_FRAGMENT_SHADER );
{
Actor actor = ImageView::New( url );
actor.SetScale( mControlPointScale);
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// Curve and line drawing works off current value (i.e. last update frame's value). Need to animate to ensure
// initial position is baked to both frames before initially drawing the curve.
auto positionAnimation = Animation::New( 0.01f );
{
Actor line = Actor::New();
line.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- line.SetParentOrigin( ParentOrigin::CENTER );
+ line.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Shader shader = Shader::New( CURVE_VERTEX_SHADER, CURVE_FRAGMENT_SHADER );
Geometry geometry = Geometry::New();
TextLabel progressionLabel = TextLabel::New( "Progression" );
progressionLabel.SetProperty( TextLabel::Property::POINT_SIZE, AXIS_LABEL_POINT_SIZE );
progressionLabel.SetOrientation( Degree(-90.0f), Vector3::ZAXIS );
- progressionLabel.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
- progressionLabel.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
+ progressionLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT );
+ progressionLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
CreateLine( progressionLabel, ParentOrigin::BOTTOM_LEFT );
TextLabel timeLabel = TextLabel::New( "Time" );
timeLabel.SetProperty( TextLabel::Property::POINT_SIZE, AXIS_LABEL_POINT_SIZE );
- timeLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- timeLabel.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
+ timeLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ timeLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
CreateLine( timeLabel, ParentOrigin::TOP_LEFT );
parent.Add( progressionLabel );
void CreateLine( Actor parent, const Vector3& parentOrigin )
{
Control control = Control::New();
- control.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- control.SetParentOrigin( parentOrigin );
+ control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, parentOrigin );
control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
control.SetProperty( Actor::Property::SIZE_HEIGHT, AXIS_LINE_SIZE );
control.SetBackgroundColor( Color::BLACK );
{
Vector3 gridSize = mGrid.GetProperty<Vector3>( Actor::Property::SIZE ); // Get target value
- pt1 = AlignToGrid( mControlPoint1.GetCurrentPosition(), gridSize );
- pt2 = AlignToGrid( mControlPoint2.GetCurrentPosition(), gridSize );
+ pt1 = AlignToGrid( mControlPoint1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), gridSize );
+ pt2 = AlignToGrid( mControlPoint2.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), gridSize );
}
/**
void GetPoint( Actor actor, Vector2& point, Vector2& position)
{
auto gridSize = mGrid.GetProperty<Vector3>( Actor::Property::SIZE ); // Get target value
- auto currentPosition = actor.GetCurrentPosition(); // Get constrained current value
+ auto currentPosition = actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ); // Get constrained current value
position = Vector2( floor( currentPosition.x ), floor( currentPosition.y ) );
{
Vector2 screenPoint = event.GetScreenPosition( 0 );
mRelativeDragPoint = screenPoint;
- mRelativeDragPoint -= Vector2(controlPoint.GetCurrentPosition());
+ mRelativeDragPoint -= Vector2(controlPoint.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ));
mDragActor = controlPoint;
mDragAnimation = Animation::New(0.25f);
mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3( mControlPointZoomScale, mControlPointZoomScale, 1.0f), AlphaFunction::EASE_OUT);
mPaddleImage = CreateImage(PADDLE_IMAGE);
mPaddle.Add( mPaddleHandle );
mPaddle.Add( mPaddleImage );
- mPaddleHandle.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mPaddleHandle.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mPaddleHandle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mPaddleHandle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mPaddleHandle.SetPosition( 0.0f, stageSize.width * 0.0125f );
- mPaddleImage.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mPaddleImage.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mPaddle.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mPaddle.SetAnchorPoint( AnchorPoint::CENTER );
+ mPaddleImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mPaddleImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ mPaddle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mPaddle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mPaddleFullSize = PADDLE_SIZE * stageSize.width;
mPaddle.SetSize( mPaddleFullSize + mPaddleHitMargin );
mPaddleHandle.SetSize( PADDLE_HANDLE_SIZE * stageSize.width );
}
mLevelContainer = Actor::New();
- mLevelContainer.SetAnchorPoint( AnchorPoint::CENTER );
- mLevelContainer.SetParentOrigin( ParentOrigin::CENTER );
+ mLevelContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mLevelContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mLevelContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mContentLayer.Add( mLevelContainer );
mBrickImageMap["url"] = BRICK_IMAGE_PATH[type];
ImageView brick = ImageView::New();
brick.SetProperty( ImageView::Property::IMAGE, mBrickImageMap );
- brick.SetParentOrigin(ParentOrigin::TOP_LEFT);
- brick.SetAnchorPoint(AnchorPoint::CENTER);
+ brick.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ brick.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
brick.SetPosition( Vector3( position ) );
// Add a constraint on the brick between it and the ball generating a collision-property
propertyMap.Insert(DevelVisual::Property::VISUAL_FITTING_MODE, DevelVisual::FILL);
ImageView actor = ImageView::New();
actor.SetProperty(Toolkit::ImageView::Property::IMAGE, propertyMap);
- actor.SetParentOrigin(ParentOrigin::TOP_LEFT);
- actor.SetAnchorPoint(AnchorPoint::CENTER);
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
return actor;
}
// Get point where user touched paddle (relative to paddle's center)
Vector2 screenPoint = event.GetScreenPosition( 0 );
mRelativeDragPoint = screenPoint;
- mRelativeDragPoint -= actor.GetCurrentPosition();
+ mRelativeDragPoint -= actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
mDragActor = actor;
mDragAnimation = Animation::New(0.25f);
{
// Reposition Ball in start position, and make ball appear.
mBall.SetPosition( mBallStartPosition );
- mBall.SetColor( Vector4(1.0f, 1.0f, 1.0f, 0.1f) );
+ mBall.SetProperty( Actor::Property::COLOR, Vector4(1.0f, 1.0f, 1.0f, 0.1f) );
Animation appear = Animation::New(0.5f);
appear.AnimateTo( Property(mBall, Actor::Property::COLOR), Vector4(1.0f, 1.0f, 1.0f, 1.0f) );
appear.Play();
{
Actor delegate = Actor::DownCast(source.GetTarget());
Vector3 collisionVector = delegate.GetCurrentProperty< Vector3 >( source.GetTargetProperty() );
- Vector3 ballRelativePosition(mBall.GetCurrentPosition() - mPaddle.GetCurrentPosition());
+ Vector3 ballRelativePosition(mBall.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ) - mPaddle.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ));
ballRelativePosition.Normalize();
collisionVector.x += ballRelativePosition.x * 0.5f;
Vector2 viewSize( stageSize );
mRootActor = Actor::New();
- mRootActor.SetParentOrigin( ParentOrigin::CENTER );
+ mRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mRootActor.SetSize( stageSize );
stage.Add( mRootActor );
// Create the object that will perform the blooming work
mBloomView = Dali::Toolkit::BloomView::New();
- mBloomView.SetParentOrigin( ParentOrigin::CENTER );
+ mBloomView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mBloomView.SetSize( viewSize );
mRootActor.Add( mBloomView );
mBloomView.Activate();
Layer backgroundLayer = Layer::New();
backgroundLayer.SetSize( viewSize );
- backgroundLayer.SetParentOrigin( ParentOrigin::CENTER );
+ backgroundLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mBloomView.Add( backgroundLayer );
// Create the background image
ImageView backgroundImage = ImageView::New( BACKGROUND_IMAGE_PATH );
- backgroundImage.SetParentOrigin( ParentOrigin::CENTER );
+ backgroundImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
backgroundImage.SetSize( viewSize );
backgroundLayer.Add( backgroundImage );
Layer foregroundLayer = Layer::New();
foregroundLayer.SetSize( viewSize );
- foregroundLayer.SetParentOrigin( ParentOrigin::CENTER );
+ foregroundLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mBloomView.Add( foregroundLayer );
// Create visible actors
mObjectRootActor = Actor::New();
- mObjectRootActor.SetParentOrigin( ParentOrigin::CENTER );
+ mObjectRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mObjectRootActor.SetSize( viewSize );
foregroundLayer.Add( mObjectRootActor );
ImageView imageView = ImageView::New( UI_DIFFUSE_IMAGE );
- imageView.SetParentOrigin( ParentOrigin::CENTER );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageView.SetSize( viewSize );
mObjectRootActor.Add( imageView );
imageView = ImageView::New( UI_DIFFUSE_IMAGE );
- imageView.SetParentOrigin( ParentOrigin::CENTER );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageView.SetSize( stageSize * 0.5f );
imageView.SetPosition( 0.0f, 0.0f, 100.0f );
mObjectRootActor.Add( imageView );
// Get the root actor of all bubbles, and add it to stage.
Actor bubbleRoot = mBubbleEmitter.GetRootActor();
- bubbleRoot.SetParentOrigin(ParentOrigin::CENTER);
+ bubbleRoot.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
bubbleRoot.SetZ(0.1f); // Make sure the bubbles displayed on top og the background.
content.Add( bubbleRoot );
mItemView = ItemView::New(*this);
- mItemView.SetParentOrigin(ParentOrigin::CENTER);
- mItemView.SetAnchorPoint(AnchorPoint::CENTER);
+ mItemView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mItemView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
mLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
mLayout->SetItemSize( Vector3( stage.GetSize().width, 50, 1 ) );
{
ReloadJsonFile( name, mBuilder, mBuilderLayer );
- mBuilderLayer.SetParentOrigin(ParentOrigin::BOTTOM_CENTER);
- mBuilderLayer.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER);
- Dali::Vector3 size = Stage::GetCurrent().GetRootLayer().GetCurrentSize();
+ mBuilderLayer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_CENTER);
+ mBuilderLayer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER);
+ Dali::Vector3 size = Stage::GetCurrent().GetRootLayer().GetCurrentProperty< Vector3 >( Actor::Property::SIZE );
size.y -= DemoHelper::DEFAULT_VIEW_STYLE.mToolBarHeight;
mBuilderLayer.SetSize( size );
backButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE );
backButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED );
backButton.ClickedSignal().Connect( this, &ExampleApp::OnBackButtonPressed);
- backButton.SetLeaveRequired( true );
+ backButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
mNavigationView = Toolkit::NavigationView::New();
mNavigationView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mNavigationView.SetAnchorPoint( AnchorPoint::TOP_LEFT);
+ mNavigationView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
stage.Add( mNavigationView );
Toolkit::TableView contentTable = Toolkit::TableView::New( 4, 1 );
contentTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
contentTable.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ contentTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ contentTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
mRadioButtonImage1 = Dali::Toolkit::RadioButton::New( "1" );
- mRadioButtonImage1.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mRadioButtonImage1.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mRadioButtonImage1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mRadioButtonImage1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mRadioButtonImage1.SetPosition( 0, DP(radioY) );
mRadioButtonImage1.SetProperty( Toolkit::Button::Property::SELECTED, true );
image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
mRadioButtonImage2 = Dali::Toolkit::RadioButton::New( "2" );
- mRadioButtonImage2.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mRadioButtonImage2.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mRadioButtonImage2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mRadioButtonImage2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mRadioButtonImage2.SetPosition( 0, DP(radioY) );
imageSelectTableView.AddChild( mRadioButtonImage2, Toolkit::TableView::CellPosition( 1, 0 ) );
image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
mRadioButtonImage3 = Dali::Toolkit::RadioButton::New( "3" );
- mRadioButtonImage3.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mRadioButtonImage3.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mRadioButtonImage3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mRadioButtonImage3.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mRadioButtonImage3.SetPosition( 0, DP(radioY) );
imageSelectTableView.AddChild( mRadioButtonImage3, Toolkit::TableView::CellPosition( 2, 0 ) );
// Create select button
mUpdateButton = Toolkit::PushButton::New();
mUpdateButton.SetProperty( Toolkit::Button::Property::LABEL, "Select" );
- mUpdateButton.SetName( "selectButton" );
+ mUpdateButton.SetProperty( Dali::Actor::Property::NAME, "selectButton" );
mUpdateButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mUpdateButton.ClickedSignal().Connect( this, &ButtonsController::OnButtonClicked );
// First radio button
{
Toolkit::RadioButton radioButton = Dali::Toolkit::RadioButton::New( "Select enabled" );
- radioButton.SetName( "radioSelectEnable" );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ radioButton.SetProperty( Dali::Actor::Property::NAME, "radioSelectEnable" );
+ radioButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ radioButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
radioButton.SetPosition( 0, 0 );
radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
// Second radio button
{
Toolkit::RadioButton radioButton = Dali::Toolkit::RadioButton::New( "Select disabled" );
- radioButton.SetName( "radioSelectDisable" );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ radioButton.SetProperty( Dali::Actor::Property::NAME, "radioSelectDisable" );
+ radioButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ radioButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
radioButton.SetPosition( 0, DP(50) );
radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton );
{
mCheckboxButton1 = Toolkit::CheckBoxButton::New();
- mCheckboxButton1.SetName( "checkbox1" );
+ mCheckboxButton1.SetProperty( Dali::Actor::Property::NAME, "checkbox1" );
mCheckboxButton1.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox1 is unselected" );
mCheckboxButton1.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
mCheckboxButton1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
{
mCheckboxButton2 = Toolkit::CheckBoxButton::New();
- mCheckboxButton2.SetName( "checkbox2" );
+ mCheckboxButton2.SetProperty( Dali::Actor::Property::NAME, "checkbox2" );
mCheckboxButton2.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox2 is selected" );
mCheckboxButton2.SetProperty( Toolkit::Button::Property::SELECTED, true );
mCheckboxButton2.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
{
mCheckboxButton3 = Toolkit::CheckBoxButton::New();
- mCheckboxButton3.SetName( "checkbox3" );
+ mCheckboxButton3.SetProperty( Dali::Actor::Property::NAME, "checkbox3" );
mCheckboxButton3.SetProperty( Toolkit::Button::Property::LABEL, "CheckBox3 is unselected" );
mCheckboxButton3.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
mCheckboxButton3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
return true;
}
- if( button.GetName() == "radioSelectEnable" )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "radioSelectEnable" )
{
mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, false );
mToggleButton.SetProperty( Toolkit::Button::Property::DISABLED, false );
}
- else if( button.GetName() == "radioSelectDisable" )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "radioSelectDisable" )
{
mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, true );
bool OnCheckBoxesSelected( Toolkit::Button button )
{
bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
- if( button.GetName() == "checkbox1" )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "checkbox1" )
{
if( isSelected )
{
}
}
- if( button.GetName() == "checkbox2" )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "checkbox2" )
{
if( isSelected )
{
}
}
- if( button.GetName() == "checkbox3" )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == "checkbox3" )
{
if( isSelected )
{
TextLabel title = TextLabel::New( "Clipping draw order verification" );
title.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
title.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
- title.SetAnchorPoint( AnchorPoint::CENTER );
- title.SetParentOrigin( ParentOrigin::CENTER );
+ title.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ title.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// Create the description label.
TextLabel description = TextLabel::New( "The bottom tree should have the same draw order as the top tree.\nThey should look identical except \"C\" is clipped on the bottom tree." );
description.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
description.SetProperty( TextLabel::Property::MULTI_LINE, true );
- description.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- description.SetParentOrigin( Vector3( 0.5f, 1.0f, 0.5f ) );
+ description.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+ description.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 1.0f, 0.5f ) );
stage.Add( description );
/*
* +---------------+
*/
TableView view = TableView::New( 4, 1 );
- view.SetAnchorPoint( AnchorPoint::CENTER );
- view.SetParentOrigin( ParentOrigin::CENTER );
+ view.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ view.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
view.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
view.SetCellAlignment( Toolkit::TableView::CellPosition( 0, 0 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
for( int tree = 0; tree < 2; ++tree )
{
Control container = Control::New();
- container.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- container.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
container.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Vector4 backgroundColor = tree == 0 ? Vector4( 0.77f, 1.0f, 0.77f, 1.0f ) : Vector4( 0.8f, 0.8f, 1.0f, 1.0f );
container.SetProperty( Control::Property::BACKGROUND, backgroundColor );
std::stringstream labelStream;
labelStream << static_cast<char>( static_cast<char>( i ) + 'A' );
TextLabel textLabel = TextLabel::New( labelStream.str() );
- textLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
image[i] = ImageView::New( images[i] );
- image[i].SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ image[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
// Calculate the relative positioning for the images and labels.
float depth = static_cast<float>( i == 0 ? 0 : ( ( i - 1 ) % 2 ) + 1 );
if( i == 0 )
{
- image[i].SetParentOrigin( Vector3( 0.5f, treeYStart, 0.5f ) );
- textLabel.SetParentOrigin( Vector3( 1.0f, 0.05f * depth, 0.5f ) );
+ image[i].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, treeYStart, 0.5f ) );
+ textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 1.0f, 0.05f * depth, 0.5f ) );
}
else
{
float b = i > 2 ? 1.0f : -1.0f;
- image[i].SetParentOrigin( Vector3( 0.5f + ( 0.2f * b ), depthGap, 0.5f ) );
- textLabel.SetParentOrigin( Vector3( 0.98f + 0.215f * b + ( 0.04f * b * depth ), treeYStart + 0.02f + ( 0.16f * depth ), 0.5f ) );
+ image[i].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f + ( 0.2f * b ), depthGap, 0.5f ) );
+ textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.98f + 0.215f * b + ( 0.04f * b * depth ), treeYStart + 0.02f + ( 0.16f * depth ), 0.5f ) );
}
container.Add( textLabel );
TextLabel treeLabel = TextLabel::New( treeText );
treeLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
treeLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "BOTTOM" );
- treeLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- treeLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ treeLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+ treeLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
container.Add( treeLabel );
// Enable clipping for the 2nd tree.
// Create a TextLabel for the application title.
Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE );
- label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- label.SetParentOrigin( APPLICATION_TITLE_PARENT_ORIGIN );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, APPLICATION_TITLE_PARENT_ORIGIN );
label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
// Create an item-view which clips its children.
mItemView = ItemView::New( mClippingItemFactory );
- mItemView.SetParentOrigin( ParentOrigin::CENTER );
- mItemView.SetAnchorPoint( AnchorPoint::CENTER );
+ mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mItemView.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN ); // Enable clipping. No need to create any renderers.
stage.Add( mItemView );
// Create a border around item-view (as item-view is clipping its children, we should NOT add this as a child of item-view).
Control border = Control::New();
- border.SetParentOrigin( ParentOrigin::CENTER );
- border.SetAnchorPoint( AnchorPoint::CENTER );
+ border.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ border.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
border.SetProperty( Control::Property::BACKGROUND,
Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::BORDER )
.Add( BorderVisual::Property::COLOR, Color::WHITE )
// Create a button to toggle the clipping mode
PushButton button = Toolkit::PushButton::New();
- button.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- button.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
// Add a border image child actor
ImageView borderActor = ImageView::New();
- borderActor.SetParentOrigin( ParentOrigin::CENTER );
- borderActor.SetAnchorPoint( AnchorPoint::CENTER );
+ borderActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ borderActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
borderActor.SetSizeModeFactor( Vector3( 2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f ) );
borderActor.SetColorMode( USE_PARENT_COLOR );
stage.SetBackgroundColor( Color::WHITE );
mImageView = ImageView::New( IMAGE_FILE );
- mImageView.SetParentOrigin( ParentOrigin::CENTER );
+ mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mImageView.SetSize( 200.0f, 200.0f );
mImageView.SetProperty( DevelControl::Property::SHADOW, SHADOW );
// Setup a TableView to hold a grid of images and labels.
Toolkit::TableView table = Toolkit::TableView::New( 3u, 2u );
- table.SetAnchorPoint( AnchorPoint::CENTER );
- table.SetParentOrigin( ParentOrigin::CENTER );
+ table.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ table.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.SetRelativeWidth( 0u, 0.5f );
table.SetRelativeWidth( 1u, 0.5f );
// Add text labels.
TextLabel textLabel = TextLabel::New( "ETC1 (KTX):" );
- textLabel.SetAnchorPoint( AnchorPoint::CENTER );
- textLabel.SetParentOrigin( ParentOrigin::CENTER );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
table.AddChild( textLabel, Toolkit::TableView::CellPosition( 0u, 0u ) );
table.SetCellAlignment( Toolkit::TableView::CellPosition( 0u, 0u ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER );
textLabel = TextLabel::New( "ASTC (KTX) 4x4 linear:" );
- textLabel.SetAnchorPoint( AnchorPoint::CENTER );
- textLabel.SetParentOrigin( ParentOrigin::CENTER );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
table.AddChild( textLabel, Toolkit::TableView::CellPosition( 1u, 0u ) );
table.SetCellAlignment( Toolkit::TableView::CellPosition( 1u, 0u ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER );
textLabel = TextLabel::New( "ASTC (Native) 4x4 linear:" );
- textLabel.SetAnchorPoint( AnchorPoint::CENTER );
- textLabel.SetParentOrigin( ParentOrigin::CENTER );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
table.AddChild( textLabel, Toolkit::TableView::CellPosition( 2u, 0u ) );
// Add images.
Actor actor = Actor::New();
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
AddImage( IMAGE_FILENAME_ETC, actor, geometry, shader );
table.AddChild( actor, Toolkit::TableView::CellPosition( 0u, 1u ) );
table.SetCellAlignment( Toolkit::TableView::CellPosition( 0u, 1u ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
actor = Actor::New();
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
AddImage( IMAGE_FILENAME_ASTC_LINEAR, actor, geometry, shader );
table.AddChild( actor, Toolkit::TableView::CellPosition( 1u, 1u ) );
table.SetCellAlignment( Toolkit::TableView::CellPosition( 1u, 1u ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
actor = Actor::New();
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
AddImage( IMAGE_FILENAME_ASTC_LINEAR_NATIVE, actor, geometry, shader );
table.AddChild( actor, Toolkit::TableView::CellPosition( 2u, 1u ) );
table.SetCellAlignment( Toolkit::TableView::CellPosition( 2u, 1u ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
// Add the actual image to the control
Control image = ImageView::New( imagePath );
image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- image.SetParentOrigin( ParentOrigin::CENTER );
- image.SetAnchorPoint( AnchorPoint::CENTER );
+ image.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ image.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
clippedImage.Add( image );
return clippedImage;
#include "contact-card.h"
// EXTERNAL INCLUDES
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
Property::Map{ { Toolkit::Visual::Property::TYPE, Visual::COLOR },
{ ColorVisual::Property::MIX_COLOR, Color::WHITE } } );
mContactCard.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- mContactCard.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mContactCard.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mContactCard.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mContactCard.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mContactCard.SetPosition( foldedPosition.x, foldedPosition.y );
mContactCard.SetSize( mContactCardLayoutInfo.foldedSize );
stage.Add( mContactCard );
mHeader.SetProperty( Control::Property::BACKGROUND,
Property::Map{ { Toolkit::Visual::Property::TYPE, Visual::COLOR },
{ ColorVisual::Property::MIX_COLOR, HEADER_COLOR } } );
- mHeader.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mHeader.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mHeader.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mHeader.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mHeader.SetPosition( mContactCardLayoutInfo.headerFoldedPosition.x, mContactCardLayoutInfo.headerFoldedPosition.y );
// Create a clipped image (whose clipping can be animated)
mClippedImage = ClippedImage::Create( imagePath, mClippedImagePropertyIndex );
mClippedImage.SetSize( mContactCardLayoutInfo.imageSize );
- mClippedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mClippedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mClippedImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mClippedImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mClippedImage.SetPosition( mContactCardLayoutInfo.imageFoldedPosition.x, mContactCardLayoutInfo.imageFoldedPosition.y );
- mClippedImage.SetVisible( false ); // Hide image as we only want to display it if we are animating or unfolded
+ mClippedImage.SetProperty( Actor::Property::VISIBLE, false ); // Hide image as we only want to display it if we are animating or unfolded
mContactCard.Add( mClippedImage );
// Create an image with a mask which is to be used when the contact is folded
mMaskedImage = MaskedImage::Create( imagePath );
mMaskedImage.SetSize( mContactCardLayoutInfo.imageSize );
- mMaskedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mMaskedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mMaskedImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mMaskedImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mMaskedImage.SetPosition( mContactCardLayoutInfo.imageFoldedPosition.x, mContactCardLayoutInfo.imageFoldedPosition.y );
mContactCard.Add( mMaskedImage );
// Add the text label for just the name
mNameText = TextLabel::New( contactName );
mNameText.SetStyleName( "ContactNameTextLabel" );
- mNameText.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mNameText.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mNameText.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mNameText.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mNameText.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mNameText.SetPosition( mContactCardLayoutInfo.textFoldedPosition.x, mContactCardLayoutInfo.textFoldedPosition.y );
mContactCard.Add( mNameText );
mDetailText = TextLabel::New( detailString );
mDetailText.SetStyleName( "ContactDetailTextLabel" );
- mDetailText.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mDetailText.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mDetailText.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mDetailText.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mDetailText.SetPosition( mContactCardLayoutInfo.textFoldedPosition.x, mContactCardLayoutInfo.textFoldedPosition.y );
mDetailText.SetSize( Vector2( mContactCardLayoutInfo.unfoldedSize.width - mContactCardLayoutInfo.textFoldedPosition.x * 2.0f, 0.0f ) );
- mDetailText.SetOpacity( 0.0f );
+ mDetailText.SetProperty( DevelActor::Property::OPACITY, 0.0f );
// Attach tap detection to the overall clip control
mTapDetector = TapGestureDetector::New();
mContactCard.Add( mDetailText );
// Show clipped-image to animate geometry and hide the masked-image
- mClippedImage.SetVisible( true );
- mMaskedImage.SetVisible( false );
+ mClippedImage.SetProperty( Actor::Property::VISIBLE, true );
+ mMaskedImage.SetProperty( Actor::Property::VISIBLE, false );
// Animate the size of the control (and clipping area)
mAnimation.AnimateTo( Property( mContactCard, Actor::Property::POSITION_X ), mContactCardLayoutInfo.unfoldedPosition.x, ALPHA_FUNCTION_UNFOLD, TIME_PERIOD_UNFOLD_X );
if( sibling != mContactCard )
{
mAnimation.AnimateTo( Property( sibling, Actor::Property::COLOR_ALPHA ), 0.0f, ALPHA_FUNCTION_UNFOLD, TIME_PERIOD_UNFOLD_SIBLING_OPACITY );
- sibling.SetSensitive( false );
+ sibling.SetProperty( Actor::Property::SENSITIVE, false );
}
}
if( sibling != mContactCard )
{
mAnimation.AnimateTo( Property( sibling, Actor::Property::COLOR_ALPHA ), 1.0f, ALPHA_FUNCTION_FOLD, TIME_PERIOD_FOLD_SIBLING_OPACITY );
- sibling.SetSensitive( true );
+ sibling.SetProperty( Actor::Property::SENSITIVE, true );
}
}
mDetailText.Unparent();
// Hide the clipped-image as we have finished animating the geometry and show the masked-image again
- mClippedImage.SetVisible( false );
- mMaskedImage.SetVisible( true );
+ mClippedImage.SetProperty( Actor::Property::VISIBLE, false );
+ mMaskedImage.SetProperty( Actor::Property::VISIBLE, true );
}
else
{
mCubeWaveEffect.TransitionCompletedSignal().Connect(this, &CubeTransitionApp::OnTransitionCompleted);
mCubeWaveEffect.SetSize( mViewSize );
- mCubeWaveEffect.SetParentOrigin( ParentOrigin::CENTER );
+ mCubeWaveEffect.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCubeWaveEffect.SetCurrentTexture( mCurrentTexture );
// use big cubes
mCubeCrossEffect.TransitionCompletedSignal().Connect(this, &CubeTransitionApp::OnTransitionCompleted);
mCubeCrossEffect.SetSize( mViewSize );
- mCubeCrossEffect.SetParentOrigin( ParentOrigin::CENTER );
+ mCubeCrossEffect.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCubeCrossEffect.SetCurrentTexture( mCurrentTexture );
mCubeFoldEffect = Toolkit::CubeTransitionFoldEffect::New( NUM_ROWS_FOLD, NUM_COLUMNS_FOLD );
mCubeFoldEffect.TransitionCompletedSignal().Connect(this, &CubeTransitionApp::OnTransitionCompleted);
mCubeFoldEffect.SetSize( mViewSize );
- mCubeFoldEffect.SetParentOrigin( ParentOrigin::CENTER );
+ mCubeFoldEffect.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCubeFoldEffect.SetCurrentTexture( mCurrentTexture );
mViewTimer = Timer::New( VIEWINGTIME );
//=============================================================================
void CenterActor(Actor actor)
{
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
}
//=============================================================================
Vector3 size{ Vector3::ONE * scale * unit * 2.f };
a.SetSize(size);
- a.SetColor(Color::WHITE * .25f +
+ a.SetProperty( Actor::Property::COLOR,Color::WHITE * .25f +
(Color::RED * (v.x + c) / (c * 2.f) +
Color::GREEN * (v.y + c) / (c * 2.f) +
Color::BLUE * (v.z + c) / (c * 2.f)) * .015625f);
#include "shared/view.h"
#include <dali/dali.h>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h>
// Set size to stage size to avoid seeing a black border on transition
mParent = Actor::New();
mParent.SetSize( Stage::GetCurrent().GetSize() );
- mParent.SetParentOrigin( ParentOrigin::CENTER );
+ mParent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mContent.Add( mParent );
// show the first image
mCurrentImage = CreateStageFillingImageView( IMAGES[mIndex] );
- mCurrentImage.SetParentOrigin( ParentOrigin::CENTER );
+ mCurrentImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCurrentImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mCurrentImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mParent.Add( mCurrentImage );
}
mNextImage = CreateStageFillingImageView( IMAGES[ mIndex ] );
- mNextImage.SetParentOrigin( ParentOrigin::CENTER );
+ mNextImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mNextImage.SetZ(INITIAL_DEPTH);
mParent.Add( mNextImage );
- Vector2 size = Vector2( mCurrentImage.GetCurrentSize() );
+ Vector2 size = Vector2( mCurrentImage.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) );
StartTransition( gesture.position / size, gesture.displacement * Vector2(1.0, size.x/size.y));
}
}
mCurrentImage.SetProperty( Toolkit::ImageView::Property::IMAGE, mDissolveEffect );
mAnimation.AnimateTo( Property( mCurrentImage, "uPercentage" ), 1.0f, AlphaFunction::LINEAR );
- mNextImage.SetOpacity(0.0f);
+ mNextImage.SetProperty( DevelActor::Property::OPACITY,0.0f);
mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::LINEAR );
if(mUseHighPrecision)
{
mIndex = (mIndex + 1)%NUM_IMAGES;
mNextImage = CreateStageFillingImageView( IMAGES[ mIndex ] );
- mNextImage.SetParentOrigin( ParentOrigin::CENTER );
+ mNextImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mNextImage.SetZ(INITIAL_DEPTH);
TextLabel hintText = TextLabel::New("please drag one textlabel, move and drop on other textlabel");
hintText.SetPosition(0.0f, 700.0f);
- hintText.SetParentOrigin(ParentOrigin::TOP_LEFT);
- hintText.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ hintText.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ hintText.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
hintText.SetProperty(TextLabel::Property::MULTI_LINE, true);
stage.Add(hintText);
{
std::string str = "textlabel ";
mTextLabel[i] = TextLabel::New(str + std::to_string(i));
- mTextLabel[i].SetParentOrigin(ParentOrigin::TOP_LEFT);
- mTextLabel[i].SetAnchorPoint(AnchorPoint::TOP_LEFT);
- mTextLabel[i].SetName("textlabel " + std::to_string(i));
- mTextLabel[i].SetLeaveRequired(true);
+ mTextLabel[i].SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mTextLabel[i].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ mTextLabel[i].SetProperty( Dali::Actor::Property::NAME,"textlabel " + std::to_string(i));
+ mTextLabel[i].SetProperty( Actor::Property::LEAVE_REQUIRED,true);
mTextLabel[i].SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER");
mTextLabel[i].SetProperty(TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER");
mTextLabel[i].SetBackgroundColor(TEXT_LABEL_COLOR[i]);
void OnStart(Control control, Dali::Toolkit::DragAndDropDetector detector)
{
DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnStart---\n");
- DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str());
+ DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
- control.SetOpacity(0.1f);
+ control.SetProperty( DevelActor::Property::OPACITY,0.1f);
Vector2 screenPos = detector.GetCurrentScreenPosition();
control.ScreenToLocal(mDragLocalPos.x, mDragLocalPos.y,screenPos.x, screenPos.y );
Rect<float> targetRect(screenPos.x, screenPos.y, 0.0f, 0.0f);
void OnEnter(Control control, Dali::Toolkit::DragAndDropDetector detector)
{
DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnEnter---\n");
- DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str());
+ DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
}
void OnExit(Control control, Dali::Toolkit::DragAndDropDetector detector)
{
DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnExit---\n");
- DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str());
+ DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
}
void OnMoved(Control control, Dali::Toolkit::DragAndDropDetector detector)
{
DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---OnMoved---\n");
- DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---control name is %s---\n", control.GetName().c_str());
+ DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
DALI_LOG_INFO(gDragAndDropFilter, Debug::Verbose, "---coordinate is (%f, %f)---\n", detector.GetCurrentScreenPosition().x, detector.GetCurrentScreenPosition().y);
}
void OnDropped(Control control, Dali::Toolkit::DragAndDropDetector detector)
{
DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnDropped---\n");
- DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str());
+ DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
Vector2 screenPos = detector.GetCurrentScreenPosition();
Rect<float> targetRect(screenPos.x, screenPos.y, 0.0f, 0.0f);
{
for(int i = mDragIndex + 1; i <= droppedIndex; i++)
{
- float y = mTextLabel[mOrder[i]].GetCurrentPosition().y;
+ float y = mTextLabel[mOrder[i]].GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
mAnimation.AnimateTo(Property(mTextLabel[mOrder[i]], Actor::Property::POSITION), Vector3(TEXT_LABEL_POSITION_X, y - TEXT_LABEL_HEIGHT, 0.0f), AlphaFunction::EASE_OUT);
mAnimation.Play();
}
for(int i = mDragIndex - 1; i >= droppedIndex; i--)
{
- float y = mTextLabel[mOrder[i]].GetCurrentPosition().y;
+ float y = mTextLabel[mOrder[i]].GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y;
mAnimation.AnimateTo(Property(mTextLabel[mOrder[i]], Actor::Property::POSITION), Vector3(TEXT_LABEL_POSITION_X, y + TEXT_LABEL_HEIGHT, 0.0f), AlphaFunction::EASE_OUT);
mAnimation.Play();
}
KeyFrames k0 = KeyFrames::New();
k0.Add(0.0f, Vector3(localPos.x - mDragLocalPos.x, localPos.y - mDragLocalPos.y, 0.0f));
- k0.Add(1.0f, Vector3(control.GetCurrentPosition().x, control.GetCurrentPosition().y, 0.0f));
+ k0.Add(1.0f, Vector3(control.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, control.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, 0.0f));
KeyFrames k1 = KeyFrames::New();
k1.Add(0.0f, 0.1f);
void OnEnd(Control control, Dali::Toolkit::DragAndDropDetector detector)
{
DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---OnEnd---\n");
- DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetName().c_str());
+ DALI_LOG_INFO(gDragAndDropFilter, Debug::General, "---control name is %s---\n", control.GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str());
- control.SetOpacity(1.0f);
+ control.SetProperty( DevelActor::Property::OPACITY,1.0f);
}
private:
Vector2 effectsViewSize( mStageSize.width, mStageSize.height * 0.25f );
mDropShadowView = CreateEffectsView( EffectsView::DROP_SHADOW, effectsViewSize, mEffectSize );
- mDropShadowView.SetParentOrigin( ParentOrigin::CENTER );
- mDropShadowView.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mDropShadowView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mDropShadowView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mDropShadowView.SetZ( -mStageSize.height * 0.1f );
mContents.Add( mDropShadowView );
mEmbossView = CreateEffectsView( EffectsView::EMBOSS, effectsViewSize, mEffectSize );
- mEmbossView.SetParentOrigin( ParentOrigin::CENTER );
- mEmbossView.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mEmbossView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mEmbossView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mEmbossView.SetZ( mStageSize.height * 0.1f );
mContents.Add( mEmbossView );
// text
std::string text = ( type == EffectsView::DROP_SHADOW) ? "Drop Shadow" : "Emboss";
TextLabel textActor( TextLabel::New( text ) );
- textActor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- textActor.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+ textActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT );
+ textActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT );
textActor.SetSize( viewSize );
textActor.SetPosition( viewSize.width*0.4f, viewSize.height*0.3f );
textActor.SetProperty( TextLabel::Property::POINT_SIZE, DemoHelper::ScalePointSize(14.f) );
// image
ImageView icon = ImageView::New( TEST_IMAGE );
- icon.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- icon.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+ icon.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT );
+ icon.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT );
icon.SetX( viewSize.width*0.1f );
icon.SetSize( viewSize.height*0.8f, viewSize.height*0.8f );
effectsView.Add( icon );
// Create a flex direction toggle button. (left of toolbar)
mFlexDirectionButton = Toolkit::PushButton::New();
- mFlexDirectionButton.SetName("mFlexDirectionButton");
+ mFlexDirectionButton.SetProperty( Dali::Actor::Property::NAME,"mFlexDirectionButton");
mFlexDirectionButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change.png" );
mFlexDirectionButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change-selected.png" );
mFlexDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexDirectionButtonClicked);
- mFlexDirectionButton.SetLeaveRequired( true );
+ mFlexDirectionButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( mFlexDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a flex wrap toggle button. (left of toolbar)
mFlexWrapButton = Toolkit::PushButton::New();
- mFlexWrapButton.SetName("mFlexWrapButton");
+ mFlexWrapButton.SetProperty( Dali::Actor::Property::NAME,"mFlexWrapButton");
mFlexWrapButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit.png" );
mFlexWrapButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit-selected.png" );
mFlexWrapButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexWrapButtonClicked);
- mFlexWrapButton.SetLeaveRequired( true );
+ mFlexWrapButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( mFlexWrapButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a content direction toggle button. (left of toolbar)
mContentDirectionButton = Toolkit::PushButton::New();
- mContentDirectionButton.SetName("mContentDirectionButton");
+ mContentDirectionButton.SetProperty( Dali::Actor::Property::NAME,"mContentDirectionButton");
mContentDirectionButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace.png" );
mContentDirectionButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace-selected.png" );
mContentDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnContentDirectionButtonClicked);
- mContentDirectionButton.SetLeaveRequired( true );
+ mContentDirectionButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( mContentDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a justify content toggle button. (right of toolbar)
mJustifyContentButton = Toolkit::PushButton::New();
- mJustifyContentButton.SetName("mJustifyContentButton");
+ mJustifyContentButton.SetProperty( Dali::Actor::Property::NAME,"mJustifyContentButton");
mJustifyContentButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset.png" );
mJustifyContentButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset-selected.png" );
mJustifyContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnJustifyContentButtonClicked);
- mJustifyContentButton.SetLeaveRequired( true );
+ mJustifyContentButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( mJustifyContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a align items toggle button. (right of toolbar)
mAlignItemsButton = Toolkit::PushButton::New();
- mAlignItemsButton.SetName("mAlignItemsButton");
+ mAlignItemsButton.SetProperty( Dali::Actor::Property::NAME,"mAlignItemsButton");
mAlignItemsButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp.png" );
mAlignItemsButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp-selected.png" );
mAlignItemsButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignItemsButtonClicked);
- mAlignItemsButton.SetLeaveRequired( true );
+ mAlignItemsButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( mAlignItemsButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a align content toggle button. (right of toolbar)
mAlignContentButton = Toolkit::PushButton::New();
- mAlignContentButton.SetName("mAlignContentButton");
+ mAlignContentButton.SetProperty( Dali::Actor::Property::NAME,"mAlignContentButton");
mAlignContentButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross.png" );
mAlignContentButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross-selected.png" );
mAlignContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignContentButtonClicked);
- mAlignContentButton.SetLeaveRequired( true );
+ mAlignContentButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( mAlignContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create the base flex container
mFlexContainer = FlexContainer::New();
- mFlexContainer.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mFlexContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ mFlexContainer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mFlexContainer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
mFlexContainer.SetSize( stageSize.width, stageSize.height - VIEW_STYLE.mToolBarHeight );
mFlexContainer.SetY(VIEW_STYLE.mToolBarHeight);
mFlexContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, FlexContainer::COLUMN); // column as main axis
// Create the flex container for the flex items and add it to the base flex container
mFlexItemContainer = FlexContainer::New();
- mFlexItemContainer.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mFlexItemContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ mFlexItemContainer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mFlexItemContainer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
mFlexItemContainer.SetBackgroundColor( Color::YELLOW );
mFlexItemContainer.SetProperty(FlexContainer::Property::FLEX_DIRECTION, mCurrentFlexDirection);
mFlexItemContainer.SetProperty(FlexContainer::Property::FLEX_WRAP, mCurrentFlexWrap);
for (int i = 0; i < NUM_FLEX_ITEMS; i++)
{
PushButton flexItem = PushButton::New();
- flexItem.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- flexItem.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ flexItem.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ flexItem.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
// Set different background colour to help to identify different items
flexItem.SetBackgroundColor(Vector4(static_cast<float>(i) / NUM_FLEX_ITEMS, static_cast<float>(NUM_FLEX_ITEMS - i) / NUM_FLEX_ITEMS, 1.0f, 1.0f));
std::ostringstream index;
index << i + 1;
flexItem.SetProperty( Toolkit::Button::Property::LABEL, index.str() );
- flexItem.SetName("FlexItem " + index.str());
+ flexItem.SetProperty( Dali::Actor::Property::NAME,"FlexItem " + index.str());
// Set a fixed size to the items so that we can wrap the line and test these
// flex properties that only work when there are multiple lines in the layout
TableView contentTable = TableView::New(2, 1);
contentTable.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
contentTable.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
- contentTable.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- contentTable.SetParentOrigin(ParentOrigin::TOP_LEFT);
+ contentTable.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ contentTable.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
contentTable.SetCellPadding(Size(MARGIN_SIZE, MARGIN_SIZE * 0.5f));
contentTable.SetKeyboardFocusable(true);
{
Control control = Control::DownCast( mContainer.GetChildAt( TableView::CellPosition( (i/3)*2+1, i%3 ) ) );
control.SetKeyboardFocusable(true);
- control.SetName(ITEMNAME[i]);
+ control.SetProperty( Dali::Actor::Property::NAME,ITEMNAME[i]);
control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
control.KeyEventSignal().Connect( this, &FocusIntegrationExample::OnControlKeyEvent );
}
// Display current control name.
bool OnControlKeyEvent( Control control, const KeyEvent& event )
{
- std::string controlName = control.GetName();
+ std::string controlName = control.GetProperty< std::string >( Dali::Actor::Property::NAME );
mEventLabel.SetProperty( TextLabel::Property::TEXT, controlName+"'s KeyEvent works\n" );
return false;
// left tutorial text label
mLeftLabel = Toolkit::TextLabel::New("Touch here to walk");
- mLeftLabel.SetParentOrigin( ParentOrigin::CENTER );
- mLeftLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ mLeftLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mLeftLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLeftLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mLeftLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
mLeftLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
// right tutorial text label
mRightLabel = Toolkit::TextLabel::New("Touch here to look around");
- mRightLabel.SetParentOrigin( ParentOrigin::CENTER );
- mRightLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ mRightLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mRightLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mRightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mRightLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
mRightLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
{
Stage stage = Stage::GetCurrent();
mCameraActor = stage.GetRenderTaskList().GetTask(0).GetCameraActor();
- mCameraActor.SetName( "GameCamera" );
- mCameraActor.SetAnchorPoint( AnchorPoint::CENTER );
- mCameraActor.SetParentOrigin( ParentOrigin::CENTER );
+ mCameraActor.SetProperty( Dali::Actor::Property::NAME, "GameCamera" );
+ mCameraActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCameraActor.SetFieldOfView( Radian( Degree( mFovY ) ) );
// should be read from file
mCameraActor.SetFarClippingPlane( mFar );
mCameraActor.SetPosition( CAMERA_DEFAULT_POSITION );
- // Camera position is shadowed in order to avoid using GetCurrentPosition()
+ // Camera position is shadowed in order to avoid using.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )
mCameraPosition = CAMERA_DEFAULT_POSITION;
}
Stage stage = Stage::GetCurrent();
mInterceptorActor = Actor::New();
- mInterceptorActor.SetName( "GameInputInterceptor" );
+ mInterceptorActor.SetProperty( Dali::Actor::Property::NAME, "GameInputInterceptor" );
mInterceptorActor.SetSize( Vector3( stage.GetSize().x, stage.GetSize().y, 1 ) );
mInterceptorActor.SetPosition( Vector3( 0.0, 0.0, 1.0 ) );
- mInterceptorActor.SetAnchorPoint( AnchorPoint::CENTER );
- mInterceptorActor.SetParentOrigin( ParentOrigin::CENTER );
+ mInterceptorActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mInterceptorActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCameraActor.Add( mInterceptorActor );
// Connect TouchSignal to interceptor actor
GameEntity::GameEntity( const char* name )
{
mActor = Dali::Actor::New();
- mActor.SetName( name );
+ mActor.SetProperty( Dali::Actor::Property::NAME, name );
}
GameEntity::~GameEntity()
// add all to the stage
Stage stage = Stage::GetCurrent();
mRootActor = Actor::New();
- mRootActor.SetAnchorPoint( AnchorPoint::CENTER );
- mRootActor.SetParentOrigin( ParentOrigin::CENTER );
+ mRootActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
stage.GetRootLayer().Add( mRootActor );
mRootActor.SetScale( -1.0, 1.0, 1.0 );
mRootActor.SetPosition( 0.0, 0.0, 0.0 );
for( size_t i = 0; i < mEntities.Size(); ++i )
{
Actor actor( mEntities[i]->GetActor() );
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mRootActor.Add( actor );
mEntities[i]->UpdateRenderer();
}
for( int i = 0; yPos < stageSize.height; ++i )
{
ImageView imageView = ImageView::New( IMAGE_NAME );
- imageView.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- imageView.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
imageView.SetY( yPos );
yPos += imageView.GetNaturalSize().height;
mTextLabel = TextLabel::New( TEXT_ENABLED );
mTextLabel.SetProperty( TextLabel::Property::TEXT_COLOR, TEXT_COLOR_ENABLED );
mTextLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
- mTextLabel.SetAnchorPoint( AnchorPoint::CENTER );
- mTextLabel.SetParentOrigin( ParentOrigin::CENTER );
+ mTextLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mTextLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mStage.Add( mTextLabel );
// Set the FrameCallbackInterface on the root layer.
stage.KeyEventSignal().Connect(this, &GaussianBlurViewExample::OnKeyEvent);
mImageView = Toolkit::ImageView::New( BACKGROUND_IMAGE );
- mImageView.SetParentOrigin( ParentOrigin::CENTER );
- mImageView.SetAnchorPoint( AnchorPoint::CENTER );
+ mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add( mImageView );
}
Layer onTop = Layer::New();
- onTop.SetParentOrigin( ParentOrigin::CENTER );
- onTop.SetAnchorPoint( AnchorPoint::CENTER );
+ onTop.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ onTop.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
onTop.SetSize( stageSize );
stage.Add( onTop );
onTop.RaiseToTop();
mOnLabel = TextLabel::New( "Blur ON" );
- mOnLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mOnLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mOnLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN );
- mOnLabel.SetVisible( false );
+ mOnLabel.SetProperty( Actor::Property::VISIBLE, false );
onTop.Add( mOnLabel );
mOffLabel = TextLabel::New( "Blur OFF" );
- mOffLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mOffLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mOffLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE );
- mOffLabel.SetVisible( true );
+ mOffLabel.SetProperty( Actor::Property::VISIBLE, true );
onTop.Add( mOffLabel );
stage.GetRootLayer().TouchSignal().Connect( this, &GaussianBlurViewExample::OnTouch );
if( !mGaussianBlurView )
{
mGaussianBlurView = GaussianBlurView::New( 30, 8.0f, Pixel::RGBA8888, 0.5f, 0.5f, false );
- mGaussianBlurView.SetParentOrigin( ParentOrigin::CENTER );
- mGaussianBlurView.SetAnchorPoint( AnchorPoint::CENTER );
+ mGaussianBlurView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mGaussianBlurView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mGaussianBlurView.SetSize( stage.GetSize() );
stage.Add( mGaussianBlurView );
mGaussianBlurView.SetProperty( mGaussianBlurView.GetBlurStrengthPropertyIndex(), mStrength );
- mOnLabel.SetVisible( true );
- mOffLabel.SetVisible( false );
+ mOnLabel.SetProperty( Actor::Property::VISIBLE, true );
+ mOffLabel.SetProperty( Actor::Property::VISIBLE, false );
}
else
{
UnparentAndReset( mGaussianBlurView );
- mOnLabel.SetVisible( false );
- mOffLabel.SetVisible( true );
+ mOnLabel.SetProperty( Actor::Property::VISIBLE, false );
+ mOffLabel.SetProperty( Actor::Property::VISIBLE, true );
}
}
// EXTERNAL INCLUDES
#include <dali-toolkit/dali-toolkit.h>
#include <string>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/events/rotation-gesture.h>
#include <dali/devel-api/events/rotation-gesture-detector.h>
Actor text = TextLabel::New( std::move( string ) );
Vector3 position( Stage::GetCurrent().GetSize() * HELP_TEXT_POSITION_MULTIPLIER );
- text.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- text.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
text.SetPosition( position );
- text.SetOpacity( 0.0f );
+ text.SetProperty( DevelActor::Property::OPACITY, 0.0f );
text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, Text::HorizontalAlignment::CENTER );
text.SetProperty( TextLabel::Property::MULTI_LINE, true );
parent.Add( text );
// Create a background with a linear gradient which matches parent size & is placed in the center.
Actor background = Control::New();
background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- background.SetParentOrigin( ParentOrigin::CENTER );
+ background.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
background.SetProperty( Control::Property::BACKGROUND, BACKGROUND );
stage.Add( background );
// Create a control with a circular gradient that we'll use for the gestures and be a quarter of the size of the stage.
Actor touchControl = Control::New();
touchControl.SetSize( stage.GetSize() * 0.25f );
- touchControl.SetParentOrigin( ParentOrigin::CENTER );
+ touchControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
touchControl.SetProperty( Control::Property::BACKGROUND, CONTROL_BACKGROUND );
background.Add( touchControl );
// Connect to the touch signal
touchControl.TouchSignal().Connect( this, &GestureExample::OnTouch );
- touchControl.SetLeaveRequired( true );
+ touchControl.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
// Create a long press gesture detector, attach the actor & connect
mLongPressDetector = LongPressGestureDetector::New();
// Do a small animation to indicate to the user that we are in pan mode.
Animation anim = Animation::New( PAN_MODE_CHANGE_ANIMATION_DURATION );
- anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentScale() * PAN_MODE_START_ANIMATION_SCALE, AlphaFunction::BOUNCE );
+ anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) * PAN_MODE_START_ANIMATION_SCALE, AlphaFunction::BOUNCE );
anim.Play();
// Start the shake animation so the user knows when they are in pan mode.
// As the displacement is in local actor coords, we will have to multiply the displacement by the
// actor's scale so that it moves the correct amount in the parent's coordinate system.
Vector3 scaledDisplacement( pan.displacement );
- scaledDisplacement *= actor.GetCurrentScale();
+ scaledDisplacement *= actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
Vector3 currentPosition;
actor.GetProperty( Actor::Property::POSITION ).Get( currentPosition );
Animation anim = Animation::New( PAN_MODE_CHANGE_ANIMATION_DURATION );
anim.AnimateTo( Property( actor, Actor::Property::COLOR ), Vector4::ONE );
- anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentScale() * PAN_MODE_END_ANIMATION_SCALE, AlphaFunction::BOUNCE );
+ anim.AnimateTo( Property( actor, Actor::Property::SCALE ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) * PAN_MODE_END_ANIMATION_SCALE, AlphaFunction::BOUNCE );
// Move actor back to center if we're out of bounds
Vector2 halfStageSize = Stage::GetCurrent().GetSize() * 0.5f;
case Gesture::Started:
{
// Starting scale is required so that we know what to multiply the pinch.scale by.
- mStartingScale = actor.GetCurrentScale();
+ mStartingScale = actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
break;
}
case Gesture::Finished:
case Gesture::Cancelled:
{
- Vector3 scale( actor.GetCurrentScale() );
+ Vector3 scale( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) );
// Ensure the actor sizes itself to be within the limits defined.
if ( scale.x < MINIMUM_SCALE.x )
case Gesture::Started:
{
// Starting orientation is required so that we know what to multiply the rotation.rotation by.
- mStartingOrientation = actor.GetCurrentOrientation();
+ mStartingOrientation = actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION );
break;
}
DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
mGradientControl = Control::New();
- mGradientControl.SetAnchorPoint( AnchorPoint::CENTER );
- mGradientControl.SetParentOrigin( ParentOrigin::CENTER );
+ mGradientControl.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mGradientControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mGradientControl.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
Vector3 offset( 0.9f, 0.7f, 0.0f );
mGradientControl.SetSizeModeFactor( offset );
stage.SetBackgroundColor( Color::WHITE );
TextLabel textLabel = TextLabel::New( "Hello World" );
- textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- textLabel.SetName( "helloWorldLabel" );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ textLabel.SetProperty( Dali::Actor::Property::NAME, "helloWorldLabel" );
stage.Add( textLabel );
// Respond to a click anywhere on the stage
mScrollParent = Actor::New();
mScrollParent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mScrollParent.SetAnchorPoint( AnchorPoint::CENTER );
- mScrollParent.SetParentOrigin( ParentOrigin::CENTER );
+ mScrollParent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mScrollParent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// create background
Toolkit::ImageView background = Toolkit::ImageView::New( BACKGROUND_IMAGE );
Stage::GetCurrent().Add( background );
background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- background.SetAnchorPoint( AnchorPoint::CENTER );
- background.SetParentOrigin( ParentOrigin::CENTER );
+ background.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ background.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
PopulatePages();
}
pageActor.SetBackgroundColor( Vector4( 0.0f, 0.0f, 0.0f, 0.5f ) );
- pageActor.SetParentOrigin( ParentOrigin::CENTER );
- pageActor.SetAnchorPoint( AnchorPoint::CENTER );
+ pageActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ pageActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
pageActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
pageActor.SetSizeModeFactor( Vector3( PAGE_SCALE_FACTOR_X, PAGE_SCALE_FACTOR_Y, 1.0f ) );
return pageActor;
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
imageView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
imageView.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- imageView.SetAnchorPoint( AnchorPoint::CENTER );
- imageView.SetParentOrigin( ParentOrigin::CENTER );
+ imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageView.SetSizeModeFactor( Vector3( IMAGE_AREA, IMAGE_AREA, 1.0f ) );
return imageView;
Toolkit::CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
button.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- button.SetAnchorPoint( AnchorPoint::CENTER );
- button.SetParentOrigin( ParentOrigin::CENTER );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
button.SetProperty( Toolkit::Button::Property::SELECTED, ( currentIconIndex % 2 == 0 ) ); // Select half the button
return button;
{
// Create parent icon view
Toolkit::Control iconView = Toolkit::Control::New();
- iconView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- iconView.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ iconView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ iconView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
if( !mConfig.mTableViewEnabled )
{
if( useTextLabel )
{
Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( DEMO_APPS_NAMES[currentIconIndex] );
- textLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- textLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
textLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, ( ( static_cast<float>( ROW_HEIGHT * LABEL_AREA ) * 72.0f ) / dpi.y ) * 0.25f );
Toolkit::Control control = Toolkit::Control::New();
control.SetProperty( Toolkit::Control::Property::BACKGROUND, map );
- control.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- control.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
icon.Add( control );
}
}
AddIconsToPage( page, mConfig.mUseTextLabel );
// Move page 'a little bit up'.
- page.SetParentOrigin( ParentOrigin::CENTER );
- page.SetAnchorPoint( AnchorPoint::CENTER );
+ page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
page.SetPosition( Vector3( stageSize.x * i, 0.0f, 0.0f ) );
mScrollParent.Add( page );
}
- mScrollParent.SetOpacity( 1.0f );
+ mScrollParent.SetProperty( DevelActor::Property::OPACITY, 1.0f );
mScrollParent.SetScale( Vector3::ONE );
// Fade in.
}
imageView.SetProperty(ImageView::Property::IMAGE , imagePropertyMap );
- imageView.SetParentOrigin( ParentOrigin::CENTER );
- imageView.SetAnchorPoint( AnchorPoint::CENTER );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
imageView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
return imageView;
mTable.RemoveChildAt( TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) );
mInstructions.SetProperty( TextLabel::Property::TEXT, "Loading Image before staging, press next to see it in right column");
TableView dualImageViewTable = TableView::New( 1, 2 );
- dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER );
- dualImageViewTable.SetName("dualTable");
- dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ dualImageViewTable.SetProperty( Dali::Actor::Property::NAME,"dualTable");
+ dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) );
TextLabel attached = TextLabel::New("ATTACHED loaded image \nWill appear here");
mTable.RemoveChildAt( TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) );
TableView dualImageViewTable = TableView::New( 2, 2 );
- dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER );
- dualImageViewTable.SetName("dualTable");
- dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ dualImageViewTable.SetProperty( Dali::Actor::Property::NAME,"dualTable");
+ dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) );
mInstructions.SetProperty( TextLabel::Property::TEXT, "ReleasePolicy::DESTROYED shown in first column, press next to destroy it.");
DisableButtonWhilstLoading();
TableView dualImageViewTable = TableView::New( 1, 2 );
- dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER );
- dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) );
mTable.RemoveChildAt( TableView::CellPosition( TableRowPlacement::IMAGE, 0 ) );
DisableButtonWhilstLoading();
TableView dualImageViewTable = TableView::New( 1, 2 );
- dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER );
- dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) );
mInstructions.SetProperty( TextLabel::Property::TEXT, "Image with ReleasePolicy::DESTROYED shown in first column, Image will be detached, reusing it will be fast");
DisableButtonWhilstLoading();
TableView dualImageViewTable = TableView::New( 1, 2 );
- dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER );
- dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) );
mInstructions.SetProperty( TextLabel::Property::TEXT, "Image with ReleasePolicy::DETACHED shown in first column, will be detached and reloaded");
DisableButtonWhilstLoading();
TableView dualImageViewTable = TableView::New( 1, 2 );
- dualImageViewTable.SetAnchorPoint( AnchorPoint::CENTER );
- dualImageViewTable.SetParentOrigin( ParentOrigin::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ dualImageViewTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
dualImageViewTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
dualImageViewTable.SetCellPadding( Vector2( 6.0f, 0.0f ) );
// Create default View.
Toolkit::Control view = Toolkit::Control::New();
- view.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- view.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ view.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ view.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
view.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
view.SetProperty( Toolkit::Control::Property::BACKGROUND , gradientBackground );
stage.Add( view );
// Create a table view to show a pair of buttons above each image.
mTable = TableView::New( TableRowPlacement::NUMBER_OF_ROWS, 1 );
- mTable.SetAnchorPoint( AnchorPoint::CENTER );
- mTable.SetParentOrigin( ParentOrigin::CENTER );
+ mTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mTable.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
Vector3 offset( 0.9f, 0.90f, 0.0f );
mTable.SetSizeModeFactor( offset );
mNextButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, imagePropertyMap );
mNextButton.SetProperty( Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, LOADING_IMAGE );
mNextButton.SetProperty( Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, NEXT_BUTTON_DISABLED_IMAGE );
- mNextButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ mNextButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
mNextButton.SetY( -50.0f );
mNextButton.SetSize( 100.0f, 100.0f );
mNextButton.ClickedSignal().Connect( this, &ImagePolicies::ChangeImageClicked );
*/
#include <dali/dali.h>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
#include "shared/view.h"
Toolkit::ImageView background = Toolkit::ImageView::New();
background.SetProperty( Toolkit::ImageView::Property::IMAGE, backgroundImage );
- background.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ background.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
background.SetSize( stage.GetSize() );
stage.Add( background );
widthPixel[2] = 0x4f;
mHeightBox = Toolkit::ImageView::New( heightBackground );
- mHeightBox.SetOpacity( 0.2f );
+ mHeightBox.SetProperty( DevelActor::Property::OPACITY, 0.2f );
background.Add( mHeightBox );
mWidthBox = Toolkit::ImageView::New( widthBackground );
- mWidthBox.SetOpacity( 0.2f );
+ mWidthBox.SetProperty( DevelActor::Property::OPACITY, 0.2f );
background.Add( mWidthBox );
mDesiredBox = Toolkit::ImageView::New( BORDER_IMAGE );
background.Add( mDesiredBox );
mDesiredBox.SetSize( stage.GetSize() * mImageStageScale );
- mDesiredBox.SetParentOrigin( ParentOrigin::CENTER );
- mDesiredBox.SetAnchorPoint( AnchorPoint::CENTER );
+ mDesiredBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mDesiredBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mHeightBox.SetSize( stage.GetSize().width, (stage.GetSize() * mImageStageScale).height );
- mHeightBox.SetParentOrigin( ParentOrigin::CENTER );
- mHeightBox.SetAnchorPoint( AnchorPoint::CENTER );
+ mHeightBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mHeightBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mWidthBox.SetSize( (stage.GetSize() * mImageStageScale).width, stage.GetSize().height );
- mWidthBox.SetParentOrigin( ParentOrigin::CENTER );
- mWidthBox.SetAnchorPoint( AnchorPoint::CENTER );
+ mWidthBox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mWidthBox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
// Initialize the actor
mImageView = Toolkit::ImageView::New( IMAGE_PATHS[ 0 ] );
// Reposition the actor
- mImageView.SetParentOrigin( ParentOrigin::CENTER );
- mImageView.SetAnchorPoint( AnchorPoint::CENTER );
+ mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
// Display the actor on the stage
mDesiredBox.Add( mImageView );
mGrabCorner = Toolkit::ImageView::New( RESIZE_HANDLE_IMAGE );
mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- mGrabCorner.SetName( "GrabCorner" );
- mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
- mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
+ mGrabCorner.SetProperty( Dali::Actor::Property::NAME, "GrabCorner" );
+ mGrabCorner.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT );
+ mGrabCorner.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT );
mGrabCorner.SetPosition( -BORDER_WIDTH, -BORDER_WIDTH );
- mGrabCorner.SetOpacity( 0.6f );
+ mGrabCorner.SetProperty( DevelActor::Property::OPACITY, 0.6f );
Layer grabCornerLayer = Layer::New();
- grabCornerLayer.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
- grabCornerLayer.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
+ grabCornerLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT );
+ grabCornerLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT );
grabCornerLayer.Add( mGrabCorner );
mDesiredBox.Add( grabCornerLayer );
Dali::Layer controlsLayer = Dali::Layer::New();
controlsLayer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
controlsLayer.SetSizeModeFactor( Vector3( 1.0f, 1.0f, 1.0f ) );
- controlsLayer.SetAnchorPoint( AnchorPoint::TOP_LEFT);
- controlsLayer.SetParentOrigin( ParentOrigin::TOP_LEFT);
+ controlsLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ controlsLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
stage.Add( controlsLayer );
// Back and next image buttons in corners of stage:
Toolkit::ImageView imagePrevious = Toolkit::ImageView::New( DALI_ICON_PLAY, ImageDimensions( playWidth, playWidth ) );
// Last image button:
- imagePrevious.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ imagePrevious.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
imagePrevious.RotateBy( Radian(3.14159265358979323846f), Vector3( 0, 1.0f, 0 ) );
imagePrevious.SetY( playWidth * 0.5f );
imagePrevious.SetX( playWidth + playWidth * 0.5f );
- imagePrevious.SetOpacity( 0.6f );
+ imagePrevious.SetProperty( DevelActor::Property::OPACITY, 0.6f );
controlsLayer.Add( imagePrevious );
- imagePrevious.SetName( PREVIOUS_BUTTON_ID );
+ imagePrevious.SetProperty( Dali::Actor::Property::NAME, PREVIOUS_BUTTON_ID );
imagePrevious.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
// Next image button:
Toolkit::ImageView imageNext = Toolkit::ImageView::New( DALI_ICON_PLAY, ImageDimensions( playWidth, playWidth ) );
- imageNext.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
+ imageNext.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
imageNext.SetY( playWidth * 0.5f );
imageNext.SetX( stage.GetSize().x - playWidth * 0.5f );
- imageNext.SetOpacity( 0.6f );
+ imageNext.SetProperty( DevelActor::Property::OPACITY, 0.6f );
controlsLayer.Add( imageNext );
- imageNext.SetName( NEXT_BUTTON_ID );
+ imageNext.SetProperty( Dali::Actor::Property::NAME, NEXT_BUTTON_ID );
imageNext.TouchSignal().Connect( this, &ImageScalingAndFilteringController::OnControlTouched );
// Buttons to popup selectors for fitting and sampling modes:
modesGroupBackground.SetCellPadding( Size( MARGIN_SIZE * 0.5f, MARGIN_SIZE ) );
modesGroupBackground.SetFitHeight( 0 );
- modesGroupBackground.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
- modesGroupBackground.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
+ modesGroupBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT );
+ modesGroupBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
modesGroupBackground.SetPosition( 0.0f, 0.0f );
controlsLayer.Add( modesGroupBackground );
{
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetStyleName( STYLE_BUTTON_TEXT );
- button.SetName( id );
+ button.SetProperty( Dali::Actor::Property::NAME, id );
button.SetProperty( Toolkit::Button::Property::LABEL, label );
button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f;
Toolkit::Popup popup = Toolkit::Popup::New();
- popup.SetName( "POPUP" );
- popup.SetParentOrigin( ParentOrigin::CENTER );
- popup.SetAnchorPoint( AnchorPoint::CENTER );
+ popup.SetProperty( Dali::Actor::Property::NAME, "POPUP" );
+ popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
popup.SetSize( POPUP_WIDTH_DP, 0.0f );
popup.OutsideTouchedSignal().Connect( this, &ImageScalingAndFilteringController::OnPopupOutsideTouched );
Toolkit::PushButton CreatePopupButton( Actor parent, const char* id )
{
Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetName( id );
+ button.SetProperty( Dali::Actor::Property::NAME, id );
button.SetProperty( Toolkit::Button::Property::LABEL, id );
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- button.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
bool OnButtonClicked( Toolkit::Button button )
{
- if( button.GetName() == FITTING_BUTTON_ID )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == FITTING_BUTTON_ID )
{
mPopup = CreatePopup();
Stage::GetCurrent().Add( mPopup );
mPopup.SetDisplayState( Toolkit::Popup::SHOWN );
}
- else if( button.GetName() == SAMPLING_BUTTON_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == SAMPLING_BUTTON_ID )
{
mPopup = CreatePopup();
bool CheckFittingModeButton( Actor &button, FittingMode::Type mode )
{
const char * const modeName = StringFromScalingMode( mode );
- if( button.GetName() == modeName )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == modeName )
{
mFittingMode = mode;
mFittingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName );
bool CheckSamplingModeButton( Actor &button, SamplingMode::Type mode )
{
const char * const modeName = StringFromFilterMode( mode );
- if( button.GetName() == modeName )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == modeName )
{
mSamplingMode = mode;
mSamplingModeButton.SetProperty( Toolkit::Button::Property::LABEL, modeName );
{
case PointState::UP:
{
- const std::string & name = actor.GetName();
+ const std::string & name = actor.GetProperty< std::string >( Dali::Actor::Property::NAME );
if( name == NEXT_BUTTON_ID )
{
mCurrentPath = mCurrentPath + 1;
{
if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
{
- if( mPopup && mPopup.IsVisible() )
+ if( mPopup && mPopup.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) )
{
mPopup.SetDisplayState( Toolkit::Popup::HIDDEN );
mPopup.Reset();
map[Toolkit::ImageVisual::Property::FITTING_MODE] = fittingMode;
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
- imageView.SetName( filename );
- imageView.SetParentOrigin(ParentOrigin::CENTER);
- imageView.SetAnchorPoint(AnchorPoint::CENTER);
+ imageView.SetProperty( Dali::Actor::Property::NAME, filename );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ imageView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
return imageView;
}
SetTitle( APPLICATION_TITLE );
mOffStageImageViews = Actor::New();
- mOffStageImageViews.SetAnchorPoint( AnchorPoint::CENTER );
- mOffStageImageViews.SetParentOrigin(ParentOrigin::CENTER);
+ mOffStageImageViews.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mOffStageImageViews.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mOffStageImageViews.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Build the main content of the widow:
mScrollView.ScrollStartedSignal().Connect( this, &ImageScalingIrregularGridController::OnScrollStarted );
mScrollView.ScrollCompletedSignal().Connect( this, &ImageScalingIrregularGridController::OnScrollCompleted );
- mScrollView.SetAnchorPoint(AnchorPoint::CENTER);
- mScrollView.SetParentOrigin(ParentOrigin::CENTER);
+ mScrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+ mScrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Create the scroll bar
mScrollBarVertical = ScrollBar::New(Toolkit::ScrollBar::Vertical);
- mScrollBarVertical.SetParentOrigin(ParentOrigin::TOP_RIGHT);
- mScrollBarVertical.SetAnchorPoint(AnchorPoint::TOP_RIGHT);
+ mScrollBarVertical.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_RIGHT);
+ mScrollBarVertical.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_RIGHT);
mScrollBarVertical.SetResizePolicy(Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT);
mScrollBarVertical.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH);
mScrollView.Add(mScrollBarVertical);
mScrollBarHorizontal = ScrollBar::New(Toolkit::ScrollBar::Horizontal);
- mScrollBarHorizontal.SetParentOrigin(ParentOrigin::BOTTOM_LEFT);
- mScrollBarHorizontal.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ mScrollBarHorizontal.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_LEFT);
+ mScrollBarHorizontal.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
mScrollBarHorizontal.SetResizePolicy(Dali::ResizePolicy::FIT_TO_CHILDREN, Dali::Dimension::WIDTH);
mScrollBarHorizontal.SetOrientation(Quaternion(Radian( 1.5f * Math::PI ), Vector3::ZAXIS));
mScrollView.Add(mScrollBarHorizontal);
Actor gridActor = Actor::New();
gridActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- gridActor.SetParentOrigin( ParentOrigin::CENTER );
- gridActor.SetAnchorPoint( AnchorPoint::CENTER );
+ gridActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ gridActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
// Work out the constants of the grid and cell dimensions and positions:
const float cellWidth = fieldWidth / gridWidth;
Toolkit::ImageView imageView0 = CreateImageView( IMAGE_PATH );
imageView0.SetSize(imageSize, imageSize);
- imageView0.SetParentOrigin( ParentOrigin::CENTER );
+ imageView0.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageView0.SetY( -imageSize*0.5f );
stage.Add(imageView0);
Toolkit::ImageView imageView1 = CreateImageView( redGreen0 );
- imageView1.SetParentOrigin( ParentOrigin::CENTER );
+ imageView1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageView1.SetSize(imageSize, imageSize);
imageView0.Add(imageView1);
Toolkit::ImageView imageView2 = CreateImageView( IMAGE_PATH );
imageView2.SetSize(imageSize, imageSize);
- imageView2.SetParentOrigin( ParentOrigin::CENTER );
+ imageView2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageView2.SetY( imageSize*0.5f );
stage.Add(imageView2);
Toolkit::ImageView imageView3 = CreateImageView( redGreen1);
- imageView3.SetParentOrigin( ParentOrigin::CENTER );
+ imageView3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageView3.SetSize(imageSize, imageSize);
imageView2.Add(imageView3);
CreateScene( visualPropertyMap[0] );
mWrapLabel = Toolkit::TextLabel::New(" Automatic atlasing\n WrapMode: CLAMP_TO_EDGE, MIRRORED_REPEAT");
- mWrapLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mWrapLabel.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER );
+ mWrapLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mWrapLabel.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER );
mWrapLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mWrapLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
mWrapLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
mContent.Add( mWrapLabel );
mPixelAreaLabel = Toolkit::TextLabel::New( " Use ImageVisual::Property::PIXEL_AREA\n " );
- mPixelAreaLabel.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mPixelAreaLabel.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER );
+ mPixelAreaLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mPixelAreaLabel.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER );
mPixelAreaLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mPixelAreaLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
mPixelAreaLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
mImageView[i][j].SetPosition( 50.f*(i-1), 50.f*(j-1) );
}
- mImageView[1][1].SetParentOrigin( ParentOrigin::CENTER );
- mImageView[1][1].SetAnchorPoint(AnchorPoint::CENTER );
+ mImageView[1][1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mImageView[1][1].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER );
mImageView[1][1].SetScale( 1.f/3.f );
mContent.Add( mImageView[1][1] );
- mImageView[0][0].SetParentOrigin( ParentOrigin::TOP_LEFT );
- mImageView[0][0].SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT );
+ mImageView[0][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mImageView[0][0].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT );
mImageView[0][0].SetPosition( -50.f, -50.f );
mImageView[1][1].Add( mImageView[0][0] );
- mImageView[1][0].SetParentOrigin( ParentOrigin::TOP_CENTER );
- mImageView[1][0].SetAnchorPoint(AnchorPoint::BOTTOM_CENTER );
+ mImageView[1][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mImageView[1][0].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_CENTER );
mImageView[1][1].Add( mImageView[1][0] );
- mImageView[2][0].SetParentOrigin( ParentOrigin::TOP_RIGHT );
- mImageView[2][0].SetAnchorPoint(AnchorPoint::BOTTOM_LEFT );
+ mImageView[2][0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ mImageView[2][0].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_LEFT );
mImageView[1][1].Add( mImageView[2][0] );
- mImageView[0][1].SetParentOrigin( ParentOrigin::CENTER_LEFT );
- mImageView[0][1].SetAnchorPoint(AnchorPoint::CENTER_RIGHT );
+ mImageView[0][1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT );
+ mImageView[0][1].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_RIGHT );
mImageView[1][1].Add( mImageView[0][1] );
- mImageView[2][1].SetParentOrigin( ParentOrigin::CENTER_RIGHT );
- mImageView[2][1].SetAnchorPoint(AnchorPoint::CENTER_LEFT );
+ mImageView[2][1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_RIGHT );
+ mImageView[2][1].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_LEFT );
mImageView[1][1].Add( mImageView[2][1] );
- mImageView[0][2].SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
- mImageView[0][2].SetAnchorPoint(AnchorPoint::TOP_RIGHT );
+ mImageView[0][2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
+ mImageView[0][2].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_RIGHT );
mImageView[1][1].Add( mImageView[0][2] );
- mImageView[1][2].SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mImageView[1][2].SetAnchorPoint(AnchorPoint::TOP_CENTER );
+ mImageView[1][2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mImageView[1][2].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER );
mImageView[1][1].Add( mImageView[1][2] );
- mImageView[2][2].SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
- mImageView[2][2].SetAnchorPoint(AnchorPoint::TOP_LEFT );
+ mImageView[2][2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT );
+ mImageView[2][2].SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT );
mImageView[1][1].Add( mImageView[2][2] );
}
// Background, for receiving gestures
mStageBackground = Actor::New();
- mStageBackground.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mStageBackground.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ mStageBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ mStageBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
mStageBackground.SetSize( stageSize.x, stageSize.y );
stage.Add(mStageBackground);
// Push button, for changing the image set for displaying
Toolkit::PushButton changeButton = Toolkit::PushButton::New();
changeButton.SetProperty( Toolkit::Button::Property::LABEL, "Next" );
- changeButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
- changeButton.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ changeButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
+ changeButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
stage.Add( changeButton );
changeButton.ClickedSignal().Connect( this, &ImageSvgController::OnChangeButtonClicked );
// Push button, for resetting the actor size and position
Toolkit::PushButton resetButton = Toolkit::PushButton::New();
resetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" );
- resetButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- resetButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ resetButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ resetButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
stage.Add( resetButton );
resetButton.ClickedSignal().Connect( this, &ImageSvgController::OnResetButtonClicked );
mSvgActor[i].TranslateBy( Vector3( 0.0, stageSize.height * 0.05, 0.0f ) );
stage.Add( mSvgActor[i] );
}
- mSvgActor[0].SetParentOrigin( ParentOrigin::CENTER );
- mSvgActor[0].SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
- mSvgActor[1].SetParentOrigin( ParentOrigin::CENTER );
- mSvgActor[1].SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
- mSvgActor[2].SetParentOrigin( ParentOrigin::CENTER );
- mSvgActor[2].SetAnchorPoint( AnchorPoint::TOP_RIGHT );
- mSvgActor[3].SetParentOrigin( ParentOrigin::CENTER );
- mSvgActor[3].SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mSvgActor[0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mSvgActor[0].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT );
+ mSvgActor[1].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mSvgActor[1].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT );
+ mSvgActor[2].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mSvgActor[2].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
+ mSvgActor[3].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mSvgActor[3].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
// Connect pan gesture for moving the actors
mPanGestureDetector = PanGestureDetector::New();
auto rootActor = Stage::GetCurrent().GetRootLayer();
auto cameraActor = CameraActor::New(TARGET_SIZE);
- cameraActor.SetParentOrigin(ParentOrigin::CENTER);
+ cameraActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
cameraActor.SetInvertYAxis(true);
rootActor.Add(cameraActor);
{
// create actor to render input with applied shader
mActorForInput = Toolkit::ImageView::New( url );
- mActorForInput.SetParentOrigin(ParentOrigin::CENTER);
+ mActorForInput.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mActorForInput.SetSize(TARGET_SIZE);
Property::Map customShader;
customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = FILTER_FRAGMENT_SOURCE;
auto url = Dali::Toolkit::TextureManager::AddTexture(mOutputTexture);
mImageView = Toolkit::ImageView::New(url);
- mImageView.SetParentOrigin(ParentOrigin::CENTER);
- mImageView.SetAnchorPoint(AnchorPoint::CENTER);
+ mImageView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mImageView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
mContent.Add(mImageView);
}
unsigned int GetButtonIndex( Toolkit::Button button )
{
- std::string buttonName = button.GetName();
+ std::string buttonName = button.GetProperty< std::string >( Dali::Actor::Property::NAME );
unsigned int index = 0;
if ( buttonName != "")
// Create a table view to show a pair of buttons above each image.
mTable = Toolkit::TableView::New( CellPlacement::NUMBER_OF_ROWS, NUMBER_OF_IMAGES );
- mTable.SetAnchorPoint( AnchorPoint::CENTER );
- mTable.SetParentOrigin( ParentOrigin::CENTER );
+ mTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mTable.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
Vector3 offset( 0.9f, 0.70f, 0.0f );
mTable.SetSizeModeFactor( offset );
Toolkit::TextLabel instructions = Toolkit::TextLabel::New( EXAMPLE_INSTRUCTIONS );
instructions.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
- instructions.SetParentOrigin(ParentOrigin::BOTTOM_CENTER);
+ instructions.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_CENTER);
instructions.SetY(-50.0f);
instructions.SetProperty( Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL, true );
instructions.SetProperty( Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 10 );
{
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetProperty( Toolkit::Button::Property::LABEL, "on/off" );
- button.SetParentOrigin( ParentOrigin::TOP_CENTER );
- button.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
button.ClickedSignal().Connect( this, &ImageViewController::ToggleImageOnStage );
button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
std::string s = std::to_string(x);
- button.SetName( s );
+ button.SetProperty( Dali::Actor::Property::NAME, s );
mTable.AddChild( button, Toolkit::TableView::CellPosition( CellPlacement::TOP_BUTTON, x ) );
Toolkit::PushButton button2 = Toolkit::PushButton::New();
button2.SetProperty( Toolkit::Button::Property::LABEL, "Change" );
- button2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- button2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ button2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ button2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
button2.ClickedSignal().Connect( this, &ImageViewController::ChangeImageClicked );
button2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
button2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button2.SetName( s );
+ button2.SetProperty( Dali::Actor::Property::NAME, s );
mTable.AddChild( button2, Toolkit::TableView::CellPosition( CellPlacement::MID_BUTTON, x ) );
Toolkit::PushButton button3 = Toolkit::PushButton::New();
button3.SetProperty( Toolkit::Button::Property::LABEL, "Round" );
- button3.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- button3.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ button3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ button3.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
button3.ClickedSignal().Connect( this, &ImageViewController::RoundedCornerClicked );
button3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
button3.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- button3.SetName( s );
+ button3.SetProperty( Dali::Actor::Property::NAME, s );
mTable.AddChild( button3, Toolkit::TableView::CellPosition( CellPlacement::LOWER_BUTTON, x ) );
mImageViews[x] = Toolkit::ImageView::New( );
mImageViews[x].SetProperty(Toolkit::ImageView::Property::IMAGE , imagePropertyMap );
- mImageViews[x].SetParentOrigin( ParentOrigin::CENTER );
- mImageViews[x].SetAnchorPoint( AnchorPoint::CENTER );
+ mImageViews[x].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mImageViews[x].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mImageViews[x].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mTable.AddChild( mImageViews[x], Toolkit::TableView::CellPosition( CellPlacement::IMAGE, x ) );
editButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE );
editButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED );
editButton.ClickedSignal().Connect( this, &ItemViewExample::OnModeButtonClicked);
- editButton.SetLeaveRequired( true );
+ editButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a layout toggle button. (right of toolbar)
mLayoutButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE );
mLayoutButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE_SELECTED );
mLayoutButton.ClickedSignal().Connect( this, &ItemViewExample::OnLayoutButtonClicked);
- mLayoutButton.SetLeaveRequired( true );
+ mLayoutButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( mLayoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a delete button (bottom right of screen)
mDeleteButton = Toolkit::PushButton::New();
- mDeleteButton.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT);
- mDeleteButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
+ mDeleteButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT);
+ mDeleteButton.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
mDeleteButton.SetDrawMode( DrawMode::OVERLAY_2D );
mDeleteButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, DELETE_IMAGE );
mDeleteButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
mDeleteButton.SetSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) );
mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked);
- mDeleteButton.SetLeaveRequired( true );
- mDeleteButton.SetVisible( false );
+ mDeleteButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+ mDeleteButton.SetProperty( Actor::Property::VISIBLE, false );
stage.Add( mDeleteButton );
// Create an insert button (bottom right of screen)
mInsertButton = Toolkit::PushButton::New();
- mInsertButton.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT);
- mInsertButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
+ mInsertButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT);
+ mInsertButton.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
mInsertButton.SetDrawMode( DrawMode::OVERLAY_2D );
mInsertButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, INSERT_IMAGE );
mInsertButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked);
- mInsertButton.SetLeaveRequired( true );
- mInsertButton.SetVisible( false );
+ mInsertButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+ mInsertButton.SetProperty( Actor::Property::VISIBLE, false );
stage.Add( mInsertButton );
// Create an replace button (bottom right of screen)
mReplaceButton = Toolkit::PushButton::New();
- mReplaceButton.SetParentOrigin(ParentOrigin::BOTTOM_RIGHT);
- mReplaceButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
+ mReplaceButton.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT);
+ mReplaceButton.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
mReplaceButton.SetDrawMode( DrawMode::OVERLAY_2D );
mReplaceButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, REPLACE_IMAGE );
mReplaceButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked);
- mReplaceButton.SetLeaveRequired( true );
- mReplaceButton.SetVisible( false );
+ mReplaceButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
+ mReplaceButton.SetProperty( Actor::Property::VISIBLE, false );
stage.Add( mReplaceButton );
// Create the item view actor
mItemView = ItemView::New(*this);
- mItemView.SetParentOrigin(ParentOrigin::CENTER);
- mItemView.SetAnchorPoint(AnchorPoint::CENTER);
+ mItemView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mItemView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
// Display item view on the stage
stage.Add( mItemView );
{
SetTitle("Edit: Remove Many");
- mDeleteButton.SetVisible( true );
+ mDeleteButton.SetProperty( Actor::Property::VISIBLE, true );
mTapDetector = TapGestureDetector::New();
if( box )
{
mTapDetector.Attach( child );
- box.SetVisible( true );
+ box.SetProperty( Actor::Property::VISIBLE, true );
}
}
if( box )
{
- box.SetVisible( false );
+ box.SetProperty( Actor::Property::VISIBLE, false );
Actor tick = box.FindChildByName( "Tick" );
if( tick )
{
- tick.SetVisible( false );
+ tick.SetProperty( Actor::Property::VISIBLE, false );
}
}
}
mTapDetector.Reset();
- mDeleteButton.SetVisible( false );
+ mDeleteButton.SetProperty( Actor::Property::VISIBLE, false );
}
void SelectOnTap( Actor actor, const TapGesture& tap )
Actor tick = actor.FindChildByName( "Tick" );
if( tick )
{
- tick.SetVisible( !tick.IsVisible() );
+ tick.SetProperty( Actor::Property::VISIBLE, !tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
}
}
Actor child = mItemView.GetChildAt( i );
Actor tick = child.FindChildByName( "Tick" );
- if( tick && tick.IsVisible() )
+ if( tick && tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) )
{
removeList.push_back( mItemView.GetItemId(child) );
}
{
SetTitle("Edit: Insert Many");
- mInsertButton.SetVisible( true );
+ mInsertButton.SetProperty( Actor::Property::VISIBLE, true );
mTapDetector = TapGestureDetector::New();
if( box )
{
mTapDetector.Attach( child );
- box.SetVisible( true );
+ box.SetProperty( Actor::Property::VISIBLE, true );
}
}
if( box )
{
- box.SetVisible( false );
+ box.SetProperty( Actor::Property::VISIBLE, false );
Actor tick = box.FindChildByName( "Tick" );
if( tick )
{
- tick.SetVisible( false );
+ tick.SetProperty( Actor::Property::VISIBLE, false );
}
}
}
mTapDetector.Reset();
- mInsertButton.SetVisible( false );
+ mInsertButton.SetProperty( Actor::Property::VISIBLE, false );
}
bool OnInsertButtonClicked( Toolkit::Button button )
Actor child = mItemView.GetChildAt( i );
Actor tick = child.FindChildByName( "Tick" );
- if( tick && tick.IsVisible() )
+ if( tick && tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) )
{
insertList.push_back( Item( mItemView.GetItemId(child), NewItem(rand()) ) );
}
{
SetTitle("Edit: Replace Many");
- mReplaceButton.SetVisible( true );
+ mReplaceButton.SetProperty( Actor::Property::VISIBLE, true );
mTapDetector = TapGestureDetector::New();
if( box )
{
mTapDetector.Attach( child );
- box.SetVisible( true );
+ box.SetProperty( Actor::Property::VISIBLE, true );
}
}
if( box )
{
- box.SetVisible( false );
+ box.SetProperty( Actor::Property::VISIBLE, false );
Actor tick = box.FindChildByName( "Tick" );
if( tick )
{
- tick.SetVisible( false );
+ tick.SetProperty( Actor::Property::VISIBLE, false );
}
}
}
mTapDetector.Reset();
- mReplaceButton.SetVisible( false );
+ mReplaceButton.SetProperty( Actor::Property::VISIBLE, false );
}
bool OnReplaceButtonClicked( Toolkit::Button button )
Actor child = mItemView.GetChildAt( i );
Actor tick = child.FindChildByName( "Tick" );
- if( tick && tick.IsVisible() )
+ if( tick && tick.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) )
{
replaceList.push_back( Item( mItemView.GetItemId(child), NewItem(rand()) ) );
}
// Add a border image child actor
ImageView borderActor = ImageView::New();
- borderActor.SetParentOrigin( ParentOrigin::CENTER );
- borderActor.SetAnchorPoint( AnchorPoint::CENTER );
+ borderActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ borderActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
borderActor.SetSizeModeFactor( Vector3( 2.0f * ITEM_BORDER_SIZE, 2.0f * ITEM_BORDER_SIZE, 0.0f ) );
borderActor.SetColorMode( USE_PARENT_COLOR );
// Add a checkbox child actor; invisible until edit-mode is enabled
ImageView checkbox = ImageView::New();
- checkbox.SetName( "CheckBox" );
+ checkbox.SetProperty( Dali::Actor::Property::NAME, "CheckBox" );
checkbox.SetColorMode( USE_PARENT_COLOR );
- checkbox.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- checkbox.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
+ checkbox.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ checkbox.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
checkbox.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f );
checkbox.SetPosition( -SELECTION_BORDER_WIDTH, SELECTION_BORDER_WIDTH );
checkbox.SetZ( 0.1f );
MODE_INSERT_MANY != mMode &&
MODE_REPLACE_MANY != mMode )
{
- checkbox.SetVisible( false );
+ checkbox.SetProperty( Actor::Property::VISIBLE, false );
}
borderActor.Add( checkbox );
ImageView tick = ImageView::New( SELECTED_IMAGE );
- tick.SetName( "Tick" );
+ tick.SetProperty( Dali::Actor::Property::NAME, "Tick" );
tick.SetColorMode( USE_PARENT_COLOR );
- tick.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- tick.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
+ tick.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ tick.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
tick.SetSize( spiralItemSize.width * 0.2f, spiralItemSize.width * 0.2f );
tick.SetZ( 0.2f );
- tick.SetVisible( false );
+ tick.SetProperty( Actor::Property::VISIBLE, false );
checkbox.Add( tick );
// Connect new items for various editing modes
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- mMeshActor.SetParentOrigin( ParentOrigin::CENTER );
- mMeshActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mMeshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add( mMeshActor );
Animation animation = Animation::New(5);
Stage stage = Stage::GetCurrent();
Toolkit::TableView modeSelectTableView = Toolkit::TableView::New( 4, 1 );
- modeSelectTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
- modeSelectTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ modeSelectTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ modeSelectTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
modeSelectTableView.SetFitHeight( 0 );
modeSelectTableView.SetFitHeight( 1 );
modeSelectTableView.SetFitHeight( 2 );
.Add( Toolkit::TextVisual::Property::TEXT_COLOR, Vector4( 0.8f, 0.8f, 0.8f, 1.0f ) )
);
- radio.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radio.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ radio.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ radio.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
radio.SetProperty( Toolkit::Button::Property::SELECTED, i == 0 );
radio.PressedSignal().Connect( this, &ExampleController::OnButtonPressed );
mButtons[i] = radio;
Toolkit::TableView elementCountTableView = Toolkit::TableView::New( 1, 3 );
elementCountTableView.SetCellPadding( Vector2( 6.0f, 0.0f ) );
- elementCountTableView.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
- elementCountTableView.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+ elementCountTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
+ elementCountTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT );
elementCountTableView.SetFitHeight( 0 );
elementCountTableView.SetFitWidth( 0 );
elementCountTableView.SetFitWidth( 1 );
elementCountTableView.SetFitWidth( 2 );
mMinusButton = Toolkit::PushButton::New();
mMinusButton.SetProperty( Toolkit::Button::Property::LABEL, "<<" );
- mMinusButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mMinusButton.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+ mMinusButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mMinusButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT );
Toolkit::PushButton mPlusButton = Toolkit::PushButton::New();
mPlusButton.SetProperty( Toolkit::Button::Property::LABEL, ">>" );
- mPlusButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mPlusButton.SetAnchorPoint( AnchorPoint::CENTER_RIGHT );
+ mPlusButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mPlusButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_RIGHT );
mMinusButton.ClickedSignal().Connect( this, &ExampleController::OnButtonClicked );
mPlusButton.ClickedSignal().Connect( this, &ExampleController::OnButtonClicked );
mIndicesCountLabel = Toolkit::TextLabel::New();
- mIndicesCountLabel.SetParentOrigin( ParentOrigin::CENTER );
- mIndicesCountLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mIndicesCountLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mIndicesCountLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
std::stringstream str;
str << mCurrentIndexCount;
TOOLBAR_IMAGE,
APPLICATION_TITLE );
- mContent.SetLeaveRequired(true);
+ mContent.SetProperty( Actor::Property::LEAVE_REQUIRED,true);
mContent.TouchSignal().Connect( this, &ExampleController::OnTouched );
// Create magnifier (controlled by human touch)
Layer overlay = Layer::New();
- overlay.SetSensitive(false);
- overlay.SetParentOrigin( ParentOrigin::CENTER );
+ overlay.SetProperty( Actor::Property::SENSITIVE,false);
+ overlay.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
overlay.SetSize(mStageSize);
Stage::GetCurrent().Add(overlay);
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- mMeshActor.SetParentOrigin( ParentOrigin::CENTER );
- mMeshActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mMeshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add( mMeshActor );
Animation animation = Animation::New(10);
//Main, central model
mContainers[0].SetSizeModeFactor( Vector3( MODEL_SCALE, MODEL_SCALE, 0.0f ) );
- mContainers[0].SetParentOrigin( ParentOrigin::CENTER );
- mContainers[0].SetAnchorPoint( AnchorPoint::CENTER );
+ mContainers[0].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mContainers[0].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
//Top left model
mContainers[1].SetSizeModeFactor( Vector3( MODEL_SCALE / 3.0f, MODEL_SCALE / 3.0f, 0.0f ) );
- mContainers[1].SetParentOrigin( Vector3( 0.05, 0.03, 0.5 ) ); //Offset from top left
- mContainers[1].SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mContainers[1].SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.05, 0.03, 0.5 ) ); //Offset from top left
+ mContainers[1].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
//Set up models
for( int i = 0; i < NUM_MESHES; i++ )
//Create control to display model
Control control = Control::New();
control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- control.SetParentOrigin( ParentOrigin::CENTER );
- control.SetAnchorPoint( AnchorPoint::CENTER );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mContainers[i].Add( control );
//Make model spin to demonstrate 3D
{
//Actor for positioning model and shading mode buttons.
Actor positionActorModel = Actor::New();
- positionActorModel.SetParentOrigin( Vector3( BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) );
- positionActorModel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ positionActorModel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) );
+ positionActorModel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
layer.Add( positionActorModel );
//Create button for model changing.
PushButton modelButton = Toolkit::PushButton::New();
modelButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
modelButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeModelClicked );
- modelButton.SetParentOrigin( ParentOrigin::TOP_CENTER );
- modelButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ modelButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ modelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
modelButton.SetProperty( Toolkit::Button::Property::LABEL, "Model" );
positionActorModel.Add( modelButton );
PushButton shadingModeButton = Toolkit::PushButton::New();
shadingModeButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
shadingModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeShadingModeClicked );
- shadingModeButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- shadingModeButton.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ shadingModeButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ shadingModeButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
shadingModeButton.SetProperty( Toolkit::Button::Property::LABEL, "Shading Mode" );
positionActorModel.Add( shadingModeButton );
TextLabel changeTitleLabel = TextLabel::New( "Change" );
changeTitleLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
changeTitleLabel.SetProperty( TextLabel::Property::UNDERLINE, "{\"thickness\":\"2.0\"}" );
- changeTitleLabel.SetParentOrigin( ParentOrigin::TOP_CENTER );
- changeTitleLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ changeTitleLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ changeTitleLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
modelButton.Add( changeTitleLabel );
//Create button for pausing animations.
PushButton pauseButton = Toolkit::PushButton::New();
pauseButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
pauseButton.ClickedSignal().Connect( this, &MeshVisualController::OnPauseClicked );
- pauseButton.SetParentOrigin( Vector3( 0.5, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) );
- pauseButton.SetAnchorPoint( AnchorPoint::CENTER );
+ pauseButton.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) );
+ pauseButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
pauseButton.SetProperty( Toolkit::Button::Property::LABEL, PAUSE );
layer.Add( pauseButton );
//Actor for positioning light position buttons.
Actor positionActorLight = Actor::New();
- positionActorLight.SetParentOrigin( Vector3( 1.0 - BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) );
- positionActorLight.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ positionActorLight.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 1.0 - BUTTONS_OFFSET_SIDE, 1.0 - BUTTONS_OFFSET_BOTTOM, 0.5 ) );
+ positionActorLight.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
layer.Add( positionActorLight );
//Create button for switching between manual and fixed light position.
PushButton lightModeButton = Toolkit::PushButton::New();
lightModeButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
lightModeButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightModeClicked );
- lightModeButton.SetParentOrigin( ParentOrigin::TOP_CENTER );
- lightModeButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ lightModeButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ lightModeButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
lightModeButton.SetProperty( Toolkit::Button::Property::LABEL, FIXED );
positionActorLight.Add( lightModeButton );
PushButton lightSideButton = Toolkit::PushButton::New();
lightSideButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
lightSideButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeLightSideClicked );
- lightSideButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- lightSideButton.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ lightSideButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ lightSideButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
lightSideButton.SetProperty( Toolkit::Button::Property::LABEL, FRONT );
positionActorLight.Add( lightSideButton );
TextLabel lightTitleLabel = TextLabel::New( "Light Position" );
lightTitleLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
lightTitleLabel.SetProperty( TextLabel::Property::UNDERLINE, "{\"thickness\":\"2.0\"}" );
- lightTitleLabel.SetParentOrigin( ParentOrigin::TOP_CENTER );
- lightTitleLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ lightTitleLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ lightTitleLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
lightModeButton.Add( lightTitleLabel );
}
}
//Set position relative to top left, as the light source property is also relative to the top left.
- mLightSource.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mLightSource.SetAnchorPoint( AnchorPoint::CENTER );
+ mLightSource.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mLightSource.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLightSource.SetPosition( Stage::GetCurrent().GetSize().x * 0.85f, Stage::GetCurrent().GetSize().y * 0.125 );
//Supply an image to represent the light.
//Place the light source on a layer above the base, so that it is rendered above everything else.
Layer upperLayer = Layer::New();
upperLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- upperLayer.SetParentOrigin( ParentOrigin::CENTER );
- upperLayer.SetAnchorPoint( AnchorPoint::CENTER );
+ upperLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ upperLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
baseLayer.Add( upperLayer );
upperLayer.Add( mLightSource );
void UseFixedLight()
{
//Hide draggable source
- mLightSource.SetVisible( false );
+ mLightSource.SetProperty( Actor::Property::VISIBLE, false );
//Use stage dimensions to place light at center, offset in z axis.
Stage stage = Stage::GetCurrent();
void UseManualLight()
{
//Show draggable source
- mLightSource.SetVisible( true );
+ mLightSource.SetProperty( Actor::Property::VISIBLE, true );
//Update to switch light position of models to that of the source.
UpdateLight();
void UpdateLight()
{
//Set light position to the x and y of the light control, offset into/out of the screen.
- Vector3 controlPosition = mLightSource.GetCurrentPosition();
+ Vector3 controlPosition = mLightSource.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
Vector3 lightPosition = Vector3( controlPosition.x, controlPosition.y,
( mLightFront ? 1 : -1 ) * Stage::GetCurrent().GetSize().x / 2.0f );
mMetaballs[i].radius = mMetaballs[i].initRadius = Random::Range(0.05f,0.07f);
mMetaballs[i].actor = Actor::New( );
- mMetaballs[i].actor.SetName( "Metaball" );
+ mMetaballs[i].actor.SetProperty( Dali::Actor::Property::NAME, "Metaball" );
mMetaballs[i].actor.SetScale( 1.0f );
- mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER );
+ mMetaballs[i].actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mMetaballs[i].actor.AddRenderer( renderer );
mMetaballs[i].positionIndex = mMetaballs[i].actor.RegisterProperty( "uPositionMetaball", mMetaballs[i].position );
// Root creation
mMetaballRoot = Actor::New();
- mMetaballRoot.SetParentOrigin( ParentOrigin::CENTER );
+ mMetaballRoot.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
for( uint32_t i = 0; i < METABALL_NUMBER; i++ )
{
mMetaballRoot.Add( mMetaballs[i].actor );
// Create actor
mCompositionActor = Actor::New( );
- mCompositionActor.SetParentOrigin(ParentOrigin::CENTER);
+ mCompositionActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mCompositionActor.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
mCompositionActor.SetSize(mScreenSize.x, mScreenSize.y);
mCompositionActor.AddRenderer( mRenderer );
mMetaballs[i].position = Vector2(0.0f, 0.0f);
mMetaballs[i].actor = Actor::New();
- mMetaballs[i].actor.SetName( "Metaball" );
+ mMetaballs[i].actor.SetProperty( Dali::Actor::Property::NAME, "Metaball" );
mMetaballs[i].actor.SetScale( 1.0f );
- mMetaballs[i].actor.SetParentOrigin( ParentOrigin::CENTER );
+ mMetaballs[i].actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mMetaballs[i].actor.AddRenderer( renderer );
//Root creation
mMetaballRoot = Actor::New();
- mMetaballRoot.SetParentOrigin( ParentOrigin::CENTER );
+ mMetaballRoot.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
for( uint32_t i = 0 ; i < METABALL_NUMBER ; i++ )
{
mMetaballRoot.Add( mMetaballs[i].actor );
// Create actor
mCompositionActor = Actor::New( );
- mCompositionActor.SetParentOrigin(ParentOrigin::CENTER);
+ mCompositionActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mCompositionActor.SetPosition(Vector3(0.0f, 0.0f, 0.0f));
mCompositionActor.SetSize(mScreenSize.x, mScreenSize.y);
//Add background
Toolkit::ImageView backView = Toolkit::ImageView::New( BACKGROUND_IMAGE );
- backView.SetParentOrigin( ParentOrigin::CENTER );
- backView.SetAnchorPoint( AnchorPoint::CENTER );
+ backView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ backView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add( backView );
mModelCounter = 0;
mModel3dView = Model3dView::New( MODEL_FILE[0], MATERIAL_FILE[0], IMAGE_PATH );
- mModel3dView.SetParentOrigin( ParentOrigin::CENTER );
- mModel3dView.SetAnchorPoint( AnchorPoint::CENTER );
- mModel3dView.SetName( "model3dViewControl" );
+ mModel3dView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mModel3dView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mModel3dView.SetProperty( Dali::Actor::Property::NAME, "model3dViewControl" );
mModel3dView.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
mModel3dView.SetSize(screenSize);
mButtonLayer = Layer::New();
mButtonLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mButtonLayer.SetParentOrigin( ParentOrigin::CENTER );
- mButtonLayer.SetAnchorPoint( AnchorPoint::CENTER );
+ mButtonLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mButtonLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add(mButtonLayer);
// Create button for model changing
Toolkit::PushButton editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeModelClicked);
- editButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- editButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Model" );
mButtonLayer.Add( editButton );
editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeLightingClicked);
- editButton.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- editButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
+ editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Shader" );
mButtonLayer.Add( editButton );
editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnPauseAnimationsClicked);
- editButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- editButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
editButton.SetProperty( Toolkit::Button::Property::LABEL, "Pause Animations" );
mButtonLayer.Add( editButton );
layoutButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE );
layoutButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED );
layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked);
- layoutButton.SetLeaveRequired( true );
+ layoutButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Input
mMotionBlurEffect = CreateMotionBlurEffect();
mMotionBlurImageView = ImageView::New();
SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y );
- mMotionBlurImageView.SetParentOrigin( ParentOrigin::CENTER );
+ mMotionBlurImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mMotionBlurImageView.SetSize(mMotionBlurActorSize.x, mMotionBlurActorSize.y);
mContentLayer.Add( mMotionBlurImageView );
layoutButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE );
layoutButton.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED );
layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked);
- layoutButton.SetLeaveRequired( true );
+ layoutButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Input
mMotionStretchEffect["url"] = MOTION_STRETCH_ACTOR_IMAGE1;
mMotionStretchImageView = ImageView::New();
mMotionStretchImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, mMotionStretchEffect );
- mMotionStretchImageView.SetParentOrigin( ParentOrigin::CENTER );
- mMotionStretchImageView.SetAnchorPoint( AnchorPoint::CENTER );
+ mMotionStretchImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mMotionStretchImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mMotionStretchImageView.SetSize( MOTION_STRETCH_ACTOR_WIDTH, MOTION_STRETCH_ACTOR_HEIGHT );
mContentLayer.Add( mMotionStretchImageView );
mButtonArea = Layer::New();
mButtonArea.SetSize( stageSize.x, BUTTON_HEIGHT );
- mButtonArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mButtonArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mButtonArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mButtonArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
stage.Add( mButtonArea );
mButtonShow = PushButton::New();
mButtonShow.SetProperty( Button::Property::TOGGLABLE, true );
mButtonShow.SetProperty( Toolkit::Button::Property::LABEL, "SHOW" );
- mButtonShow.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mButtonShow.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mButtonShow.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mButtonShow.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mButtonShow.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
mButtonShow.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
mButtonArea.Add( mButtonShow );
mButtonRefreshAlways = PushButton::New();
mButtonRefreshAlways.SetProperty( Button::Property::TOGGLABLE, true );
mButtonRefreshAlways.SetProperty( Toolkit::Button::Property::LABEL, "ALWAYS" );
- mButtonRefreshAlways.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mButtonRefreshAlways.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mButtonRefreshAlways.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mButtonRefreshAlways.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mButtonRefreshAlways.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
mButtonRefreshAlways.SetPosition( (stageSize.x / BUTTON_COUNT)*1.0f, 0.0f );
mButtonRefreshAlways.StateChangedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
mButtonRefreshOnce = PushButton::New();
mButtonRefreshOnce.SetProperty( Toolkit::Button::Property::LABEL, "ONCE" );
- mButtonRefreshOnce.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mButtonRefreshOnce.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mButtonRefreshOnce.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mButtonRefreshOnce.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mButtonRefreshOnce.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
mButtonRefreshOnce.SetPosition( (stageSize.x / BUTTON_COUNT)*2.0f, 0.0f );
mButtonRefreshOnce.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
mButtonCapture = PushButton::New();
mButtonCapture.SetProperty( Toolkit::Button::Property::LABEL, "CAPTURE" );
- mButtonCapture.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mButtonCapture.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mButtonCapture.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mButtonCapture.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mButtonCapture.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
mButtonCapture.SetPosition( (stageSize.x / BUTTON_COUNT)*3.0f, 0.0f );
mButtonCapture.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
mButtonReset = PushButton::New();
mButtonReset.SetProperty( Toolkit::Button::Property::LABEL, "RESET" );
- mButtonReset.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mButtonReset.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mButtonReset.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mButtonReset.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mButtonReset.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
mButtonReset.SetPosition( (stageSize.x / BUTTON_COUNT)*4.0f, 0.0f );
mButtonReset.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
mTopContentArea = Actor::New();
mTopContentArea.SetSize( stageSize.x, contentHeight );
- mTopContentArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mTopContentArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mTopContentArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mTopContentArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mTopContentArea.SetY( BUTTON_HEIGHT );
stage.Add( mTopContentArea );
mBottomContentArea = Actor::New();
mBottomContentArea.SetSize( stageSize.x, contentHeight );
- mBottomContentArea.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mBottomContentArea.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mBottomContentArea.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mBottomContentArea.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
stage.Add( mBottomContentArea );
mSourceActor = ImageView::New(JPG_FILENAME);
- mSourceActor.SetParentOrigin( ParentOrigin::CENTER);
- mSourceActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mSourceActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+ mSourceActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mTopContentArea.Add( mSourceActor );
Animation animation = Animation::New(2.f);
animation.Play();
TextLabel textLabel1 = TextLabel::New( "Image" );
- textLabel1.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- textLabel1.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ textLabel1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ textLabel1.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mTopContentArea.Add( textLabel1 );
// Wait until button press before creating mOffscreenRenderTask
TextLabel textLabel2 = TextLabel::New( "Native Image" );
- textLabel2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- textLabel2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ textLabel2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ textLabel2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mBottomContentArea.Add( textLabel2 );
}
mFrameBuffer.AttachColorTexture( mNativeTexture );
mCameraActor = CameraActor::New( imageSize );
- mCameraActor.SetParentOrigin( ParentOrigin::CENTER );
- mCameraActor.SetParentOrigin( AnchorPoint::CENTER );
+ mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, AnchorPoint::CENTER );
mTopContentArea.Add( mCameraActor );
RenderTaskList taskList = stage.GetRenderTaskList();
SetupNativeImage();
mDisplayActor = Actor::New();
- mDisplayActor.SetParentOrigin( ParentOrigin::CENTER );
- mDisplayActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mDisplayActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mDisplayActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
Geometry geometry = DemoHelper::CreateTexturedQuad();
if( !mPageTurnPortraitView )
{
mPageTurnPortraitView = PageTurnPortraitView::New( mPortraitPageFactory, stageSize );
- mPageTurnPortraitView.SetParentOrigin( ParentOrigin::CENTER );
+ mPageTurnPortraitView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
}
if( mPageTurnLandscapeView )
if( !mPageTurnLandscapeView )
{
mPageTurnLandscapeView = PageTurnLandscapeView::New( mLandscapePageFactory, Vector2(stageSize.x*0.5f, stageSize.y) );
- mPageTurnLandscapeView.SetParentOrigin( ParentOrigin::CENTER );
+ mPageTurnLandscapeView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
}
if( mPageTurnPortraitView )
stage.KeyEventSignal().Connect( this, &PerfScroll::OnKeyEvent );
mParent = Actor::New();
- mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mParent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
stage.Add(mParent);
if( gUseMesh )
// Create a table view.
TableView tableView = TableView::New( TABLE_VIEW_ROWS, TABLE_VIEW_COLUMNS );
- tableView.SetAnchorPoint( AnchorPoint::CENTER );
- tableView.SetParentOrigin( ParentOrigin::CENTER );
+ tableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ tableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
tableView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
tableView.SetSizeModeFactor( TABLE_VIEW_SIZE_MODE_FACTOR );
stage.Add( tableView );
control.SetBackgroundColor( Vector4( Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), 1.0f ) );
control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
control.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); // Ensures the position always uses top-left for its calculations.
- control.SetAnchorPoint( anchorPoint ); // This anchor-point is used for the rotation and the scale.
+ control.SetProperty( Actor::Property::ANCHOR_POINT, anchorPoint ); // This anchor-point is used for the rotation and the scale.
// Add to the table-view
tableView.AddChild( control, TableView::CellPosition( row, column ) );
mRenderer.RegisterProperty( "uPointSize", 80.0f );
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- mMeshActor.SetParentOrigin( ParentOrigin::CENTER );
- mMeshActor.SetAnchorPoint( AnchorPoint::CENTER );
+ mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mMeshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add( mMeshActor );
Animation animation = Animation::New(15);
// Add title to the tool bar.
mItemView = Toolkit::ItemView::New( *this );
- mItemView.SetParentOrigin( ParentOrigin::CENTER );
- mItemView.SetAnchorPoint( AnchorPoint::CENTER );
+ mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Use a grid layout for tests
const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f;
Toolkit::Popup popup = Toolkit::Popup::New();
- popup.SetName( "popup" );
- popup.SetParentOrigin( ParentOrigin::CENTER );
- popup.SetAnchorPoint( AnchorPoint::CENTER );
+ popup.SetProperty( Dali::Actor::Property::NAME, "popup" );
+ popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
popup.SetSize( POPUP_WIDTH_DP, 0.0f );
popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false );
Toolkit::Popup CreateConfirmationPopup( int numberOfButtons )
{
Toolkit::Popup confirmationPopup = Toolkit::Popup::New();
- confirmationPopup.SetName( "MAIN-POPUP-SELF" );
+ confirmationPopup.SetProperty( Dali::Actor::Property::NAME, "MAIN-POPUP-SELF" );
if( numberOfButtons > 0 )
{
// Start with a control area image.
Toolkit::ImageView footer = Toolkit::ImageView::New( DEFAULT_CONTROL_AREA_IMAGE_PATH );
- footer.SetName( "controlAreaImage" );
+ footer.SetProperty( Dali::Actor::Property::NAME, "controlAreaImage" );
// Set up the container's layout.
footer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
footer.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
footer.SetSize( 0.0f, 130.0f );
- footer.SetAnchorPoint( AnchorPoint::CENTER );
- footer.SetParentOrigin( ParentOrigin::CENTER );
+ footer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ footer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
Actor okButton = CreateOKButton();
- okButton.SetParentOrigin( ParentOrigin::CENTER );
- okButton.SetAnchorPoint( AnchorPoint::CENTER );
+ okButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ okButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
okButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
okButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) );
if( numberOfButtons > 1 )
{
Toolkit::TableView controlLayout = Toolkit::TableView::New( 1, 2 );
- controlLayout.SetParentOrigin( ParentOrigin::CENTER );
- controlLayout.SetAnchorPoint( AnchorPoint::CENTER );
+ controlLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ controlLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
controlLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Actor cancelButton = CreateCancelButton();
- cancelButton.SetParentOrigin( ParentOrigin::CENTER );
- cancelButton.SetAnchorPoint( AnchorPoint::CENTER );
+ cancelButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ cancelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
cancelButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
cancelButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0 ) );
Actor CreateTitle( std::string title )
{
Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( title );
- titleActor.SetName( "titleActor" );
+ titleActor.SetProperty( Dali::Actor::Property::NAME, "titleActor" );
titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
titleActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
Toolkit::PushButton CreateOKButton()
{
Toolkit::PushButton okayButton = Toolkit::PushButton::New();
- okayButton.SetName( POPUP_CONTROL_OK_NAME );
+ okayButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_OK_NAME );
okayButton.SetProperty( Toolkit::Button::Property::LABEL, "OK!" );
okayButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked );
Toolkit::PushButton CreateCancelButton()
{
Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
- cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME );
+ cancelButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_CANCEL_NAME );
cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" );
cancelButton.ClickedSignal().Connect( this, &PopupExample::OnPopupButtonClicked );
bool OnButtonClicked( Toolkit::Button button )
{
// Handle menu items that create popups.
- if( button.GetName() == POPUP_BUTTON_TITLE_ID )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_ID )
{
mPopup = CreatePopup();
mPopup.SetTitle( CreateTitle( "Popup!" ) );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_BUTTONS_1_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_BUTTONS_1_ID )
{
mPopup = CreateConfirmationPopup( 1 );
mPopup.SetTitle( CreateTitle( "Title" ) );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_BUTTONS_2_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_BUTTONS_2_ID )
{
mPopup = CreateConfirmationPopup( 2 );
mPopup.SetTitle( CreateTitle( "Title" ) );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_TOAST_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TOAST_ID )
{
// Create a toast popup via the type registry (as it is a named-type).
TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "PopupToast" );
}
}
}
- else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_BUTTONS_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_CONTENT_BUTTONS_ID )
{
mPopup = CreateConfirmationPopup( 2 );
mPopup.SetTitle( CreateTitle( "Erase image" ) );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "This will erase the image permanently. Are you sure?" );
- text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_CONTENT_TEXT_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_TEXT_ID )
{
mPopup = CreatePopup();
TextLabel text = TextLabel::New( CONTENT_TEXT );
- text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
text.SetProperty( TextLabel::Property::MULTI_LINE, true );
text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_ID )
{
mPopup = CreatePopup();
Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE2 );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID )
{
mPopup = CreatePopup();
mPopup.SetTitle( CreateTitle( "Popup!" ) );
Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
- text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
text.SetProperty( TextLabel::Property::MULTI_LINE, true );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_FIXED_SIZE_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_FIXED_SIZE_ID )
{
mPopup = CreatePopup();
mPopup.SetTitle( CreateTitle( "Popup!" ) );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed size popup" );
- text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
text.SetProperty( TextLabel::Property::MULTI_LINE, true );
text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_TITLE_LARGE_CONTENT_BUTTONS_ID )
{
mPopup = CreateConfirmationPopup( 2 );
mPopup.SetTitle( CreateTitle( "Popup!" ) );
Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
- text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetProperty( Dali::Actor::Property::NAME, "POPUP_CONTENT_TEXT" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_COMPLEX_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_COMPLEX_ID )
{
mPopup = CreateConfirmationPopup( 2 );
mPopup.SetTitle( CreateTitle( "Warning" ) );
// Content
Toolkit::TableView content = Toolkit::TableView::New( 2, 2 );
- content.SetName( "COMPLEX_TABLEVIEW" );
+ content.SetProperty( Dali::Actor::Property::NAME, "COMPLEX_TABLEVIEW" );
content.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
content.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
content.SetFitHeight( 0 );
// Image
{
Toolkit::ImageView image = Toolkit::ImageView::New( IMAGE1 );
- image.SetName( "COMPLEX_IMAGE" );
+ image.SetProperty( Dali::Actor::Property::NAME, "COMPLEX_IMAGE" );
image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
SetupPopup( mPopup, button );
}
- else if( button.GetName() == POPUP_BUTTON_CUSTOM_STYLE )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CUSTOM_STYLE )
{
mPopup = CreateConfirmationPopup( 2 );
Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( "Styled Popup" );
- titleActor.SetName( "titleActor" );
+ titleActor.SetProperty( Dali::Actor::Property::NAME, "titleActor" );
titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::RED );
titleActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
virtual Actor NewItem(unsigned int itemId)
{
Toolkit::PushButton popupButton = Toolkit::PushButton::New();
- popupButton.SetName( POPUP_BUTTON_ITEMS[ itemId ].name );
+ popupButton.SetProperty( Dali::Actor::Property::NAME, POPUP_BUTTON_ITEMS[ itemId ].name );
popupButton.SetProperty( Toolkit::Button::Property::LABEL, POPUP_BUTTON_ITEMS[ itemId ].text );
popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
void AddText( Control textContainer, std::string text, unsigned int yIndex )
{
auto label = TextLabel::New(text);
- label.SetParentOrigin( ParentOrigin::TOP_CENTER );
- label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
label.SetSize( 300,TEXT_HEIGHT );
label.SetY( yIndex*TEXT_HEIGHT );
textContainer.Add( label );
CreateAnimatingScene();
auto textContainer = Control::New();
- textContainer.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ textContainer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
AddText(textContainer, "Click to add callback", 1 );
AddText(textContainer, "Press 1 to add callback", 2 );
AddText(textContainer, "Press 2 to clear callback", 3 );
mSpinner = TextLabel::New("");
- mSpinner.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mSpinner.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mSpinner.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ mSpinner.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
mSpinner.SetSize(100,100);
mStage.Add(mSpinner);
{
mSceneActor = Layer::New();
mSceneActor.SetBehavior( Layer::LAYER_3D );
- mSceneActor.SetParentOrigin(ParentOrigin::CENTER);
+ mSceneActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
// Create and add images to the scene actor:
mImageActor1 = ImageView::New( SCENE_IMAGE_1 );
mImageActor2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mImageActor3.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- mImageActor2.SetParentOrigin(ParentOrigin::CENTER);
+ mImageActor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- mImageActor1.SetParentOrigin(ParentOrigin::CENTER_LEFT);
- mImageActor1.SetAnchorPoint(AnchorPoint::CENTER_RIGHT);
+ mImageActor1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_LEFT);
+ mImageActor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_RIGHT);
- mImageActor3.SetParentOrigin(ParentOrigin::CENTER_RIGHT);
- mImageActor3.SetAnchorPoint(AnchorPoint::CENTER_LEFT);
+ mImageActor3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_RIGHT);
+ mImageActor3.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_LEFT);
mSceneActor.Add(mImageActor2);
mImageActor2.Add(mImageActor1);
//Set up layer to place UI on.
Layer layer = Layer::New();
- layer.SetParentOrigin( ParentOrigin::CENTER );
- layer.SetAnchorPoint( AnchorPoint::CENTER );
+ layer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ layer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
layer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
layer.SetBehavior( Layer::LAYER_UI ); //We use a 2D layer as this is closer to UI work than full 3D scene creation.
layer.SetDepthTestDisabled( false ); //Enable depth testing, as otherwise the 2D layer would not do so.
//Used to layout the title and the buttons below it.
Control topAlignment = Control::New();
- topAlignment.SetParentOrigin( ParentOrigin::TOP_CENTER );
- topAlignment.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ topAlignment.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ topAlignment.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
topAlignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
topAlignment.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
layer.Add( topAlignment );
//Add a title to indicate the currently selected shape.
mShapeTitle = TextLabel::New( "DEFAULT" );
- mShapeTitle.SetParentOrigin( ParentOrigin::CENTER );
- mShapeTitle.SetAnchorPoint( AnchorPoint::CENTER );
+ mShapeTitle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mShapeTitle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mShapeTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mShapeTitle.SetPadding( Padding( elementPadding, elementPadding, elementPadding, elementPadding ) );
topAlignment.Add( mShapeTitle );
//Create a variable-length container that can wrap buttons around as more are added.
FlexContainer buttonContainer = FlexContainer::New();
- buttonContainer.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- buttonContainer.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ buttonContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ buttonContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
buttonContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
buttonContainer.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
buttonContainer.SetPadding( Padding( containerPadding, containerPadding, containerPadding, containerPadding ) );
for( int modelNumber = 0; modelNumber < NUM_MODELS; modelNumber++ )
{
PushButton button = Toolkit::PushButton::New();
- button.SetParentOrigin( ParentOrigin::CENTER );
- button.SetAnchorPoint( AnchorPoint::CENTER );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
button.SetPadding( Padding( elementPadding, elementPadding, elementPadding, elementPadding ) );
button.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_IMAGE_URL[modelNumber] );
{
//Create table to hold sliders and their corresponding labels.
mSliderTable = Toolkit::TableView::New( MAX_PROPERTIES, 2 );
- mSliderTable.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mSliderTable.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mSliderTable.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mSliderTable.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mSliderTable.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mSliderTable.SetSizeModeFactor( Vector3( 0.9, 0.3, 0.0 ) ); //90% of width, 30% of height.
mSliderTable.SetFitWidth( 0 ); //Label column should fit to natural size of label.
{
//Create slider
Slider slider = Slider::New();
- slider.SetParentOrigin( ParentOrigin::CENTER );
- slider.SetAnchorPoint( AnchorPoint::CENTER );
+ slider.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ slider.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
slider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
slider.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
slider.ValueChangedSignal().Connect( this, &PrimitiveShapesController::OnSliderValueChanged );
//Create slider label
TextLabel sliderLabel = TextLabel::New();
- sliderLabel.SetParentOrigin( ParentOrigin::CENTER );
- sliderLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ sliderLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ sliderLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
sliderLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mSliderLabels.push_back( sliderLabel );
Actor container = Actor::New();
container.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
container.SetSizeModeFactor( Vector3( 0.9, 0.3, 0.0 ) ); //90% of width, 30% of height.
- container.SetParentOrigin( ParentOrigin::CENTER );
- container.SetAnchorPoint( AnchorPoint::CENTER );
+ container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
layer.Add( container );
//Create control to display the 3D primitive.
mModel = Control::New();
- mModel.SetParentOrigin( ParentOrigin::CENTER );
- mModel.SetAnchorPoint( AnchorPoint::CENTER);
+ mModel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mModel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
mModel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
container.Add( mModel );
for( unsigned i = 0; i < mSliders.size(); i++ )
{
mSliders.at( i ).SetProperty( Slider::Property::MARKS, Property::Value( 0 ) ); //Remove marks
- mSliders.at( i ).SetVisible( false );
+ mSliders.at( i ).SetProperty( Actor::Property::VISIBLE, false );
mSliderLabels.at( i ).SetProperty( TextLabel::Property::TEXT, Property::Value( "Default" ) );
- mSliderLabels.at( i ).SetVisible( false );
+ mSliderLabels.at( i ).SetProperty( Actor::Property::VISIBLE, false );
}
//Visual map for model
mSliders.at( sliderIndex ).SetProperty( Slider::Property::LOWER_BOUND, Property::Value( lowerBound ) );
mSliders.at( sliderIndex ).SetProperty( Slider::Property::UPPER_BOUND, Property::Value( upperBound ) );
mSliders.at( sliderIndex ).SetProperty( Slider::Property::VALUE, Property::Value( startPoint ) );
- mSliders.at( sliderIndex ).SetVisible( true );
+ mSliders.at( sliderIndex ).SetProperty( Actor::Property::VISIBLE, true );
//Label the slider with the property.
//We reset the TextLabel to force a relayout of the table.
mSliderTable.RemoveChildAt( TableView::CellPosition(sliderIndex, 0) );
TextLabel sliderLabel = TextLabel::New( visualPropertyLabel );
- sliderLabel.SetParentOrigin( ParentOrigin::CENTER );
- sliderLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ sliderLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ sliderLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
sliderLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mSliderTable.AddChild( sliderLabel, TableView::CellPosition( sliderIndex, 0 ) );
mSliderTable.SetCellAlignment( TableView::CellPosition( sliderIndex, 0 ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER );
- mSliderLabels.at( sliderIndex ).SetVisible( true );
+ mSliderLabels.at( sliderIndex ).SetProperty( Actor::Property::VISIBLE, true );
mSliderLabels.at( sliderIndex) = sliderLabel;
}
TOOLBAR_TITLE );
mProgressBarDefault = ProgressBar::New();
- mProgressBarDefault.SetParentOrigin(ParentOrigin::TOP_CENTER);
- mProgressBarDefault.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ mProgressBarDefault.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_CENTER);
+ mProgressBarDefault.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER);
mProgressBarDefault.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
mProgressBarDefault.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
mProgressBarDefault.ValueChangedSignal().Connect( this, &ProgressBarExample::OnValueChanged );
Toolkit::TableView contentTable = Toolkit::TableView::New(2, 1);
contentTable.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
contentTable.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT);
- contentTable.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- contentTable.SetParentOrigin(ParentOrigin::TOP_LEFT);
+ contentTable.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ contentTable.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
contentTable.SetCellPadding(Size(MARGIN_SIZE, MARGIN_SIZE * 0.5f));
for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
Actor actor = Actor::New();
actor.AddRenderer( renderer );
- actor.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
actor.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
mContentLayer.Add( actor );
mLayer3D.SetSize( stageWidth, stageHeight );
stage.Add(mLayer3D);
- mLayer3D.SetAnchorPoint( AnchorPoint::CENTER );
- mLayer3D.SetParentOrigin( ParentOrigin::CENTER );
+ mLayer3D.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mLayer3D.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mLayer3D.SetBehavior( Layer::LAYER_3D );
mLayer3D.SetDepthTestDisabled( false );
Actor panScreen = Actor::New();
auto stageSize = stage.GetSize();
panScreen.SetSize( stageSize.width, stageSize.height );
- panScreen.SetAnchorPoint( AnchorPoint::CENTER );
- panScreen.SetParentOrigin( ParentOrigin::CENTER );
+ panScreen.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ panScreen.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
auto camera2d = stage.GetRenderTaskList().GetTask(0).GetCameraActor();
panScreen.SetPosition( 0, 0, camera2d.GetNearClippingPlane() );
camera2d.Add(panScreen);
auto actor = node.cameraId != 0xffffffff ? CameraActor::New( stage.GetSize() ) : Actor::New();
actor.SetSize( 1, 1, 1 );
- actor.SetName( node.name );
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Dali::Actor::Property::NAME, node.name );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetPosition( node.translation[0], node.translation[1], node.translation[2] );
actor.SetScale( node.scale[0], node.scale[1], node.scale[2] );
actor.SetOrientation( Quaternion(node.rotationQuaternion[3],
cameraActor.SetFieldOfView( camera->yfov );
cameraActor.SetProperty( CameraActor::Property::INVERT_Y_AXIS, true);
- cameraActor.SetAnchorPoint( AnchorPoint::CENTER );
- cameraActor.SetParentOrigin( ParentOrigin::CENTER );
+ cameraActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ cameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCameras.emplace_back( cameraActor );
}
mMeshActor = Actor::New();
mMeshActor.AddRenderer( mRenderer );
mMeshActor.SetSize( stageSize );
- mMeshActor.SetParentOrigin(ParentOrigin::CENTER);
+ mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mContent.Add( mMeshActor );
// Connect the callback to the touch signal on the mesh actor
rubric.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE );
rubric.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
rubric.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
- rubric.SetParentOrigin( ParentOrigin::TOP_CENTER );
- rubric.SetAnchorPoint( ParentOrigin::TOP_CENTER );
+ rubric.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ rubric.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_CENTER );
stage.Add( rubric );
mImageView1 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/293/259/19/520_000000000000293259191500x1500_72dpi_RGB_q70.jpg");
- mImageView1.SetName("mImageView1");
- mImageView1.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mImageView1.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ mImageView1.SetProperty( Dali::Actor::Property::NAME,"mImageView1");
+ mImageView1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mImageView1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER);
mImageView1.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false);
mImageView1.SetPosition(0, 100);
mImageView1.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f));
stage.Add(mImageView1);
mImageView2 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/212/651/88/520_000000000000212651881500x1500_72dpi_RGB_q70.jpg");
- mImageView2.SetName("mImageView2");
- mImageView2.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mImageView2.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ mImageView2.SetProperty( Dali::Actor::Property::NAME,"mImageView2");
+ mImageView2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mImageView2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER);
mImageView2.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false);
mImageView2.SetPosition(400, 100);
mImageView2.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f));
stage.Add(mImageView2);
mImageView3 = Toolkit::ImageView::New("http://static.midomi.com/s/s/images/000/000/000/000/212/353/21/520_000000000000212353211500x1500_72dpi_RGB_q70.jpg");
- mImageView3.SetName("mImageView3");
- mImageView3.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mImageView3.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ mImageView3.SetProperty( Dali::Actor::Property::NAME,"mImageView3");
+ mImageView3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mImageView3.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER);
mImageView3.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false);
mImageView3.SetPosition(0, 400);
mImageView3.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f));
stage.Add(mImageView3);
mImageView4 = Toolkit::ImageView::New("http://d2k43l0oslhof9.cloudfront.net/platform/image/contents/vc/20/01/58/20170629100630071189_0bf6b911-a847-cba4-e518-be40fe2f579420170629192203240.jpg");
- mImageView4.SetName("mImageView4");
- mImageView4.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mImageView4.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ mImageView4.SetProperty( Dali::Actor::Property::NAME,"mImageView4");
+ mImageView4.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mImageView4.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER);
mImageView4.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false);
mImageView4.SetPosition(400, 400);
mImageView4.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f));
stage.Add(mImageView4);
mImageView5 = Toolkit::ImageView::New("http://static.midomi.com/h/images/w/weather_sunny.png");
- mImageView5.SetName("mImageView5");
- mImageView4.SetParentOrigin(ParentOrigin::TOP_LEFT);
- mImageView5.SetAnchorPoint(AnchorPoint::TOP_CENTER);
+ mImageView5.SetProperty( Dali::Actor::Property::NAME,"mImageView5");
+ mImageView4.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
+ mImageView5.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_CENTER);
mImageView5.SetProperty(DevelActor::Property::POSITION_USES_ANCHOR_POINT, false);
mImageView5.SetPosition(800, 100);
mImageView5.SetBackgroundColor(Vector4(0.0f, 0.0f, 0.0f, 0.0f));
{
if (event.state == KeyEvent::Down)
{
- std::cout<<"Control down key : " << control.GetName() << ", keyCode : " << event.keyCode << std::endl;
+ std::cout<<"Control down key : " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << ", keyCode : " << event.keyCode << std::endl;
}
else
{
- std::cout<<"Control up key : " << control.GetName() << ", keyCode : " << event.keyCode << std::endl;
+ std::cout<<"Control up key : " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << ", keyCode : " << event.keyCode << std::endl;
}
return false;
}
if (touch.GetState(0) == PointState::DOWN)
{
- std::cout<<"Control touch " << actor.GetName() << ", parent " << actor.GetParent().GetName() << std::endl;
+ std::cout<<"Control touch " << actor.GetProperty< std::string >( Dali::Actor::Property::NAME ) << ", parent " << actor.GetParent().GetProperty< std::string >( Dali::Actor::Property::NAME ) << std::endl;
}
return false;
void OnFocusSet(Control control)
{
- std::cout<<"OnFocusSet " << control.GetName() << std::endl;
+ std::cout<<"OnFocusSet " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << std::endl;
}
void OnFocusUnSet(Control control)
{
- std::cout<<"OnFocusUnSet " << control.GetName() << std::endl;
+ std::cout<<"OnFocusUnSet " << control.GetProperty< std::string >( Dali::Actor::Property::NAME ) << std::endl;
}
private:
// Use a gradient visual to render the background gradient.
Toolkit::Control background = Dali::Toolkit::Control::New();
- background.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- background.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ background.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ background.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
// Set up the background gradient.
// Create a TextLabel for the application title.
Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE );
- label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
// Set the parent origin to a small percentage below the top (so the demo will scale for different resolutions).
- label.SetParentOrigin( Vector3( 0.5f, 0.03f, 0.5f ) );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.03f, 0.5f ) );
label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, TEXT_COLOR );
// Layer to hold the 3D scene.
Layer layer = Layer::New();
- layer.SetAnchorPoint( AnchorPoint::CENTER );
+ layer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
// Set the parent origin to a small percentage below the center (so the demo will scale for different resolutions).
- layer.SetParentOrigin( Vector3( 0.5f, 0.58f, 0.5f ) );
+ layer.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.58f, 0.5f ) );
layer.SetBehavior( Layer::LAYER_UI );
layer.SetDepthTestDisabled( false );
stage.Add( layer );
Actor CreateMainCubeObject( Geometry& geometry, Vector3 size, TextureSet& textureSet )
{
Toolkit::Control container = Toolkit::Control::New();
- container.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- container.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+ container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
container.SetSize( size );
container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
Actor CreateFloorObject( Geometry& geometry, Vector3 size )
{
Toolkit::Control container = Toolkit::Control::New();
- container.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- container.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
container.SetSize( size );
container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
Actor CreateStencilPlaneObject( Vector3 size )
{
Toolkit::Control container = Toolkit::Control::New();
- container.SetAnchorPoint( AnchorPoint::CENTER );
- container.SetParentOrigin( ParentOrigin::CENTER );
+ container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
container.SetSize( size );
container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
Actor CreateReflectionCubeObject( Vector3 size, TextureSet& textureSet )
{
Toolkit::Control container = Toolkit::Control::New();
- container.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- container.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
container.SetSize( size );
container.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
Stage stage = Stage::GetCurrent();
stage.SetBackgroundColor( Color::BLACK );
mLabel = TextLabel::New( material[MaterialID].name );
- mLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mLabel.SetParentOrigin( Vector3( 0.5f, 0.0f, 0.5f ) );
+ mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ mLabel.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.0f, 0.5f ) );
mLabel.SetSize( stage.GetSize().x * 0.5f, stage.GetSize().y * 0.083f );
mLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
stage.Add( mLabel );
mButton = PushButton::New();
mButton.SetProperty( Button::Property::LABEL, "Exit" );
- mButton.SetParentOrigin( ParentOrigin::CENTER );
- mButton.SetAnchorPoint( AnchorPoint::CENTER );
+ mButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mButton.ClickedSignal().Connect( this, &BasicLightController::OnExit );
- mButton.SetParentOrigin( Vector3( 0.5f, 0.1f, 0.5f ) );
+ mButton.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.1f, 0.5f ) );
mButton.SetStyleName(CUSTOM_BASIC_LIGHT_THEME);
- mButton.SetColor( Vector4( material[MaterialID].diffuse) + Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) );
+ mButton.SetProperty( Actor::Property::COLOR, Vector4( material[MaterialID].diffuse) + Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) );
stage.Add(mButton);
// Step 1. Create shader
mShader.SetProperty( mShader.GetPropertyIndex( "material.specular" ), material[MaterialID].specular );
mShader.SetProperty( mShader.GetPropertyIndex( "material.shininess" ), material[MaterialID].shininess * 128.0f );
mLabel.SetProperty( TextLabel::Property::TEXT, material[MaterialID].name );
- mButton.SetColor( Vector4(material[MaterialID].diffuse) + Vector4(0.0f, 0.0f, 0.0f, 1.0f) );
+ mButton.SetProperty( Actor::Property::COLOR, Vector4(material[MaterialID].diffuse) + Vector4(0.0f, 0.0f, 0.0f, 1.0f) );
}
return true;
}
float quarterStageWidth = stage.GetSize().x * 0.25f;
mActor = Actor::New();
- mActor.SetColor( Vector4( 1.0f, 1.0f, 0.6f, 1.0f ) );
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 1.0f, 0.6f, 1.0f ) );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) );
mActor.AddRenderer( mRenderer );
stage.Add( mActor );
renderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
mActor = Actor::New();
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetPosition( position );
mActor.SetSize( size );
mActor.AddRenderer( renderer );
renderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
mActor = Actor::New();
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetSize( size );
mActor.AddRenderer( renderer );
}
stage.SetBackgroundColor( Color::BLACK );
mAnimation = Animation::New( 1.0f );
mLabel = TextLabel::New( "R:1 M:0" );
- mLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mLabel.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ mLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
mLabel.SetSize( stage.GetSize().width * 0.5f, stage.GetSize().height * 0.083f );
mLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mUiRoot = Actor::New();
m3dRoot = Actor::New();
CameraActor cameraUi = CameraActor::New(stage.GetSize());
- cameraUi.SetAnchorPoint(AnchorPoint::CENTER);
- cameraUi.SetParentOrigin(ParentOrigin::CENTER);
+ cameraUi.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+ cameraUi.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
RenderTask rendertask = Stage::GetCurrent().GetRenderTaskList().CreateTask();
rendertask.SetCameraActor( cameraUi );
rendertask.SetSourceActor( mUiRoot );
- mUiRoot.SetAnchorPoint(AnchorPoint::TOP_LEFT);
- mUiRoot.SetParentOrigin(ParentOrigin::TOP_LEFT);
+ mUiRoot.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
+ mUiRoot.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
mUiRoot.SetSize(stage.GetSize());
- m3dRoot.SetAnchorPoint(AnchorPoint::CENTER);
- m3dRoot.SetParentOrigin(ParentOrigin::CENTER);
+ m3dRoot.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+ m3dRoot.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
// Setting camera parameters for 3D Scene
mSkybox.GetActor().SetPosition( CAMERA_DEFAULT_POSITION );
float quarterStageWidth = stage.GetSize().x * 0.25f;
mActor = Actor::New();
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) );
mActor.AddRenderer( mRenderer );
Stage stage = Stage::GetCurrent();
Size size = stage.GetSize() * 0.25f;
mActor = Actor::New();
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
- mActor.SetColor( Color::BLACK );
+ mActor.SetProperty( Actor::Property::COLOR, Color::BLACK );
mActor.SetSize( Vector3( size.x, size.x, size.x ) );
mActor.AddRenderer( mRenderer );
stage.Add( mActor );
// 1. Create actor to show the effect
mActor = Actor::New();
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetSize( Vector2( TEXTURE_WIDTH, TEXTURE_HEIGHT ) );
mActor.RegisterProperty("uProgress", float(1.0f) );
stage.Add( mActor );
mNear = near;
mFar = far;
- // Camera position is shadowed in order to avoid using GetCurrentPosition()
+ // Camera position is shadowed in order to avoid using.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )
mCameraPosition = position;
// Initialise default camera
{
Stage stage = Stage::GetCurrent();
mCameraActor = stage.GetRenderTaskList().GetTask(0).GetCameraActor();
- mCameraActor.SetName( "LookCamera" );
- mCameraActor.SetAnchorPoint( AnchorPoint::CENTER );
- mCameraActor.SetParentOrigin( ParentOrigin::CENTER );
+ mCameraActor.SetProperty( Dali::Actor::Property::NAME, "LookCamera" );
+ mCameraActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mCameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCameraActor.SetFieldOfView( Radian( Degree( mFovY ) ) );
// should be read from file
Stage stage = Stage::GetCurrent();
mInterceptorActor = Actor::New();
- mInterceptorActor.SetName( "InputInterceptor" );
+ mInterceptorActor.SetProperty( Dali::Actor::Property::NAME, "InputInterceptor" );
mInterceptorActor.SetSize( Vector3( stage.GetSize().x, stage.GetSize().y, 1 ) );
mInterceptorActor.SetPosition( Vector3( 0.0, 0.0, 1.0 ) );
- mInterceptorActor.SetAnchorPoint( AnchorPoint::CENTER );
- mInterceptorActor.SetParentOrigin( ParentOrigin::CENTER );
+ mInterceptorActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mInterceptorActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCameraActor.Add( mInterceptorActor );
// Connect TouchSignal to interceptor actor
mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
mActor = Actor::New();
- mActor.SetName( "Cube" );
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Dali::Actor::Property::NAME, "Cube" );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.AddRenderer( mRenderer );
mActor.SetSize( 10.f, 10.f, 10.f );
Stage stage = Stage::GetCurrent();
mSkyboxActor = Actor::New();
- mSkyboxActor.SetName( "SkyBox" );
- mSkyboxActor.SetAnchorPoint( AnchorPoint::CENTER );
- mSkyboxActor.SetParentOrigin( ParentOrigin::CENTER );
+ mSkyboxActor.SetProperty( Dali::Actor::Property::NAME, "SkyBox" );
+ mSkyboxActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mSkyboxActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mSkyboxActor.SetPosition( CAMERA_DEFAULT_POSITION );
mSkyboxActor.AddRenderer( mSkyboxRenderer );
stage.Add( mSkyboxActor );
float quarterStageWidth = stage.GetSize().x * 0.25f;
mActor = Actor::New();
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
mActor.SetSize( Vector3( quarterStageWidth, quarterStageWidth, quarterStageWidth ) );
mActor.AddRenderer( mRenderer );
Stage stage = Stage::GetCurrent();
Size size = stage.GetSize() * 0.25f;
mActor = Actor::New();
- mActor.SetAnchorPoint( AnchorPoint::CENTER );
- mActor.SetParentOrigin( ParentOrigin::CENTER );
+ mActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mActor.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
- mActor.SetColor( Color::RED );
+ mActor.SetProperty( Actor::Property::COLOR, Color::RED );
mActor.SetSize( Vector3( size.x, size.x, size.x ) );
mActor.AddRenderer( mRenderer );
stage.Add( mActor );
Vector2 stageSize = stage.GetSize();
mScrollView = ScrollView::New();
- mScrollView.SetAnchorPoint(AnchorPoint::CENTER);
- mScrollView.SetParentOrigin(ParentOrigin::CENTER);
+ mScrollView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+ mScrollView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mContentLayer.Add( mScrollView );
mScrollView.SetSize( stageSize );
mScrollView.SetAxisAutoLock( true );
{
Actor page = Actor::New();
page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- page.SetParentOrigin( ParentOrigin::CENTER );
- page.SetAnchorPoint( AnchorPoint::CENTER );
+ page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
Stage stage = Stage::GetCurrent();
Vector2 stageSize = stage.GetSize();
{
ImageView image = CreateImage( GetNextImagePath(), imageSize.x, imageSize.y );
- image.SetParentOrigin( ParentOrigin::CENTER );
- image.SetAnchorPoint( AnchorPoint::CENTER );
+ image.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ image.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
Vector3 position( margin * 0.5f + (imageSize.x + margin) * column - stageSize.width * 0.5f,
margin * 0.5f + (imageSize.y + margin) * row - stageSize.height * 0.5f,
map[ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR;
actor.SetProperty( ImageView::Property::IMAGE, map );
- actor.SetName( filename );
- actor.SetParentOrigin(ParentOrigin::CENTER);
- actor.SetAnchorPoint(AnchorPoint::CENTER);
+ actor.SetProperty( Dali::Actor::Property::NAME, filename );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
actor.TouchSignal().Connect( this, &ExampleController::OnTouchImage );
return actor;
void CreateShadowViewAndLights()
{
mShadowView = Toolkit::ShadowView::New();
- mShadowView.SetName("Container");
- mShadowView.SetParentOrigin(ParentOrigin::CENTER);
- mShadowView.SetAnchorPoint(AnchorPoint::CENTER);
+ mShadowView.SetProperty( Dali::Actor::Property::NAME,"Container");
+ mShadowView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mShadowView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
mShadowView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mShadowView.SetPointLightFieldOfView( Math::PI / 2.0f);
mContents.Add(mShadowView);
mShadowPlaneBg = ImageView::New( DEMO_IMAGE_DIR "brick-wall.jpg" );
- mShadowPlaneBg.SetParentOrigin(ParentOrigin::CENTER);
- mShadowPlaneBg.SetAnchorPoint(AnchorPoint::CENTER);
- mShadowPlaneBg.SetName("Plane");
+ mShadowPlaneBg.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mShadowPlaneBg.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+ mShadowPlaneBg.SetProperty( Dali::Actor::Property::NAME,"Plane");
mShadowPlaneBg.SetSize(1000.0f, 1000.0f);
mContents.Add(mShadowPlaneBg);
mShadowPlaneBg.SetPosition(Vector3(50.0f, 50.0f, -200.0f));
mShadowView.Activate();
mLightAnchor = Actor::New();
- mLightAnchor.SetParentOrigin(ParentOrigin::CENTER);
- mLightAnchor.SetAnchorPoint(AnchorPoint::CENTER);
+ mLightAnchor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mLightAnchor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
mLightAnchor.SetOrientation( CalculateWorldRotation( mLightXRotation, mLightYRotation ) );
// Work out a scaling factor as the initial light position was calculated for desktop
float scaleFactor = stageSize.x / DEFAULT_STAGE_SIZE.x;
mCastingLight = Actor::New();
- mCastingLight.SetParentOrigin(ParentOrigin::CENTER);
- mCastingLight.SetAnchorPoint(AnchorPoint::CENTER);
+ mCastingLight.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+ mCastingLight.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
mCastingLight.SetPosition( Vector3( 0.0f, 0.0f, 800.0f ) * scaleFactor );
TextLabel text = TextLabel::New( "Light" );
text.SetProperty( TextLabel::Property::POINT_SIZE, 20.0f );
text.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- text.SetColor( Color::BLUE );
+ text.SetProperty( Actor::Property::COLOR, Color::BLUE );
mCastingLight.Add(text);
mLightAnchor.Add(mCastingLight);
mShadowPlaneBg.Add(mLightAnchor);
- text.SetParentOrigin(ParentOrigin::CENTER);
+ text.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
mShadowView.SetPointLight(mCastingLight);
}
void CreateScene()
{
mSceneActor = Actor::New();
- mSceneActor.SetParentOrigin(ParentOrigin::CENTER);
+ mSceneActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
// Create and add images to the scene actor:
mImageActor1 = ImageView::New( SCENE_IMAGE_1 );
mImageActor2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mImageActor3.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- mImageActor2.SetParentOrigin(ParentOrigin::CENTER);
+ mImageActor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- mImageActor1.SetParentOrigin(ParentOrigin::CENTER_LEFT);
- mImageActor1.SetAnchorPoint(AnchorPoint::CENTER_RIGHT);
+ mImageActor1.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_LEFT);
+ mImageActor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_RIGHT);
- mImageActor3.SetParentOrigin(ParentOrigin::CENTER_RIGHT);
- mImageActor3.SetAnchorPoint(AnchorPoint::CENTER_LEFT);
+ mImageActor3.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER_RIGHT);
+ mImageActor3.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER_LEFT);
mSceneActor.Add(mImageActor2);
mImageActor2.Add(mImageActor1);
{
if (gesture.state == Gesture::Started)
{
- mScaleAtPinchStart = mContents.GetCurrentScale().x;
+ mScaleAtPinchStart = mContents.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x;
}
mPinchScale = Clamp(mScaleAtPinchStart * gesture.scale, MIN_PINCH_SCALE, MAX_PINCH_SCALE);
fontClient.GetFontId( bitmapColorFont );
TextLabel label01 = TextLabel::New();
- label01.SetAnchorPoint( AnchorPoint::CENTER );
- label01.SetParentOrigin( ParentOrigin::CENTER );
+ label01.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ label01.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
label01.SetSize( 400.f, 50.f );
label01.SetPosition( 0.f, -100.f );
label01.SetProperty( TextLabel::Property::MULTI_LINE, true );
TextLabel label02 = TextLabel::New();
- label02.SetAnchorPoint( AnchorPoint::CENTER );
- label02.SetParentOrigin( ParentOrigin::CENTER );
+ label02.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ label02.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
label02.SetSize( 400.f, 50.f );
label02.SetPosition( 0.f, -50.f );
label02.SetProperty( TextLabel::Property::MULTI_LINE, true );
stage.Add( label02 );
TextLabel label03 = TextLabel::New();
- label03.SetAnchorPoint( AnchorPoint::CENTER );
- label03.SetParentOrigin( ParentOrigin::CENTER );
+ label03.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ label03.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
label03.SetSize( 400.f, 50.f );
label03.SetPosition( 0.f, 0.f );
label03.SetProperty( TextLabel::Property::MULTI_LINE, true );
stage.Add( label03 );
TextLabel label04 = TextLabel::New();
- label04.SetAnchorPoint( AnchorPoint::CENTER );
- label04.SetParentOrigin( ParentOrigin::CENTER );
+ label04.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ label04.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
label04.SetSize( 400.f, 50.f );
label04.SetPosition( 0.f, 50.f );
label04.SetProperty( TextLabel::Property::MULTI_LINE, true );
// Create a scroll view and set our desired properties
ScrollView scrollView = ScrollView::New();
- scrollView.SetAnchorPoint( AnchorPoint::CENTER );
- scrollView.SetParentOrigin( ParentOrigin::CENTER );
+ scrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ scrollView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
scrollView.SetSize( pageSize );
scrollView.SetAxisAutoLock( true );
stage.Add( scrollView );
{
Actor page = Actor::New();
page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- page.SetParentOrigin( ParentOrigin::CENTER );
- page.SetAnchorPoint( AnchorPoint::CENTER );
+ page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
Stage stage = Stage::GetCurrent();
stage.SetBackgroundColor( Vector4( 0.04f, 0.345f, 0.392f, 1.0f ) );
TextField field = TextField::New();
- field.SetParentOrigin( ParentOrigin::CENTER );
+ field.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
field.SetSize( 300.f, 60.f );
field.SetBackgroundColor( Color::WHITE );
field.SetBackgroundColor( Vector4( 1.f, 1.f, 1.f, 0.15f ) );
stage.KeyEventSignal().Connect(this, &SimpleTextLabelExample::OnKeyEvent);
mLabel = TextLabel::New( "A Quick Brown Fox Jumps Over The Lazy Dog" );
- mLabel.SetName( "SimpleTextLabel" );
- mLabel.SetAnchorPoint( AnchorPoint::CENTER );
- mLabel.SetParentOrigin( ParentOrigin::CENTER );
+ mLabel.SetProperty( Dali::Actor::Property::NAME, "SimpleTextLabel" );
+ mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mLabel.SetSize( 400.f, 400.f );
mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
mLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK );
renderer.SetTextures( textureSet );
Actor actor = Actor::New();
- actor.SetAnchorPoint( AnchorPoint::CENTER );
- actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetPosition( 0.f, 0.f);
actor.SetSize( 360.f, 360.f );
- actor.SetColor( Color::WHITE );
+ actor.SetProperty( Actor::Property::COLOR, Color::WHITE );
actor.AddRenderer( renderer );
stage.SetBackgroundColor( Color::WHITE );
Dali::Toolkit::Control control = Dali::Toolkit::ImageView::New();
- control.SetParentOrigin( ParentOrigin::CENTER );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
const std::string markupText( "<color value='blue'><font size='50'>H</font></color>ello <color value='blue'><font size='50'>w</font></color>orld" );
// Create a table view to parent the 2 MyControls
TableView contentLayout = TableView::New( 2, 2 );
- contentLayout.SetName("ContentLayout");
+ contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout");
contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
contentLayout.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
contentLayout.SetSizeModeFactor( Vector3( 1.0f, .5f, 1.0f ) );
- contentLayout.SetAnchorPoint( AnchorPoint::CENTER );
- contentLayout.SetParentOrigin( ParentOrigin::CENTER );
+ contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
contentLayout.SetCellPadding( Vector2( 50.0f, 15.0f ) );
contentLayout.SetBackgroundColor( Vector4(0.949, 0.949, 0.949, 1.0) );
// Create 2 MyControls and add to table view.
mMyControl = MyControl::New();
mMyControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mMyControl.SetParentOrigin(ParentOrigin::TOP_LEFT);
+ mMyControl.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::TOP_LEFT);
mMyControl2 = MyControl::New();
mMyControl2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mMyControl2.SetParentOrigin(ParentOrigin::CENTER);
+ mMyControl2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
contentLayout.AddChild( mMyControl2, TableView::CellPosition(0, 0) );
contentLayout.AddChild( mMyControl, TableView::CellPosition(0, 1) );
mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::Padding( padding, padding, padding, padding ) );
mItemView = Toolkit::ItemView::New( *this );
- mItemView.SetParentOrigin( ParentOrigin::CENTER );
- mItemView.SetAnchorPoint( AnchorPoint::CENTER );
+ mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Use a grid layout for tests
const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f;
Toolkit::Popup popup = Toolkit::Popup::New();
- popup.SetName( "popup" );
- popup.SetParentOrigin( ParentOrigin::CENTER );
- popup.SetAnchorPoint( AnchorPoint::CENTER );
+ popup.SetProperty( Dali::Actor::Property::NAME, "popup" );
+ popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
popup.SetSize( POPUP_WIDTH_DP, 0.0f );
popup.SetProperty( Toolkit::Popup::Property::TAIL_VISIBILITY, false );
bool OnButtonClicked( Toolkit::Button button )
{
- if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID )
+ if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_1CELL_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
- table.SetName( "TABLEVIEW_BUTTON_1CELL_ID" );
+ table.SetProperty( Dali::Actor::Property::NAME, "TABLEVIEW_BUTTON_1CELL_ID" );
table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Actor backing = CreateSolidColor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3CELL_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_3X3CELL_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED1_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
backing.Add( text );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
backing.Add( text );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIXED2_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT1_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_FIT2_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
backing.Add( text );
table.Add( backing );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL1_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL2_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
StagePopup( mPopup );
}
- else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == TABLEVIEW_BUTTON_NATURAL3_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
- text.SetAnchorPoint( AnchorPoint::CENTER );
- text.SetParentOrigin( ParentOrigin::CENTER );
+ text.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ text.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
StagePopup( mPopup );
}
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
StagePopup( mPopup );
}
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
StagePopup( mPopup );
}
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
+ else if( button.GetProperty< std::string >( Dali::Actor::Property::NAME ) == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
{
mPopup = CreatePopup();
mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
virtual Actor NewItem(unsigned int itemId)
{
Toolkit::PushButton popupButton = Toolkit::PushButton::New();
- popupButton.SetName( TABLEVIEW_BUTTON_ITEMS[ itemId ].name );
+ popupButton.SetProperty( Dali::Actor::Property::NAME, TABLEVIEW_BUTTON_ITEMS[ itemId ].name );
popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text );
popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
stage.SetBackgroundColor( BACKGROUND_COLOR );
mCircleBackground = ImageView::New( CIRCLE_BACKGROUND_IMAGE );
- mCircleBackground.SetParentOrigin( ParentOrigin::CENTER );
- mCircleBackground.SetAnchorPoint( AnchorPoint::CENTER );
+ mCircleBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mCircleBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add( mCircleBackground );
renderer.SetTextures( textureSet );
Actor meshActor = Actor::New();
- meshActor.SetParentOrigin( ParentOrigin::CENTER );
+ meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
meshActor.SetSize( 1, 1 );
meshActor.AddRenderer( renderer );
void ImageChannelControl::SetVisibility( bool visibility )
{
- printf("ImageChannelControl %s: SetVisibility( %s )\n", Self().GetName().c_str(), visibility?"T":"F" );
+ printf("ImageChannelControl %s: SetVisibility( %s )\n", Self().GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str(), visibility?"T":"F" );
if( mAnimation )
{
#include "styling-application.h"
// External includes
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
#include "image-channel-control.h"
// Content panes:
TableView contentLayout = TableView::New( 5, 1 );
- contentLayout.SetName("ContentLayout");
+ contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout");
contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- contentLayout.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- contentLayout.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
contentLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
// Assign all rows the size negotiation property of fitting to children
mContentPane.Add( contentLayout );
mTitle = TextLabel::New( "Styling Example" );
- mTitle.SetName( "Title" );
+ mTitle.SetProperty( Dali::Actor::Property::NAME, "Title" );
mTitle.SetStyleName("Title");
- mTitle.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mTitle.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ mTitle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ mTitle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTitle.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
// Buttons:
TableView imageSelectLayout = TableView::New( 1, 2 );
- imageSelectLayout.SetName("ImageSelectLayout");
+ imageSelectLayout.SetProperty( Dali::Actor::Property::NAME,"ImageSelectLayout");
imageSelectLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
imageSelectLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
- imageSelectLayout.SetAnchorPoint( AnchorPoint::CENTER );
- imageSelectLayout.SetParentOrigin( ParentOrigin::CENTER );
+ imageSelectLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ imageSelectLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
imageSelectLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
// Fit radio button column to child width, leave image to fill remainder
contentLayout.Add( imageSelectLayout );
TableView radioButtonsLayout = TableView::New( 3, 2 );
- radioButtonsLayout.SetName("RadioButtonsLayout");
+ radioButtonsLayout.SetProperty( Dali::Actor::Property::NAME,"RadioButtonsLayout");
radioButtonsLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
// Leave each row to fill to parent height
// Set each column to fit to child width
{
std::ostringstream thumbnailName; thumbnailName << "thumbnail" << i+1;
ImageView image = ImageView::New( images[i] );
- image.SetName( thumbnailName.str() );
+ image.SetProperty( Dali::Actor::Property::NAME, thumbnailName.str() );
image.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
std::ostringstream label; label << (i+1);
std::ostringstream radioButtonStyleName;
radioButtonStyleName << "imageSelectButton" << i+1;
mRadioButtons[i] = RadioButton::New( label.str() );
- mRadioButtons[i].SetName( radioButtonStyleName.str() );
- mRadioButtons[i].SetParentOrigin( ParentOrigin::TOP_LEFT );
- mRadioButtons[i].SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mRadioButtons[i].SetProperty( Dali::Actor::Property::NAME, radioButtonStyleName.str() );
+ mRadioButtons[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mRadioButtons[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mRadioButtons[i].SetProperty( Button::Property::SELECTED, false );
mRadioButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnButtonStateChange );
mRadioButtons[0].SetProperty( Button::Property::SELECTED, true );
mImagePlacement = Actor::New();
- mImagePlacement.SetParentOrigin( ParentOrigin::CENTER );
- mImagePlacement.SetAnchorPoint( AnchorPoint::CENTER );
+ mImagePlacement.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mImagePlacement.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mImagePlacement.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
imageSelectLayout.AddChild( mImagePlacement, TableView::CellPosition( 0, 1 ) );
imageSelectLayout.SetCellAlignment( TableView::CellPosition( 0, 1 ), HorizontalAlignment::RIGHT, VerticalAlignment::CENTER );
mIcc1 = ImageChannelControl::New( BIG_IMAGE_1 );
- mIcc1.SetName("ICC1");
+ mIcc1.SetProperty( Dali::Actor::Property::NAME,"ICC1");
mIcc1.SetResizePolicy( ResizePolicy::FILL_TO_PARENT , Dimension::ALL_DIMENSIONS );
mIcc1.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- mIcc1.SetParentOrigin( ParentOrigin::CENTER );
+ mIcc1.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mIcc1.SetVisibility( true );
mImagePlacement.Add( mIcc1 );
mIcc2 = ImageChannelControl::New( BIG_IMAGE_2 );
- mIcc2.SetName("ICC2");
+ mIcc2.SetProperty( Dali::Actor::Property::NAME,"ICC2");
mIcc2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT , Dimension::ALL_DIMENSIONS );
mIcc2.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- mIcc2.SetParentOrigin( ParentOrigin::CENTER );
+ mIcc2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mIcc2.SetVisibility( false );
mImagePlacement.Add( mIcc2 );
mIcc3 = ImageChannelControl::New( BIG_IMAGE_3 );
- mIcc3.SetName("ICC3");
+ mIcc3.SetProperty( Dali::Actor::Property::NAME,"ICC3");
mIcc3.SetResizePolicy( ResizePolicy::FILL_TO_PARENT , Dimension::ALL_DIMENSIONS );
mIcc3.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- mIcc3.SetParentOrigin( ParentOrigin::CENTER );
+ mIcc3.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mIcc3.SetVisibility( false );
mImagePlacement.Add( mIcc3 );
mImageChannelControl = mIcc1;
TableView channelSliderLayout = TableView::New( 3, 3 );
- channelSliderLayout.SetName("ChannelSliderLayout");
+ channelSliderLayout.SetProperty( Dali::Actor::Property::NAME,"ChannelSliderLayout");
// Contains a column of check buttons and a column of sliders for R/G/B
channelSliderLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
channelSliderLayout.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- channelSliderLayout.SetAnchorPoint( AnchorPoint::CENTER );
- channelSliderLayout.SetParentOrigin( ParentOrigin::CENTER );
+ channelSliderLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ channelSliderLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
channelSliderLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
// Set each row to fit to child height
std::ostringstream checkBoxStyleName;
checkBoxStyleName << "channelActiveCheckBox" << i+1;
mCheckButtons[i] = CheckBoxButton::New();
- mCheckButtons[i].SetName( checkBoxStyleName.str() );
- mCheckButtons[i].SetParentOrigin( ParentOrigin::CENTER );
- mCheckButtons[i].SetAnchorPoint( AnchorPoint::CENTER );
+ mCheckButtons[i].SetProperty( Dali::Actor::Property::NAME, checkBoxStyleName.str() );
+ mCheckButtons[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mCheckButtons[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mCheckButtons[i].SetProperty( Button::Property::SELECTED, true );
mCheckButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnCheckButtonChange );
TextLabel label = TextLabel::New( checkboxLabels[i] );
std::ostringstream labelStyleName; labelStyleName << "ColorLabel" << i+1;
- label.SetName( labelStyleName.str() );
+ label.SetProperty( Dali::Actor::Property::NAME, labelStyleName.str() );
label.SetStyleName( labelStyleName.str() );
- label.SetParentOrigin( ParentOrigin::CENTER );
- label.SetAnchorPoint ( AnchorPoint::CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH );
label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mChannelSliders[i] = Slider::New();
std::ostringstream sliderStyleName; sliderStyleName << "ColorSlider" << i+1;
- mChannelSliders[i].SetName( sliderStyleName.str() );
+ mChannelSliders[i].SetProperty( Dali::Actor::Property::NAME, sliderStyleName.str() );
mChannelSliders[i].SetStyleName( sliderStyleName.str() );
- mChannelSliders[i].SetParentOrigin( ParentOrigin::CENTER );
- mChannelSliders[i].SetAnchorPoint ( AnchorPoint::CENTER );
+ mChannelSliders[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mChannelSliders[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mChannelSliders[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mChannelSliders[i].SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN , Dimension::HEIGHT );
mChannelSliders[i].SetProperty( Slider::Property::LOWER_BOUND, 0.0f );
mResetButton = PushButton::New();
mResetButton.SetProperty( Toolkit::Button::Property::LABEL, "Reset" );
- mResetButton.SetName("ResetButton");
+ mResetButton.SetProperty( Dali::Actor::Property::NAME,"ResetButton");
mResetButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mResetButton.ClickedSignal().Connect( this, &StylingApplication::OnResetClicked );
contentLayout.SetCellAlignment( TableView::CellPosition( 3, 0 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
TableView themeButtonLayout = TableView::New( 1, 4 );
- themeButtonLayout.SetName("ThemeButtonsLayout");
+ themeButtonLayout.SetProperty( Dali::Actor::Property::NAME,"ThemeButtonsLayout");
themeButtonLayout.SetCellPadding( Vector2( 6.0f, 0.0f ) );
- themeButtonLayout.SetAnchorPoint( AnchorPoint::CENTER );
- themeButtonLayout.SetParentOrigin( ParentOrigin::CENTER );
+ themeButtonLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ themeButtonLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
themeButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
themeButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
themeButtonLayout.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
TextLabel label = TextLabel::New( "Theme: ");
label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
label.SetStyleName("ThemeLabel");
- label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- label.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
themeButtonLayout.AddChild( label, TableView::CellPosition( 0, 0 ) );
themeButtonLayout.SetCellAlignment( TableView::CellPosition( 0, 0 ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER );
for( int i=0; i<3; ++i )
{
mThemeButtons[i] = PushButton::New();
- mThemeButtons[i].SetName("ThemeButton");
+ mThemeButtons[i].SetProperty( Dali::Actor::Property::NAME,"ThemeButton");
mThemeButtons[i].SetStyleName("ThemeButton");
- mThemeButtons[i].SetParentOrigin( ParentOrigin::CENTER );
- mThemeButtons[i].SetAnchorPoint( ParentOrigin::CENTER );
+ mThemeButtons[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mThemeButtons[i].SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::CENTER );
mThemeButtons[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mThemeButtons[i].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mThemeButtons[i].RegisterProperty( "theme", i, Property::READ_WRITE );
Actor StylingApplication::CreateContentPane()
{
Toolkit::ImageView contentPane = Toolkit::ImageView::New( BORDER_IMAGE );
- contentPane.SetName("ContentPane");
- contentPane.SetParentOrigin( ParentOrigin::CENTER );
- contentPane.SetAnchorPoint( AnchorPoint::CENTER );
+ contentPane.SetProperty( Dali::Actor::Property::NAME,"ContentPane");
+ contentPane.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ contentPane.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
contentPane.SetPadding( Padding( BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH ) );
return contentPane;
}
Actor StylingApplication::CreateResizableContentPane()
{
Toolkit::ImageView contentPane = Toolkit::ImageView::New( BORDER_IMAGE );
- contentPane.SetName("ContentPane");
- contentPane.SetParentOrigin( ParentOrigin::CENTER );
- contentPane.SetAnchorPoint( AnchorPoint::CENTER );
+ contentPane.SetProperty( Dali::Actor::Property::NAME,"ContentPane");
+ contentPane.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ contentPane.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
contentPane.SetPadding( Padding( BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH ) );
Toolkit::ImageView grabHandle = Toolkit::ImageView::New( RESIZE_HANDLE_IMAGE );
- grabHandle.SetName("GrabHandle");
+ grabHandle.SetProperty( Dali::Actor::Property::NAME,"GrabHandle");
grabHandle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
- grabHandle.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
- grabHandle.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
+ grabHandle.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT );
+ grabHandle.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT );
grabHandle.SetPosition( -BORDER_WIDTH, -BORDER_WIDTH );
- grabHandle.SetOpacity( 0.6f );
+ grabHandle.SetProperty( DevelActor::Property::OPACITY, 0.6f );
Layer grabCornerLayer = Layer::New();
- grabCornerLayer.SetName("GrabCornerLayer");
- grabCornerLayer.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
- grabCornerLayer.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
+ grabCornerLayer.SetProperty( Dali::Actor::Property::NAME,"GrabCornerLayer");
+ grabCornerLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT );
+ grabCornerLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT );
grabCornerLayer.Add( grabHandle );
contentPane.Add( grabCornerLayer );
Stage stage = Stage::GetCurrent();
Popup popup= Popup::New();
- popup.SetName("ResetPopup");
+ popup.SetProperty( Dali::Actor::Property::NAME,"ResetPopup");
popup.SetStyleName("ResetPopup");
- popup.SetParentOrigin( ParentOrigin::CENTER );
- popup.SetAnchorPoint( AnchorPoint::CENTER );
+ popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
popup.SetSize( stage.GetSize().width * 0.75f, 0.0f );
popup.SetProperty( Popup::Property::TAIL_VISIBILITY, false );
popup.OutsideTouchedSignal().Connect( this, &StylingApplication::HidePopup );
popup.SetTitle( CreateTitle( "Reset channels" ) );
TextLabel text = TextLabel::New( "This will reset the channel data to full value. Are you sure?" );
- text.SetName( "PopupContentText" );
+ text.SetProperty( Dali::Actor::Property::NAME, "PopupContentText" );
text.SetStyleName( "PopupBody" );
text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
popup.SetContent( text );
ImageView footer = ImageView::New( DEFAULT_CONTROL_AREA_IMAGE_PATH );
- footer.SetName( "PopupFooter" );
+ footer.SetProperty( Dali::Actor::Property::NAME, "PopupFooter" );
footer.SetStyleName( "PopupFooter" );
footer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
footer.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
footer.SetSize( 0.0f, 80.0f );
- footer.SetAnchorPoint( AnchorPoint::CENTER );
- footer.SetParentOrigin( ParentOrigin::CENTER );
+ footer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ footer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
TableView footerLayout = TableView::New( 1, 2 );
- footerLayout.SetParentOrigin( ParentOrigin::CENTER );
- footerLayout.SetAnchorPoint ( AnchorPoint::CENTER );
+ footerLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ footerLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
footerLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
PushButton okayButton = PushButton::New();
- okayButton.SetName( POPUP_CONTROL_OK_NAME );
+ okayButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_OK_NAME );
okayButton.SetStyleName( POPUP_CONTROL_OK_NAME );
okayButton.SetProperty( Toolkit::Button::Property::LABEL, "Ok!" );
okayButton.ClickedSignal().Connect( this, &StylingApplication::OnReset );
- okayButton.SetParentOrigin( ParentOrigin::CENTER );
- okayButton.SetAnchorPoint( AnchorPoint::CENTER );
+ okayButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ okayButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
okayButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
okayButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0f ) );
PushButton cancelButton = PushButton::New();
- cancelButton.SetName( POPUP_CONTROL_CANCEL_NAME );
+ cancelButton.SetProperty( Dali::Actor::Property::NAME, POPUP_CONTROL_CANCEL_NAME );
cancelButton.SetStyleName( POPUP_CONTROL_CANCEL_NAME );
cancelButton.SetProperty( Toolkit::Button::Property::LABEL, "Cancel" );
cancelButton.ClickedSignal().Connect( this, &StylingApplication::OnResetCancelled );
- cancelButton.SetParentOrigin( ParentOrigin::CENTER );
- cancelButton.SetAnchorPoint( AnchorPoint::CENTER );
+ cancelButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ cancelButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
cancelButton.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
cancelButton.SetSizeModeFactor( Vector3( -20.0f, -20.0f, 0.0f ) );
TextLabel StylingApplication::CreateTitle( std::string title )
{
TextLabel titleActor = TextLabel::New( title );
- titleActor.SetName( "titleActor" );
+ titleActor.SetProperty( Dali::Actor::Property::NAME, "titleActor" );
titleActor.SetStyleName( "PopupTitle" );
titleActor.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
titleActor.SetProperty( TextLabel::Property::MULTI_LINE, false );
stage.KeyEventSignal().Connect( this, &SuperBlurViewExample::OnKeyEvent );
mSuperBlurView = SuperBlurView::New( DEFAULT_BLUR_LEVEL );
- mSuperBlurView.SetParentOrigin( ParentOrigin::CENTER );
- mSuperBlurView.SetAnchorPoint( AnchorPoint::CENTER );
+ mSuperBlurView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mSuperBlurView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mSuperBlurView.SetSize( 800, 1280 );
mSuperBlurView.SetProperty( SuperBlurView::Property::IMAGE_URL, BACKGROUND_IMAGE );
stage.Add( mSuperBlurView );
mClearAnimation.AnimateTo( Property(mSuperBlurView, mSuperBlurView.GetBlurStrengthPropertyIndex()), 0.0f );
mPushButton = PushButton::New();
- mPushButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mPushButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mPushButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mPushButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mPushButton.SetProperty( Button::Property::LABEL, "Blur" );
mPushButton.PressedSignal().Connect( this, &SuperBlurViewExample::OnButtonPressed );
mPushButton.ReleasedSignal().Connect( this, &SuperBlurViewExample::OnButtonReleased );
mColorContainer.SetSizeModeFactor( Vector3( 0.0f, BUTTON_PERCENTAGE, 0.0f ) );
// Place to right of parent.
- mColorContainer.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
- mColorContainer.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+ mColorContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_RIGHT );
+ mColorContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT );
colorLabel.Add( mColorContainer );
// Add border to highlight harder-to-see colors.
mColorButtonOption = Toolkit::PushButton::New();
mColorButtonOption.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mColorButtonOption.SetSizeModeFactor( Vector3( 0.9f, 0.9f, 0.0f ) ); // Smaller than container to show border.
- mColorButtonOption.SetParentOrigin( ParentOrigin::CENTER );
- mColorButtonOption.SetAnchorPoint( AnchorPoint::CENTER );
+ mColorButtonOption.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mColorButtonOption.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
SetButtonColor( mColorButtonOption, Color::BLACK );
// Create the text editor.
mEditor = TextEditor::New();
- mEditor.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mEditor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mEditor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mEditor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mEditor.SetPosition( 0.f, toolBarHeight * 2.0f, 0.f );
mEditor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mEditor.SetSizeModeFactor( TEXT_EDITOR_RELATIVE_SIZE );
mButtonContainer.SetSizeModeFactor( Vector3( 1.0f, NUMBER_OF_COLORS, 1.0f ) );
// Place below color selection button.
- mButtonContainer.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mButtonContainer.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mButtonContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mButtonContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
mButtonContainer.SetPosition( 0.0f, 2.f * TOOLBAR_PADDING, 0.f );
mColorContainer.Add( mButtonContainer );
std::ostringstream s;
s << "color" << index;
- button.SetName( s.str() );
+ button.SetProperty( Dali::Actor::Property::NAME, s.str() );
SetButtonColor( button, COLORS[index] );
CreateButtonContainer();
}
- mButtonContainer.SetVisible( true );
- mButtonContainer.SetSensitive( true );
+ mButtonContainer.SetProperty( Actor::Property::VISIBLE, true );
+ mButtonContainer.SetProperty( Actor::Property::SENSITIVE, true );
return true;
}
bool OnColorButtonClicked( Button button )
{
- const std::string& name = button.GetName();
+ const std::string& name = button.GetProperty< std::string >( Dali::Actor::Property::NAME );
Vector4 color;
if( "color" == name.substr( 0u, 5u ) )
SetButtonColor( mColorButtonOption, color );
- mButtonContainer.SetVisible( false );
- mButtonContainer.SetSensitive( false );
+ mButtonContainer.SetProperty( Actor::Property::VISIBLE, false );
+ mButtonContainer.SetProperty( Actor::Property::SENSITIVE, false );
return true;
}
PushButton button = PushButton::New();
button.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, FOLDER_ICON_IMAGE );
button.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, FOLDER_OPEN_ICON_IMAGE );
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
return button;
}
TextField CreateTextField( const Vector2& stageSize, const std::string& text )
{
TextField field = TextField::New();
- field.SetName("textField");
- field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ field.SetProperty( Dali::Actor::Property::NAME,"textField");
+ field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
field.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
field.SetProperty( TextField::Property::TEXT, text );
Popup CreatePopup()
{
Popup popup = Popup::New();
- popup.SetParentOrigin( ParentOrigin::CENTER );
- popup.SetAnchorPoint( AnchorPoint::CENTER );
+ popup.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ popup.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH );
popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched );
void CreateTextLabel( TextLabel& textLabel, std::string textString, const Vector4& color, bool infoLabel=false )
{
textLabel = TextLabel::New( textString );
- textLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
textLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
{
container = Control::New();
container.SetSize( size );
- container.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ container.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
container.SetDrawMode( DrawMode::OVERLAY_2D );
}
void CreateFolderButton( PushButton& button )
{
button = PushButton::New();
- button.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
button.SetSize( 50.0f, 50.0f );
}
stage.Add( mContainer4 );
// Info
CreateContainer ( mContainer4Info , mLayoutSize );
- mContainer4Info.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ mContainer4Info.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
mContainer4.Add( mContainer4Info );
CreateTextLabel ( mLabel4Info, "system free", Color::BLACK, true );
mContainer4Info.Add ( mLabel4Info );
stage.KeyEventSignal().Connect(this, &TextFontsExample::OnKeyEvent);
CreateFolderButton ( mButton );
- mButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ mButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
mButton.ClickedSignal().Connect( this, &TextFontsExample::OnButtonClicked );
stage.Add( mButton );
CreateContainer ( mContainerInfo , mLayoutSize );
CreateContainer ( mContainer2Info , mLayoutSize );
CreateContainer ( mContainer3Info , mLayoutSize );
- mContainerInfo.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- mContainer2Info.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- mContainer3Info.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+ mContainerInfo.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ mContainer2Info.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ mContainer3Info.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
mContainer.Add( mContainerInfo );
mContainer2.Add( mContainer2Info );
mContainer3.Add( mContainer3Info );
mTableView = Toolkit::TableView::New( NUMBER_OF_EMOJIS, 1 );
mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mTableView.TouchSignal().Connect( this, &EmojiExample::OnTouch );
stage.Add( mTableView );
const std::string text = emoji.mUTF8 + " " + emoji.mDescription;
TextLabel label = TextLabel::New( text );
- label.SetParentOrigin( ParentOrigin::TOP_CENTER );
- label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
label.SetProperty( TextLabel::Property::MULTI_LINE, true );
mTableView.SetFitHeight( index );
mTableView = Toolkit::TableView::New( NUMBER_OF_LANGUAGES, 1 );
mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
- mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mTableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mTableView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mTableView.TouchSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouch );
stage.Add( mTableView );
mButtonSize = Size( mStageSize.height * 0.1, mStageSize.height * 0.1 ); // Button size 1/10 of stage height
mContainer = Control::New();
- mContainer.SetName( "Container" );
- mContainer.SetParentOrigin( ParentOrigin::CENTER );
+ mContainer.SetProperty( Dali::Actor::Property::NAME, "Container" );
+ mContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mLayoutSize = Vector2(mStageSize.width*0.6f, mStageSize.width*0.6f);
mContainer.SetSize( mLayoutSize );
stage.Add( mContainer );
// Resize the center layout when the corner is grabbed
mGrabCorner = ImageView::New( BACKGROUND_IMAGE );
- mGrabCorner.SetName( "GrabCorner" );
- mGrabCorner.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
+ mGrabCorner.SetProperty( Dali::Actor::Property::NAME, "GrabCorner" );
+ mGrabCorner.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ mGrabCorner.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_RIGHT );
mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mContainer.Add( mGrabCorner );
mLabel = TextLabel::New( "\xF0\x9F\x98\x89 A Quick Brown Fox Jumps Over The Lazy Dog" );
- mLabel.SetName( "TextLabel" );
- mLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mLabel.SetProperty( Dali::Actor::Property::NAME, "TextLabel" );
+ mLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mLabel.SetSize(mLayoutSize);
mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
mLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::GREEN );
// Add a border for the container so you can see the container is being resized while grabbing the handle.
mBorder = Control::New();
- mBorder.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mBorder.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mBorder.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mBorder.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
border.Insert( BorderVisual::Property::SIZE, 3.f );
mBorder.SetProperty( Control::Property::BACKGROUND, border );
mContainer.Add( mBorder );
- mBorder.SetVisible(false);
+ mBorder.SetProperty( Actor::Property::VISIBLE,false);
mGrabCorner.RaiseToTop();
mHueAngleIndex = mLabel.RegisterProperty( "hue", 0.0f );
// Use a white button with 50% transparency as a clear color button
if ( Color::WHITE == AVAILABLE_COLORS[ index ] && styleButtonIndex != StyleType::TEXT_COLOR )
{
- mColorButtons[index].SetOpacity(0.5f);
+ mColorButtons[index].SetProperty( DevelActor::Property::OPACITY,0.5f);
mColorButtons[index].SetProperty( Toolkit::Button::Property::LABEL,
Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
}
// Only show the border during the panning
- mBorder.SetVisible(true);
+ mBorder.SetProperty( Actor::Property::VISIBLE,true);
HideStyleAndColorButtons();
}
{
// Resize the text label to match the container size when panning is finished
mLabel.SetSize(mLayoutSize);
- mBorder.SetVisible(false);
+ mBorder.SetProperty( Actor::Property::VISIBLE,false);
}
}
TextLabel SetupTextLabel( int type )
{
TextLabel label = TextLabel::New();
- label.SetAnchorPoint( ParentOrigin::TOP_LEFT );
- label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLACK );
label.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f );
Property::Map shadowMap;
// Create an item view for the main menu
mItemView = ItemView::New( *this );
- mItemView.SetParentOrigin( ParentOrigin::CENTER );
- mItemView.SetAnchorPoint( AnchorPoint::CENTER );
+ mItemView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
mLayout->SetItemSize( Vector3( stageSize.width, 60.0f, 0.0f ) );
mLayer.Remove( mLayer.GetChildAt( 0 ) );
}
- mLayer.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mLayer.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mLayer.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::HEIGHT );
mLayer.SetSizeModeFactor( Vector3( 0.0f, -DemoHelper::DEFAULT_VIEW_STYLE.mToolBarHeight, 0.0f ) );
mLayer = Layer::New();
mIndicator = Toolkit::ImageView::New(INDICATOR_IMAGE);
- mIndicator.SetParentOrigin( ParentOrigin::CENTER );
- mIndicator.SetAnchorPoint( AnchorPoint::CENTER );
+ mIndicator.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mIndicator.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mIndicator.SetProperty( Actor::Property::VISIBLE, false );
// Create a back button in the left of toolbar
backButton.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, BACK_IMAGE );
backButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, BACK_IMAGE_SELECTED );
backButton.ClickedSignal().Connect( this, &TextMemoryProfilingExample::OnBackButtonPressed );
- backButton.SetLeaveRequired( true );
+ backButton.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Create a navigation view to navigate different types of text labels
mNavigationView = NavigationView::New();
mNavigationView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mNavigationView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mNavigationView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mNavigationView.SetBackgroundColor( Color::WHITE );
stage.Add( mNavigationView );
mLabels[0] = TextLabel::New("Text Label 1");
mLabels[1] = TextLabel::New("Text Label 2");
- mLabels[0].SetName("Label1");
- mLabels[1].SetName("Label2");
+ mLabels[0].SetProperty( Dali::Actor::Property::NAME,"Label1");
+ mLabels[1].SetProperty( Dali::Actor::Property::NAME,"Label2");
mLabels[0].SetProperty( DevelActor::Property::SIBLING_ORDER, 1 );
mLabels[1].SetProperty( DevelActor::Property::SIBLING_ORDER, 2 );
for(int i=0; i<NUMBER_OF_LABELS; ++i )
{
mLabels[i].SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
- mLabels[i].SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mLabels[i].SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mLabels[i].SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ mLabels[i].SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
mLabels[i].SetPosition( 0, (i*2+1) * stageSize.height * 0.25f );
}
mSwapButton = PushButton::New();
mSwapButton.SetProperty( Button::Property::LABEL, "Swap depth order");
- mSwapButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mSwapButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mSwapButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mSwapButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mSwapButton.ClickedSignal().Connect( this, &TextOverlapController::OnClicked );
mSwapButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mSwapButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
Layer rootLayer = stage.GetRootLayer();
- rootLayer.SetName("RootLayer");
+ rootLayer.SetProperty( Dali::Actor::Property::NAME,"RootLayer");
mPanDetector = PanGestureDetector::New();
mPanDetector.Attach( rootLayer );
{
for( int i=0; i<NUMBER_OF_LABELS; ++i )
{
- Vector3 position = mLabels[i].GetCurrentPosition();
- Vector3 size = mLabels[i].GetCurrentSize();
+ Vector3 position = mLabels[i].GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
+ Vector3 size = mLabels[i].GetCurrentProperty< Vector3 >( Actor::Property::SIZE );
if( gesture.position.y > position.y - size.y * 0.5f &&
gesture.position.y <= position.y + size.y * 0.5f )
{
else if( mGrabbedActor && gesture.state == PanGesture::Continuing )
{
Vector2 stageSize = Stage::GetCurrent().GetSize();
- Vector3 size = mGrabbedActor.GetCurrentSize();
+ Vector3 size = mGrabbedActor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE );
float y = Clamp( gesture.position.y, size.y * 0.5f, stageSize.y - size.y*0.5f );
mGrabbedActor.SetPosition( 0, y );
}
void CreateBox( const std::string& name, Actor& box, Actor parent, const Vector2& size )
{
- box.SetName(name);
- box.SetAnchorPoint( AnchorPoint::CENTER );
- box.SetParentOrigin( ParentOrigin::CENTER );
+ box.SetProperty( Dali::Actor::Property::NAME,name);
+ box.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ box.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
box.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
box.SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH );
box.SetSize( size.width, 0.f );
label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
label.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
label.SetPadding( Padding( 1.0f, 1.0f, 1.0f, 1.0f ) );
- label.SetAnchorPoint( AnchorPoint::CENTER );
- label.SetParentOrigin( ParentOrigin::CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
parent.Add( label );
if ( scrollOnStart )
button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
button.SetSize(BOX_SIZE.height,BOX_SIZE.height);
- button.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
parent.Add(button);
}
// Create Root actor
Actor rootActor = Actor::New();
- rootActor.SetName("rootActor");
+ rootActor.SetProperty( Dali::Actor::Property::NAME,"rootActor");
rootActor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
rootActor.SetSize( mStageSize );
- rootActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ rootActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
stage.Add( rootActor );
// Create Desktop
Control desktop = Control::New();
desktop.SetBackgroundColor( Color::WHITE );
- desktop.SetName("desktopActor");
- desktop.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ desktop.SetProperty( Dali::Actor::Property::NAME,"desktopActor");
+ desktop.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
desktop.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
desktop.SetSize( mTargetActorSize );
TextField field = TextField::New();
field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
field.SetPadding( Padding( 1.0f, 1.0f, 1.0f, 1.0f ) );
- field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ field.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Enter Folder Name" );
field.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect<int>( SCREEN_BORDER, SCREEN_BORDER, mStageSize.width - SCREEN_BORDER*2, mStageSize.height - SCREEN_BORDER*2 ) );
boxA.Add( field );
colorButton.SetProperty( Button::Property::TOGGLABLE, true );
colorButton.SetProperty( Button::Property::UNSELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::RED ) );
colorButton.SetProperty( Button::Property::SELECTED_BACKGROUND_VISUAL, Property::Map().Add ( Toolkit::Visual::Property::TYPE, Visual::COLOR ).Add( ColorVisual::Property::MIX_COLOR, Color::BLACK ) );
- colorButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- colorButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ colorButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+ colorButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
colorButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
colorButton.SetSize(BOX_SIZE.height,BOX_SIZE.height);
colorButton.ClickedSignal().Connect( this, &TextScrollingExample::OnColorButtonClicked );
{
Toolkit::RadioButton alignButton = Toolkit::RadioButton::New( ALIGNMENT_TABLE[ i ] );
alignButton.ClickedSignal().Connect( this, &TextScrollingExample::OnAlignButtonClicked );
- alignButton.SetName( ALIGNMENT_TABLE[ i ] );
+ alignButton.SetProperty( Dali::Actor::Property::NAME, ALIGNMENT_TABLE[ i ] );
// Place first button to left aligned, second center aligned and third right aligned
- alignButton.SetAnchorPoint( Vector3( i * 0.5f, 0.0f, 0.5f ) );
- alignButton.SetParentOrigin( Vector3( i * 0.5f, 0.0f, 0.5f ) );
+ alignButton.SetProperty( Actor::Property::ANCHOR_POINT, Vector3( i * 0.5f, 0.0f, 0.5f ) );
+ alignButton.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( i * 0.5f, 0.0f, 0.5f ) );
rootActor.Add( alignButton );
{
for( unsigned int index = 0; index < ALIGNMENT_TABLE_COUNT; ++index )
{
- const std::string& buttonName = button.GetName();
+ const std::string& buttonName = button.GetProperty< std::string >( Dali::Actor::Property::NAME );
if( buttonName == ALIGNMENT_TABLE[ index ] )
{
mSmallLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, ALIGNMENT_TABLE[ index ] );
Property::Index fadeColorIndex = mRenderer.RegisterProperty( "uFadeColor", Color::MAGENTA );
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- mMeshActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
- mMeshActor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ mMeshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
stage.Add( mMeshActor );
mRenderer2 = Renderer::New( mGeometry, mShader );
Property::Index fadeColorIndex2 = mRenderer2.RegisterProperty( "uFadeColor", Color::BLUE );
mRenderer2.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- mMeshActor2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mMeshActor2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mMeshActor2.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mMeshActor2.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
stage.Add( mMeshActor2 );
Animation animation = Animation::New(5);
stage.SetBackgroundColor( Color::BLUE);
mTextLabel = TextLabel::New( "Tilt Sensor Demo" );
- mTextLabel.SetParentOrigin( ParentOrigin::CENTER );
- mTextLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ mTextLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mTextLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mTextLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
mTextLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
mTextLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE );
mTextLabel.SetProperty( TextLabel::Property::POINT_SIZE, 15.0f );
- mTextLabel.SetName( "tiltLabel" );
+ mTextLabel.SetProperty( Dali::Actor::Property::NAME, "tiltLabel" );
stage.Add( mTextLabel );
// Respond to a click anywhere on the stage
// Add a text label at the top for information purposes
Control label = TextLabel::New( "Hover over buttons to see tooltip" );
- label.SetParentOrigin( ParentOrigin::TOP_CENTER );
- label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "Center" );
stage.Add( label );
previousPosition += POSITION_INCREMENTER;
control.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
control.SetSizeModeFactor( Vector3( 0.75, 0.1, 1.0 ) );
- control.SetAnchorPoint( AnchorPoint::CENTER );
- control.SetParentOrigin( ParentOrigin::TOP_CENTER );
+ control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
control.SetY( stageSize.height * previousPosition );
}
}
// Content panes:
TableView contentLayout = TableView::New( 3, 1 );
- contentLayout.SetName("ContentLayout");
+ contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout");
contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- contentLayout.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- contentLayout.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
contentLayout.SetCellPadding( Vector2( 0.0f, 5.0f ) );
contentLayout.SetBackgroundColor( Vector4(0.949, 0.949, 0.949, 1.0) );
// Assign all rows the size negotiation property of fitting to children
stage.Add( contentLayout );
mTitle = TextLabel::New( "Custom Control Transition Example" );
- mTitle.SetName( "Title" );
+ mTitle.SetProperty( Dali::Actor::Property::NAME, "Title" );
mTitle.SetStyleName("Title");
mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
contentLayout.Add( buttonLayout );
mShadowButton = ShadowButton::New();
- mShadowButton.SetName("ShadowButton");
+ mShadowButton.SetProperty( Dali::Actor::Property::NAME,"ShadowButton");
mShadowButton.SetActiveState( false );
- mShadowButton.SetAnchorPoint( AnchorPoint::CENTER );
- mShadowButton.SetParentOrigin( ParentOrigin::CENTER );
+ mShadowButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mShadowButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mShadowButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mShadowButton.SetProperty( DevelControl::Property::STATE, DevelControl::DISABLED );
mShadowButton.SetProperty( DevelControl::Property::SUB_STATE, "UNCHECKED" );
buttonLayout.AddChild( mShadowButton, TableView::CellPosition(1, 1) );
TableView actionButtonLayout = TableView::New( 1, NUMBER_OF_ACTION_BUTTONS+1 );
- actionButtonLayout.SetName("ThemeButtonsLayout");
+ actionButtonLayout.SetProperty( Dali::Actor::Property::NAME,"ThemeButtonsLayout");
actionButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
actionButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
actionButtonLayout.SetFitHeight( 0 );
for( int i=0; i<NUMBER_OF_ACTION_BUTTONS; ++i )
{
mActionButtons[i] = PushButton::New();
- mActionButtons[i].SetName("ActionButton");
+ mActionButtons[i].SetProperty( Dali::Actor::Property::NAME,"ActionButton");
mActionButtons[i].SetStyleName("ActionButton");
mActionButtons[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mActionButtons[i].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mVideoView = Toolkit::VideoView::New();
Stage::GetCurrent().Add( mVideoView );
- mVideoView.SetParentOrigin( ParentOrigin::CENTER );
- mVideoView.SetAnchorPoint( AnchorPoint::CENTER );
+ mVideoView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mVideoView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mVideoView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mVideoView.SetSize( INIT_WIDTH, INIT_HEIGHT );
mVideoView.SetProperty( VideoView::Property::LOOPING, true );
mVideoView.SetProperty( VideoView::Property::VIDEO, PLAY_FILE );
mMenu = Layer::New();
- mMenu.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
- mMenu.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+ mMenu.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
+ mMenu.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT );
mMenu.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
mMenu.SetSize( INIT_WIDTH, 120 );
mVideoView.Add( mMenu );
mPlayButton = PushButton::New();
- mPlayButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mPlayButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mPlayButton.SetName( "Play" );
+ mPlayButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mPlayButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ mPlayButton.SetProperty( Dali::Actor::Property::NAME, "Play" );
mPlayButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
mPlayButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
mPlayButton.SetPosition( 40, 10 );
mPlayButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
mPauseButton = PushButton::New();
- mPauseButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mPauseButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mPauseButton.SetName( "Pause" );
+ mPauseButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mPauseButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ mPauseButton.SetProperty( Dali::Actor::Property::NAME, "Pause" );
mPauseButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
mPauseButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
mPauseButton.SetPosition( 40, 10 );
mPauseButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
mChangeButton = PushButton::New();
- mChangeButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mChangeButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mChangeButton.SetName( "Change" );
+ mChangeButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mChangeButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ mChangeButton.SetProperty( Dali::Actor::Property::NAME, "Change" );
mChangeButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
mChangeButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
mChangeButton.SetPosition( 140, 10 );
mChangeButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
mBackwardButton = PushButton::New();
- mBackwardButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mBackwardButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mBackwardButton.SetName( "Backward" );
+ mBackwardButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mBackwardButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ mBackwardButton.SetProperty( Dali::Actor::Property::NAME, "Backward" );
mBackwardButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
mBackwardButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
mBackwardButton.SetPosition( 240, 10 );
mBackwardButton.ClickedSignal().Connect( this, &VideoViewController::OnButtonClicked );
mForwardButton = PushButton::New();
- mForwardButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mForwardButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mForwardButton.SetName( "Forward" );
+ mForwardButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ mForwardButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ mForwardButton.SetProperty( Dali::Actor::Property::NAME, "Forward" );
mForwardButton.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
mForwardButton.SetSize( BUTTON_SIZE, BUTTON_SIZE );
mForwardButton.SetPosition( 340, 10 );
mMenu.Add( mBackwardButton );
mMenu.Add( mForwardButton );
- mPauseButton.SetVisible( false );
+ mPauseButton.SetProperty( Actor::Property::VISIBLE, false );
mPauseButton.SetProperty( Button::Property::DISABLED, true );
- mPlayButton.SetVisible( true );
+ mPlayButton.SetProperty( Actor::Property::VISIBLE, true );
mPlayButton.SetProperty( Button::Property::DISABLED, false );
- mChangeButton.SetVisible( true );
+ mChangeButton.SetProperty( Actor::Property::VISIBLE, true );
mChangeButton.SetProperty( Button::Property::DISABLED, false );
mPlayButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_IMAGE );
{
if( mIsPlay )
{
- mPauseButton.SetVisible( false );
+ mPauseButton.SetProperty( Actor::Property::VISIBLE, false );
mPauseButton.SetProperty( Button::Property::DISABLED, true );
- mPlayButton.SetVisible( true );
+ mPlayButton.SetProperty( Actor::Property::VISIBLE, true );
mPlayButton.SetProperty( Button::Property::DISABLED, false );
mIsPlay = false;
}
else if( mPlayButton.GetId() == button.GetId())
{
- mPauseButton.SetVisible( true );
+ mPauseButton.SetProperty( Actor::Property::VISIBLE, true );
mPauseButton.SetProperty( Button::Property::DISABLED, false );
- mPlayButton.SetVisible( false );
+ mPlayButton.SetProperty( Actor::Property::VISIBLE, false );
mPlayButton.SetProperty( Button::Property::DISABLED, true );
mIsPlay = true;
// Content panes:
TableView contentLayout = TableView::New( 4, 1 );
- contentLayout.SetName("ContentLayout");
+ contentLayout.SetProperty( Dali::Actor::Property::NAME,"ContentLayout");
contentLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- contentLayout.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- contentLayout.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ contentLayout.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ contentLayout.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
contentLayout.SetCellPadding( Vector2( 0.0f, 5.0f ) );
// Assign all rows the size negotiation property of fitting to children
stage.Add( contentLayout );
mTitle = TextLabel::New( "Custom Control Transition Example" );
- mTitle.SetName( "Title" );
+ mTitle.SetProperty( Dali::Actor::Property::NAME, "Title" );
mTitle.SetStyleName("Title");
mTitle.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mTitle.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
contentLayout.SetFitHeight(0); // Fill width
mBeatControl = BeatControl::New();
- mBeatControl.SetName("BeatControl");
+ mBeatControl.SetProperty( Dali::Actor::Property::NAME,"BeatControl");
mBeatControl.SetProperty( BeatControl::Property::BEAT_VISUAL, Property::Map()
.Add( Visual::Property::TRANSFORM, Property::Map()
.Add( Visual::Transform::Property::SIZE, Vector2(0.5f, 0.5f) ) ) );
- mBeatControl.SetAnchorPoint( AnchorPoint::CENTER );
- mBeatControl.SetParentOrigin( ParentOrigin::CENTER );
+ mBeatControl.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mBeatControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mBeatControl.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
contentLayout.Add( mBeatControl );
// beat control should fill the tableview cell, so no change to default parameters
TableView visualTypeLayout = TableView::New( 1, NUMBER_OF_VISUAL_BUTTONS );
- visualTypeLayout.SetName("VisualTypeLayout");
+ visualTypeLayout.SetProperty( Dali::Actor::Property::NAME,"VisualTypeLayout");
visualTypeLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
visualTypeLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
visualTypeLayout.SetFitHeight( 0 );
.Add( Visual::Transform::Property::SIZE, Vector2(0.8f, 0.8f) ) );
mVisualButtons[i] = BeatControl::New();
mVisualButtons[i].SetProperty( BeatControl::Property::BEAT_VISUAL, map );
- mVisualButtons[i].SetName("VisualButton");
+ mVisualButtons[i].SetProperty( Dali::Actor::Property::NAME,"VisualButton");
mVisualButtons[i].SetStyleName("VisualButton");
mVisualButtons[i].SetSize(0, 50);
mVisualButtons[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
}
TableView actionButtonLayout = TableView::New( 1, NUMBER_OF_ACTION_BUTTONS+1 );
- actionButtonLayout.SetName("ThemeButtonsLayout");
+ actionButtonLayout.SetProperty( Dali::Actor::Property::NAME,"ThemeButtonsLayout");
actionButtonLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
actionButtonLayout.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
actionButtonLayout.SetFitHeight( 0 );
for( int i=0; i<NUMBER_OF_ACTION_BUTTONS; ++i )
{
mActionButtons[i] = PushButton::New();
- mActionButtons[i].SetName("ActionButton");
+ mActionButtons[i].SetProperty( Dali::Actor::Property::NAME,"ActionButton");
mActionButtons[i].SetStyleName("ActionButton");
mActionButtons[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mActionButtons[i].SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
float fontSize = width * 0.02f;
mWebView = Toolkit::WebView::New( "ko-KR", "Asia/Seoul" );
- mWebView.SetParentOrigin( Dali::ParentOrigin::CENTER );
- mWebView.SetAnchorPoint( Dali::AnchorPoint::CENTER );
+ mWebView.SetProperty( Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
+ mWebView.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
mWebView.SetPosition( 0, 0 );
mWebView.SetSize( width, height );
mWebView.PageLoadStartedSignal().Connect( this, &WebViewController::OnPageLoadStarted );
stage.Add(mWebView);
mAddressLabel = Toolkit::TextLabel::New( url );
- mAddressLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ mAddressLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mAddressLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, fontSize );
mAddressLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
mAddressLabel.SetBackgroundColor( Vector4( 0, 0, 0, 0.5f ) );
// EXTERNAL INCLUDES
#include <algorithm>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/images/distance-field.h>
#include <dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h>
#include <dali-toolkit/devel-api/shader-effects/distance-field-effect.h>
Control background = Control::New();
Stage::GetCurrent().Add( background );
background.SetStyleName( stylename );
- background.SetName( "BACKGROUND" );
- background.SetAnchorPoint( AnchorPoint::CENTER );
- background.SetParentOrigin( ParentOrigin::CENTER );
+ background.SetProperty( Actor::Property::NAME, "BACKGROUND" );
+ background.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ background.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
return background;
}
// Add logo
ImageView logo = ImageView::New( LOGO_PATH );
- logo.SetName( "LOGO_IMAGE" );
- logo.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- logo.SetParentOrigin( Vector3( 0.5f, 0.1f, 0.5f ) );
+ logo.SetProperty( Actor::Property::NAME, "LOGO_IMAGE" );
+ logo.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ logo.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 0.1f, 0.5f ) );
logo.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
// The logo should appear on top of everything.
logo.SetDrawMode( DrawMode::OVERLAY_2D );
// Scrollview occupying the majority of the screen
mScrollView = ScrollView::New();
- mScrollView.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- mScrollView.SetParentOrigin( Vector3( 0.5f, 1.0f - 0.05f, 0.5f ) );
+ mScrollView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+ mScrollView.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 1.0f - 0.05f, 0.5f ) );
mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
mScrollView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
mScrollView.SetSizeModeFactor( Vector3( 0.0f, 0.6f, 0.0f ) );
// Populate background and bubbles - needs to be scrollViewLayer so scroll ends show
Actor bubbleContainer = Actor::New();
bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER );
- bubbleContainer.SetParentOrigin( ParentOrigin::CENTER );
+ bubbleContainer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ bubbleContainer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
SetupBackground( bubbleContainer );
mRootActor.Add( bubbleContainer );
{
mFocusEffect[i].actor = ImageView::New();
mFocusEffect[i].actor.SetStyleName( "FocusActor" );
- mFocusEffect[i].actor.SetParentOrigin( ParentOrigin::CENTER );
+ mFocusEffect[i].actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mFocusEffect[i].actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mFocusEffect[i].actor.SetInheritScale( false );
+ mFocusEffect[i].actor.SetProperty( Actor::Property::INHERIT_SCALE, false );
mFocusEffect[i].actor.SetColorMode( USE_OWN_COLOR );
KeyFrames alphaKeyFrames = KeyFrames::New();
{
// Create Table
TableView page = TableView::New( ROWS_PER_PAGE, EXAMPLES_PER_ROW );
- page.SetAnchorPoint( AnchorPoint::CENTER );
- page.SetParentOrigin( ParentOrigin::CENTER );
+ page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mScrollView.Add( page );
Toolkit::ImageView focusableTile = ImageView::New();
focusableTile.SetStyleName( "DemoTile" );
- focusableTile.SetParentOrigin( ParentOrigin::CENTER );
+ focusableTile.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
focusableTile.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
focusableTile.SetSizeModeFactor( sizeMultiplier );
- focusableTile.SetName( name );
+ focusableTile.SetProperty( Actor::Property::NAME, name );
// Set the tile to be keyboard focusable
focusableTile.SetKeyboardFocusable( true );
// Create an ImageView for the 9-patch border around the tile.
ImageView borderImage = ImageView::New();
borderImage.SetStyleName("DemoTileBorder");
- borderImage.SetAnchorPoint( AnchorPoint::CENTER );
- borderImage.SetParentOrigin( ParentOrigin::CENTER );
+ borderImage.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ borderImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
borderImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- borderImage.SetOpacity( 0.8f );
+ borderImage.SetProperty( DevelActor::Property::OPACITY, 0.8f );
focusableTile.Add( borderImage );
TextLabel label = TextLabel::New();
- label.SetAnchorPoint( AnchorPoint::CENTER );
- label.SetParentOrigin( ParentOrigin::CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
label.SetStyleName( "LauncherLabel" );
label.SetProperty( TextLabel::Property::MULTI_LINE, true );
label.SetProperty( TextLabel::Property::TEXT, title );
// ignore Example button presses when scrolling or button animating.
if( ( !mScrolling ) && ( !mPressedAnimation ) )
{
- std::string name = actor.GetName();
+ std::string name = actor.GetProperty< std::string >( Dali::Actor::Property::NAME );
const ExampleListIter end = mExampleList.end();
for( ExampleListIter iter = mExampleList.begin(); iter != end; ++iter )
{
mPressedAnimation.Reset();
if( mPressedActor )
{
- std::string name = mPressedActor.GetName();
+ std::string name = mPressedActor.GetProperty< std::string >( Dali::Actor::Property::NAME );
ExecuteProcess( name, mApplication );
ImageView dfActor = ImageView::New();
dfActor.SetSize( Vector2( randSize, randSize ) );
- dfActor.SetParentOrigin( ParentOrigin::CENTER );
+ dfActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// Set the Image URL and the custom shader at the same time
Dali::Property::Map effect = Toolkit::CreateDistanceFieldEffect();
mVersionPopup = Dali::Toolkit::Popup::New();
Toolkit::TextLabel titleActor = Toolkit::TextLabel::New( "Version information" );
- titleActor.SetName( "titleActor" );
+ titleActor.SetProperty( Actor::Property::NAME, "titleActor" );
titleActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::CENTER );
titleActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
Toolkit::TextLabel contentActor = Toolkit::TextLabel::New( stream.str() );
- contentActor.SetName( "contentActor" );
+ contentActor.SetProperty( Actor::Property::NAME, "contentActor" );
contentActor.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
contentActor.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::CENTER );
contentActor.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE );
Dali::Stage stage = Dali::Stage::GetCurrent();
Dali::Layer toolBarLayer = Dali::Layer::New();
- toolBarLayer.SetName( "TOOLBAR_LAYER" );
- toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
- toolBarLayer.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
+ toolBarLayer.SetProperty( Dali::Actor::Property::NAME, "TOOLBAR_LAYER" );
+ toolBarLayer.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_CENTER );
+ toolBarLayer.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::TOP_CENTER );
toolBarLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::WIDTH );
toolBarLayer.SetSize( 0.0f, style.mToolBarHeight );
// Tool bar
toolBar = Dali::Toolkit::ToolBar::New();
- toolBar.SetName( "TOOLBAR" );
+ toolBar.SetProperty( Dali::Actor::Property::NAME, "TOOLBAR" );
Dali::Property::Map background;
background["url"] = toolbarImagePath;
toolBar.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, background );
- toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
- toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
+ toolBar.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::TOP_CENTER );
+ toolBar.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_CENTER );
toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
// Add the tool bar to the tool bar layer.
if( !title.empty() )
{
Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New();
- label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
+ label.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::TOP_LEFT );
label.SetStyleName( "ToolbarLabel" );
label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title );
label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
// Create default View.
view = Dali::Toolkit::Control::New();
- view.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- view.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ view.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ view.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
view.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
// Add the view to the stage before setting the background.
// Create a content layer.
Dali::Layer contentLayer = Dali::Layer::New();
- contentLayer.SetAnchorPoint( Dali::AnchorPoint::CENTER );
- contentLayer.SetParentOrigin( Dali::ParentOrigin::CENTER );
+ contentLayer.SetProperty( Dali::Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
+ contentLayer.SetProperty( Dali::Actor::Property::PARENT_ORIGIN, Dali::ParentOrigin::CENTER );
contentLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
view.Add( contentLayer );
contentLayer.LowerBelow( toolBarLayer );