/*
- * Copyright (c) 2019 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.
label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
label.SetProperty( TextLabel::Property::ENABLE_MARKUP, true );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
- label.SetProperty( Actor::Property::POSITION, Vector3( Random::Range( 0.0f, stageSize.x ), Random::Range( 0.0f, stageSize.y ), 0.0f) );
+ Vector2 windowSize = mApplication.GetWindow().GetSize();
+ label.SetProperty( Actor::Property::POSITION, Vector3( Random::Range( 0.0f, windowSize.x ), Random::Range( 0.0f, windowSize.y ), 0.0f) );
switch ( type )
{
shadowMap.Insert( "offset", Vector2( 0.0f, 0.0f ) );
label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
- label.SetProperty( Actor::Property::SIZE, Vector2(stageSize.x, stageSize.y * 0.25f) ); // Set the text label in larger size
+ label.SetProperty( Actor::Property::SIZE, Vector2(windowSize.x, windowSize.y * 0.25f) ); // Set the text label in larger size
break;
}
default:
*/
void CreateMainMenu()
{
- Stage stage = Stage::GetCurrent();
- Vector2 stageSize = stage.GetSize();
+ Vector2 windowSize = mApplication.GetWindow().GetSize();
mTapDetector = TapGestureDetector::New();
mTapDetector.DetectedSignal().Connect( this, &TextMemoryProfilingExample::OnTap );
mItemView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
mLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
- mLayout->SetItemSize( Vector3( stageSize.width, 60.0f, 0.0f ) );
+ mLayout->SetItemSize( Vector3( windowSize.width, 60.0f, 0.0f ) );
mItemView.AddLayout( *mLayout );
// Activate the layout
- mItemView.ActivateLayout( 0, Vector3( stageSize ), 0.0f );
+ mItemView.ActivateLayout( 0, Vector3( windowSize ), 0.0f );
}
/**
*/
void CreateTextLabels( int type )
{
- Stage stage = Stage::GetCurrent();
-
- // Render tasks may have been setup last load so remove them
- RenderTaskList taskList = stage.GetRenderTaskList();
- if( taskList.GetTaskCount() > 1 )
- {
- typedef std::vector<RenderTask> Collection;
- typedef Collection::iterator ColIter;
- Collection tasks;
-
- for( unsigned int i = 1; i < taskList.GetTaskCount(); ++i )
- {
- tasks.push_back( taskList.GetTask(i) );
- }
-
- for( ColIter iter = tasks.begin(); iter != tasks.end(); ++iter )
- {
- taskList.RemoveTask(*iter);
- }
-
- RenderTask defaultTask = taskList.GetTask( 0 );
- defaultTask.SetSourceActor( stage.GetRootLayer() );
- defaultTask.SetTargetFrameBuffer( FrameBufferImage() );
- }
-
// Delete any existing text labels
unsigned int numChildren = mLayer.GetChildCount();
*/
void Create( Application& application )
{
- Stage stage = Stage::GetCurrent();
+ Window window = application.GetWindow();
- stage.KeyEventSignal().Connect(this, &TextMemoryProfilingExample::OnKeyEvent);
+ window.KeyEventSignal().Connect(this, &TextMemoryProfilingExample::OnKeyEvent);
Layer contents = DemoHelper::CreateView( mApplication,
mView,
mNavigationView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mNavigationView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
mNavigationView.SetBackgroundColor( Color::WHITE );
- stage.Add( mNavigationView );
+ window.Add( mNavigationView );
CreateMainMenu();
mNavigationView.Push( mItemView );
*/
void OnKeyEvent( const KeyEvent& event )
{
- if( event.state == KeyEvent::Down )
+ if( event.GetState() == KeyEvent::DOWN )
{
if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
{
*/
void ReturnToPreviousScreen()
{
- if ( mItemView.OnStage() )
+ if ( mItemView.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
// Quit the application if it is in the main menu
mApplication.Quit();