/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// C++ EXAMPLE
void Create( Application& application )
{
- // Get the stage handle
- Stage stage = Stage::GetCurrent();
+ // Get the window handle
+ Window window = application.GetWindow();
mImageView = ImageView::New();
// Set another property to set the image-map
Property::Map imageMap;
- imageMap[ "rendererType" ] = "image";
- imageMap[ "imageUrl" ] = IMAGE_CARDS;
- imageMap[ "width" ] = 100;
- imageMap[ "height" ] = 100;
+ imageMap[ Visual::Property::TYPE ] = Visual::IMAGE;
+ imageMap[ ImageVisual::Property::URL ] = IMAGE_CARDS;
+ imageMap[ ImageVisual::Property::DESIRED_WIDTH ] = 100;
+ imageMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 100;
mImageView.SetProperty( ImageView::Property::IMAGE, imageMap );
- // Add the image view to the stage
- stage.Add( mImageView );
+ // Add the image view to the window
+ window.Add( mImageView );
// Register a custom float property on mImageView and use it to store the number of times we are tapped
mTagPropertyIndex = mImageView.RegisterProperty( TAG_PROPERTY_NAME, 0, Property::READ_WRITE /* Event-side only, i.e. not animatable */ );
// Create text label
mTagText = Toolkit::TextLabel::New( "0" );
- mTagText.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mTagText.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mTagText.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ mTagText.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
mTagText.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE );
mTagText.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
- stage.Add( mTagText );
+ window.Add( mTagText );
}
/**
valueText << touchedCount;
mTagText.SetProperty( TextLabel::Property::TEXT, valueText.str() );
- return true; // Consumed
+ return true; // Consumed meaning any gestures will be cancelled
}
// C++ EXAMPLE END