/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include "shared/view.h"
using namespace Dali;
*/
ExampleController( Application& application )
: mApplication( application ),
- mView()
+ mView(),
+ mContentLayer(),
+ mBall(),
+ mBallStartPosition(),
+ mBallVelocity(),
+ mBallAnimation(),
+ mPaddle(),
+ mPaddleImage(),
+ mPaddleHandle(),
+ mPaddleHitMargin(),
+ mWobbleAnimation(),
+ mWobbleProperty( Property::INVALID_INDEX ),
+ mLevelContainer(),
+ mBrickImageMap(),
+ mDragAnimation(),
+ mDragActor(),
+ mRelativeDragPoint(),
+ mDestroyAnimationMap(),
+ mPaddleFullSize(),
+ mLevel( 0 ),
+ mLives( TOTAL_LIVES ),
+ mBrickCount( 0 )
+
{
// Connect to the Application's Init and orientation changed signal
mApplication.InitSignal().Connect(this, &ExampleController::Create);
*/
ImageView CreateImage(const std::string& filename)
{
- ImageView actor = ImageView::New(filename);
+ Property::Map propertyMap;
+ propertyMap.Insert(Visual::Property::TYPE, Visual::IMAGE);
+ propertyMap.Insert(ImageVisual::Property::URL, filename);
+ 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);
return actor;
void OnHitPaddle(PropertyNotification& source)
{
Actor delegate = Actor::DownCast(source.GetTarget());
- Vector3 collisionVector = delegate.GetProperty<Vector3>(source.GetTargetProperty());
+ Vector3 collisionVector = delegate.GetCurrentProperty< Vector3 >( source.GetTargetProperty() );
Vector3 ballRelativePosition(mBall.GetCurrentPosition() - mPaddle.GetCurrentPosition());
ballRelativePosition.Normalize();
void OnHitBrick(PropertyNotification& source)
{
Actor brick = Actor::DownCast(source.GetTarget());
- Vector3 collisionVector = brick.GetProperty<Vector3>(source.GetTargetProperty());
+ Vector3 collisionVector = brick.GetCurrentProperty< Vector3 >( source.GetTargetProperty() );
const float normalVelocity = fabsf(mBallVelocity.Dot(collisionVector));
mBallVelocity += collisionVector * normalVelocity * 2.0f;
int mBrickCount; ///< Total bricks on screen.
};
-void RunTest(Application& app)
-{
- ExampleController test(app);
-
- app.MainLoop();
-}
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ ExampleController test(app);
+ app.MainLoop();
return 0;
}