2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <dali/dali.h>
19 #include <dali-toolkit/dali-toolkit.h>
20 #include "shared/view.h"
25 using namespace Dali::Toolkit;
30 const char* APPLICATION_TITLE("Animated Shapes");
32 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER
34 attribute mediump vec3 aCoefficient;
35 uniform mediump mat4 uMvpMatrix;
36 uniform mediump vec3 uPosition[MAX_POINT_COUNT];
37 varying lowp vec2 vCoefficient;
40 int vertexId = int(aCoefficient.z);
41 gl_Position = uMvpMatrix * vec4(uPosition[vertexId], 1.0);
43 vCoefficient = aCoefficient.xy;
48 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER
50 uniform lowp vec4 uColor;
51 varying lowp vec2 vCoefficient;
54 lowp float C = (vCoefficient.x*vCoefficient.x-vCoefficient.y);
55 lowp float Cdx = dFdx(C);
56 lowp float Cdy = dFdy(C);
58 lowp float distance = float(C / sqrt(Cdx*Cdx + Cdy*Cdy));
59 lowp float alpha = 0.5 - distance;
60 gl_FragColor = vec4( uColor.rgb, uColor.a * alpha );
64 Shader CreateShader( unsigned int pointCount )
66 std::ostringstream vertexShader;
67 vertexShader << "#define MAX_POINT_COUNT "<< pointCount << "\n"<<VERTEX_SHADER;
69 std::ostringstream fragmentShader;
70 fragmentShader << "#extension GL_OES_standard_derivatives : enable "<< "\n"<<FRAGMENT_SHADER;
72 Shader shader = Shader::New( vertexShader.str(), fragmentShader.str() );
73 for( unsigned int i(0); i<pointCount; ++i )
75 std::ostringstream propertyName;
76 propertyName << "uPosition["<<i<<"]";
77 shader.RegisterProperty(propertyName.str(),Vector3(0.0f,0.0f,0.0f) );
85 // This example shows resolution independent rendering and animation of curves using the gpu.
87 class AnimatedShapesExample : public ConnectionTracker
91 AnimatedShapesExample( Application& application )
92 : mApplication( application )
94 // Connect to the Application's Init signal
95 mApplication.InitSignal().Connect( this, &AnimatedShapesExample::Create );
98 ~AnimatedShapesExample()
100 // Nothing to do here;
103 // The Init signal is received once (only) during the Application lifetime
104 void Create( Application& application )
106 // Hide the indicator bar
107 application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
109 Stage stage = Stage::GetCurrent();
111 // Creates the background gradient
112 Toolkit::Control background = Dali::Toolkit::Control::New();
113 background.SetAnchorPoint( Dali::AnchorPoint::CENTER );
114 background.SetParentOrigin( Dali::ParentOrigin::CENTER );
115 background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
116 Dali::Property::Map map;
117 map.Insert( Toolkit::Visual::Property::TYPE, Visual::GRADIENT );
118 Property::Array stopOffsets;
119 stopOffsets.PushBack( 0.0f );
120 stopOffsets.PushBack( 1.0f );
121 map.Insert( GradientVisual::Property::STOP_OFFSET, stopOffsets );
122 Property::Array stopColors;
123 stopColors.PushBack( Vector4( 0.0f,0.0f,1.0f,1.0f ) );
124 stopColors.PushBack( Vector4( 1.0f,1.0f,1.0f,1.0f ) );
125 map.Insert( GradientVisual::Property::STOP_COLOR, stopColors );
126 Vector2 halfStageSize = Stage::GetCurrent().GetSize()*0.5f;
127 map.Insert( GradientVisual::Property::START_POSITION, Vector2(0.0f,-halfStageSize.y) );
128 map.Insert( GradientVisual::Property::END_POSITION, Vector2(0.0f,halfStageSize.y) );
129 map.Insert( GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE );
130 background.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
131 stage.Add( background );
133 // Create a TextLabel for the application title.
134 Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE );
135 label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
136 label.SetParentOrigin( Vector3( 0.5f, 0.0f, 0.5f ) );
137 label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
138 label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
139 label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
142 CreateTriangleMorph(Vector3( stage.GetSize().x*0.5f, stage.GetSize().y*0.15f, 0.0f), 100.0f );
143 CreateCircleMorph( Vector3( stage.GetSize().x*0.5f, stage.GetSize().y*0.5f, 0.0f), 55.0f );
144 CreateQuadMorph( Vector3( stage.GetSize().x*0.5f, stage.GetSize().y*0.85f, 0.0f), 60.0f );
146 stage.KeyEventSignal().Connect( this, &AnimatedShapesExample::OnKeyEvent );
149 void CreateTriangleMorph( Vector3 center, float side )
151 float h = ( side *0.5f ) / 0.866f;
153 Vector3 v0 = Vector3( -h, h, 0.0f );
154 Vector3 v1 = Vector3( 0.0f, -side * 0.366f, 0.0f );
155 Vector3 v2 = Vector3( h, h, 0.0f );
157 Vector3 v3 = v0 + ( ( v1 - v0 ) * 0.5f );
158 Vector3 v4 = v1 + ( ( v2 - v1 ) * 0.5f );
159 Vector3 v5 = v2 + ( ( v0 - v2 ) * 0.5f );
161 Shader shader = CreateShader( 12 );
162 shader.SetProperty( shader.GetPropertyIndex( "uPosition[0]"), v0 );
163 shader.SetProperty( shader.GetPropertyIndex( "uPosition[1]"), v3 );
164 shader.SetProperty( shader.GetPropertyIndex( "uPosition[2]"), v1 );
166 shader.SetProperty( shader.GetPropertyIndex( "uPosition[3]"), v1 );
167 shader.SetProperty( shader.GetPropertyIndex( "uPosition[4]"), v4 );
168 shader.SetProperty( shader.GetPropertyIndex( "uPosition[5]"), v2 );
170 shader.SetProperty( shader.GetPropertyIndex( "uPosition[6]"), v2 );
171 shader.SetProperty( shader.GetPropertyIndex( "uPosition[7]"), v5 );
172 shader.SetProperty( shader.GetPropertyIndex( "uPosition[8]"), v0 );
174 shader.SetProperty( shader.GetPropertyIndex( "uPosition[9]"), v0 );
175 shader.SetProperty( shader.GetPropertyIndex( "uPosition[10]"), v1 );
176 shader.SetProperty( shader.GetPropertyIndex( "uPosition[11]"), v2 );
180 static const Vector3 vertexData[] = { Dali::Vector3( 0.0f, 0.0f, 0.0f ),
181 Dali::Vector3( 0.5f, 0.0f, 1.0f ),
182 Dali::Vector3( 1.0f, 1.0f, 2.0f ),
184 Dali::Vector3( 0.0f, 0.0f, 3.0f ),
185 Dali::Vector3( 0.5f, 0.0f, 4.0f ),
186 Dali::Vector3( 1.0f, 1.0f, 5.0f ),
188 Dali::Vector3( 0.0f, 0.0f, 6.0f ),
189 Dali::Vector3( 0.5f, 0.0f, 7.0f ),
190 Dali::Vector3( 1.0f, 1.0f, 8.0f ),
192 Dali::Vector3( 0.0f, 1.0f, 9.0f ),
193 Dali::Vector3( 0.0f, 1.0f, 10.0f ),
194 Dali::Vector3( 0.0f, 1.0f, 11.0f )
197 unsigned short indexData[] = { 0, 2, 1, 3, 5, 4, 6, 8, 7, 9, 11, 10 };
199 //Create a vertex buffer for vertex positions and texture coordinates
200 Dali::Property::Map vertexFormat;
201 vertexFormat["aCoefficient"] = Dali::Property::VECTOR3;
202 Dali::PropertyBuffer vertexBuffer = Dali::PropertyBuffer::New( vertexFormat );
203 vertexBuffer.SetData( vertexData, sizeof(vertexData)/sizeof(vertexData[0]));
205 //Create the geometry
206 Dali::Geometry geometry = Dali::Geometry::New();
207 geometry.AddVertexBuffer( vertexBuffer );
208 geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
210 Renderer renderer = Renderer::New( geometry, shader );
211 renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
213 Actor actor = Actor::New();
214 actor.SetSize( 400.0f, 400.0f );
215 actor.SetPosition( center );
216 actor.SetAnchorPoint( AnchorPoint::CENTER );
217 actor.SetColor(Vector4(1.0f,1.0f,0.0f,1.0f) );
218 actor.AddRenderer( renderer );
220 Stage stage = Stage::GetCurrent();
224 Animation animation = Animation::New(5.0f);
225 KeyFrames k0 = KeyFrames::New();
227 k0.Add( 0.5f, v3 + Vector3(-150.0f,-150.0f,0.0f));
229 animation.AnimateBetween( Property(shader, "uPosition[1]"),k0, AlphaFunction::EASE_IN_OUT_SINE );
231 k0 = KeyFrames::New();
233 k0.Add( 0.5f, v4 + Vector3(150.0f,-150.0f,0.0f));
235 animation.AnimateBetween( Property(shader,"uPosition[4]"),k0, AlphaFunction::EASE_IN_OUT_SINE );
237 k0 = KeyFrames::New();
239 k0.Add( 0.5f, v5 + Vector3(0.0,150.0f,0.0f));
241 animation.AnimateBetween( Property(shader, "uPosition[7]"),k0, AlphaFunction::EASE_IN_OUT_SINE );
242 animation.SetLooping( true );
246 void CreateCircleMorph( Vector3 center, float radius )
248 Shader shader = CreateShader( 16 );
249 shader.SetProperty( shader.GetPropertyIndex("uPosition[0]"), Vector3( -radius, -radius, 0.0f ) );
250 shader.SetProperty( shader.GetPropertyIndex("uPosition[1]"), Vector3( 0.0f, -radius, 0.0f ) );
251 shader.SetProperty( shader.GetPropertyIndex("uPosition[2]"), Vector3( radius, -radius, 0.0f ) );
253 shader.SetProperty( shader.GetPropertyIndex("uPosition[3]"), Vector3( radius, -radius, 0.0f ) );
254 shader.SetProperty( shader.GetPropertyIndex("uPosition[4]"), Vector3( radius, 0.0f, 0.0f ) );
255 shader.SetProperty( shader.GetPropertyIndex("uPosition[5]"), Vector3( radius, radius, 0.0f ) );
257 shader.SetProperty( shader.GetPropertyIndex("uPosition[6]"), Vector3( radius, radius, 0.0f ) );
258 shader.SetProperty( shader.GetPropertyIndex("uPosition[7]"), Vector3( 0.0f, radius, 0.0f ) );
259 shader.SetProperty( shader.GetPropertyIndex("uPosition[8]"), Vector3( -radius, radius, 0.0f ) );
261 shader.SetProperty( shader.GetPropertyIndex("uPosition[9]"), Vector3( -radius, radius, 0.0f ) );
262 shader.SetProperty( shader.GetPropertyIndex("uPosition[10]"), Vector3( -radius, 0.0f, 0.0f ) );
263 shader.SetProperty( shader.GetPropertyIndex("uPosition[11]"), Vector3( -radius, -radius, 0.0f ) );
265 shader.SetProperty( shader.GetPropertyIndex("uPosition[12]"), Vector3( -radius, -radius, 0.0f ) );
266 shader.SetProperty( shader.GetPropertyIndex("uPosition[13]"), Vector3( radius, -radius, 0.0f ) );
267 shader.SetProperty( shader.GetPropertyIndex("uPosition[14]"), Vector3( radius, radius, 0.0f ) );
268 shader.SetProperty( shader.GetPropertyIndex("uPosition[15]"), Vector3( -radius, radius, 0.0f ) );
270 //shader.SetProperty( shader.GetPropertyIndex("uLineWidth"), 2.0f );
272 static const Vector3 vertexData[] = { Vector3( 0.0f, 0.0f, 0.0f ),
273 Vector3( 0.5f, 0.0f, 1.0f ),
274 Vector3( 1.0f, 1.0f, 2.0f ),
275 Vector3( 0.0f, 0.0f, 3.0f ),
276 Vector3( 0.5f, 0.0f, 4.0f ),
277 Vector3( 1.0f, 1.0f, 5.0f ),
278 Vector3( 0.0f, 0.0f, 6.0f ),
279 Vector3( 0.5f, 0.0f, 7.0f ),
280 Vector3( 1.0f, 1.0f, 8.0f ),
281 Vector3( 0.0f, 0.0f, 9.0f ),
282 Vector3( 0.5f, 0.0f, 10.0f ),
283 Vector3( 1.0f, 1.0f, 11.0f ),
284 Vector3( 0.0f, 1.0f, 12.0f ),
285 Vector3( 0.0f, 1.0f, 13.0f ),
286 Vector3( 0.0f, 1.0f, 14.0f ),
287 Vector3( 0.0f, 1.0f, 15.0f )};
289 short unsigned int indexData[] = { 0, 2, 1, 3, 5, 4, 6, 8, 7, 9, 11, 10, 12, 13, 14, 12, 14, 15 };
291 //Create a vertex buffer for vertex positions and texture coordinates
292 Dali::Property::Map vertexFormat;
293 vertexFormat["aCoefficient"] = Dali::Property::VECTOR3;
294 Dali::PropertyBuffer vertexBuffer = Dali::PropertyBuffer::New( vertexFormat );
295 vertexBuffer.SetData( vertexData, sizeof(vertexData)/sizeof(vertexData[0]));
297 //Create the geometry
298 Dali::Geometry geometry = Dali::Geometry::New();
299 geometry.AddVertexBuffer( vertexBuffer );
300 geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
302 Renderer renderer = Renderer::New( geometry, shader );
303 renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
305 Actor actor = Actor::New();
306 actor.SetSize( 400.0f, 400.0f );
307 actor.SetPosition( center );
308 actor.SetAnchorPoint( AnchorPoint::CENTER );
309 actor.AddRenderer( renderer );
311 Stage stage = Stage::GetCurrent();
315 Animation animation = Animation::New(5.0f);
316 KeyFrames k0 = KeyFrames::New();
317 k0.Add( 0.0f, Vector3( 0.0f,-radius*1.85, 0.0f ) );
318 k0.Add( 0.5f, Vector3( -radius*1.85, -radius*3.0f, 0.0f ) );
319 k0.Add( 1.0f, Vector3( 0.0f,-radius*1.85, 0.0f ) );
320 animation.AnimateBetween( Property( shader, shader.GetPropertyIndex("uPosition[1]") ),k0, AlphaFunction::EASE_IN_OUT_SINE );
322 k0 = KeyFrames::New();
323 k0.Add( 0.0f, Vector3( radius*1.85, 0.0f, 0.0f ) );
324 k0.Add( 0.5f, Vector3( radius*3.0f,-radius*1.85, 0.0f ) );
325 k0.Add( 1.0f, Vector3( radius*1.85,0.0f, 0.0f ) );
326 animation.AnimateBetween( Property(shader, shader.GetPropertyIndex("uPosition[4]")),k0, AlphaFunction::EASE_IN_OUT_SINE );
328 k0 = KeyFrames::New();
329 k0.Add( 0.0f, Vector3( 0.0f, radius*1.85, 0.0f ) );
330 k0.Add( 0.5f, Vector3( radius*1.85, radius*3.0f, 0.0f) );
331 k0.Add( 1.0f, Vector3( 0.0f, radius*1.85, 0.0f) );
332 animation.AnimateBetween( Property( shader, shader.GetPropertyIndex("uPosition[7]") ),k0, AlphaFunction::EASE_IN_OUT_SINE );
334 k0 = KeyFrames::New();
335 k0.Add( 0.0f, Vector3( -radius*1.85, 0.0f, 0.0f) );
336 k0.Add( 0.5f, Vector3(-radius*3.0f, radius*1.85, 0.0f) );
337 k0.Add( 1.0f, Vector3( -radius*1.85, 0.0f, 0.0f) );
338 animation.AnimateBetween( Property( shader, shader.GetPropertyIndex("uPosition[10]") ),k0, AlphaFunction::EASE_IN_OUT_SINE );
340 animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(-90.0f) ), Vector3::ZAXIS ) );
341 animation.SetLooping( true );
345 void CreateQuadMorph( Vector3 center, float radius )
347 Shader shader = CreateShader( 16 );
348 shader.SetProperty( shader.GetPropertyIndex("uPosition[0]"), Vector3( -radius, -radius, 0.0f ) );
349 shader.SetProperty( shader.GetPropertyIndex("uPosition[1]"), Vector3( 0.0f, -radius, 0.0f ) );
350 shader.SetProperty( shader.GetPropertyIndex("uPosition[2]"), Vector3( radius, -radius, 0.0f ) );
352 shader.SetProperty( shader.GetPropertyIndex("uPosition[3]"), Vector3( radius, -radius, 0.0f ) );
353 shader.SetProperty( shader.GetPropertyIndex("uPosition[4]"), Vector3( radius, 0.0f, 0.0f ) );
354 shader.SetProperty( shader.GetPropertyIndex("uPosition[5]"), Vector3( radius, radius, 0.0f ) );
356 shader.SetProperty( shader.GetPropertyIndex("uPosition[6]"), Vector3( radius, radius, 0.0f ) );
357 shader.SetProperty( shader.GetPropertyIndex("uPosition[7]"), Vector3( 0.0f, radius, 0.0f ) );
358 shader.SetProperty( shader.GetPropertyIndex("uPosition[8]"), Vector3( -radius, radius, 0.0f ) );
360 shader.SetProperty( shader.GetPropertyIndex("uPosition[9]"), Vector3( -radius, radius, 0.0f ) );
361 shader.SetProperty( shader.GetPropertyIndex("uPosition[10]"), Vector3( -radius, 0.0f, 0.0f ) );
362 shader.SetProperty( shader.GetPropertyIndex("uPosition[11]"), Vector3( -radius, -radius, 0.0f ) );
364 shader.SetProperty( shader.GetPropertyIndex("uPosition[12]"), Vector3( -radius, -radius, 0.0f ) );
365 shader.SetProperty( shader.GetPropertyIndex("uPosition[13]"), Vector3( radius, -radius, 0.0f ) );
366 shader.SetProperty( shader.GetPropertyIndex("uPosition[14]"), Vector3( radius, radius, 0.0f ) );
367 shader.SetProperty( shader.GetPropertyIndex("uPosition[15]"), Vector3( -radius, radius, 0.0f ) );
369 static const Vector3 vertexData[] = { Dali::Vector3( 0.0f, 0.0f, 0.0f ),
370 Dali::Vector3( 0.5f, 0.0f, 1.0f ),
371 Dali::Vector3( 1.0f, 1.0f, 2.0f ),
373 Dali::Vector3( 0.0f, 0.0f, 3.0f ),
374 Dali::Vector3( 0.5f, 0.0f, 4.0f ),
375 Dali::Vector3( 1.0f, 1.0f, 5.0f ),
377 Dali::Vector3( 0.0f, 0.0f, 6.0f ),
378 Dali::Vector3( 0.5f, 0.0f, 7.0f ),
379 Dali::Vector3( 1.0f, 1.0f, 8.0f ),
381 Dali::Vector3( 0.0f, 0.0f, 9.0f ),
382 Dali::Vector3( 0.5f, 0.0f, 10.0f ),
383 Dali::Vector3( 1.0f, 1.0f, 11.0f ),
385 Dali::Vector3( 0.0f, 1.0f, 12.0f ),
386 Dali::Vector3( 0.0f, 1.0f, 13.0f ),
387 Dali::Vector3( 0.0f, 1.0f, 14.0f ),
388 Dali::Vector3( 0.0f, 1.0f, 15.0f ) };
390 short unsigned int indexData[] = { 0, 2, 1, 3, 5, 4, 6, 8, 7, 9, 11, 10, 12, 15, 14, 12, 14, 13 };
392 //Create a vertex buffer for vertex positions and texture coordinates
393 Dali::Property::Map vertexFormat;
394 vertexFormat["aCoefficient"] = Dali::Property::VECTOR3;
395 Dali::PropertyBuffer vertexBuffer = Dali::PropertyBuffer::New( vertexFormat );
396 vertexBuffer.SetData( vertexData, sizeof(vertexData)/sizeof(vertexData[0]));
398 //Create the geometry
399 Dali::Geometry geometry = Dali::Geometry::New();
400 geometry.AddVertexBuffer( vertexBuffer );
401 geometry.SetIndexBuffer( indexData, sizeof(indexData)/sizeof(indexData[0]) );
403 Renderer renderer = Renderer::New( geometry, shader );
404 renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
406 Actor actor = Actor::New();
407 actor.SetSize( 400.0f, 400.0f );
408 actor.SetPosition( center );
409 actor.SetAnchorPoint( AnchorPoint::CENTER );
410 actor.SetColor(Vector4(1.0f,0.0f,0.0f,1.0f) );
411 actor.AddRenderer( renderer );
413 Stage stage = Stage::GetCurrent();
417 Animation animation = Animation::New( 5.0f );
418 KeyFrames k0 = KeyFrames::New();
419 k0.Add( 0.0f, Vector3( 0.0f, -radius, 0.0f ) );
420 k0.Add( 0.5f, Vector3( 0.0f, -radius*4.0f, 0.0f ) );
421 k0.Add( 1.0f, Vector3( 0.0f, -radius, 0.0f ) );
422 animation.AnimateBetween( Property(shader, shader.GetPropertyIndex("uPosition[1]")),k0, AlphaFunction::EASE_IN_OUT_SINE );
424 k0 = KeyFrames::New();
425 k0.Add( 0.0f, Vector3( radius, 0.0f, 0.0f ) );
426 k0.Add( 0.5f, Vector3( radius*4.0f, 0.0f, 0.0f ) );
427 k0.Add( 1.0f, Vector3( radius, 0.0f, 0.0f ) );
428 animation.AnimateBetween( Property(shader, shader.GetPropertyIndex("uPosition[4]")),k0, AlphaFunction::EASE_IN_OUT_SINE );
430 k0 = KeyFrames::New();
431 k0.Add( 0.0f, Vector3( 0.0f, radius, 0.0f ) );
432 k0.Add( 0.5f, Vector3( 0.0f, radius*4.0f, 0.0f ) );
433 k0.Add( 1.0f, Vector3( 0.0f, radius, 0.0f ) );
434 animation.AnimateBetween( Property(shader, shader.GetPropertyIndex("uPosition[7]")),k0, AlphaFunction::EASE_IN_OUT_SINE );
436 k0 = KeyFrames::New();
437 k0.Add( 0.0f, Vector3( -radius, 0.0f, 0.0f ) );
438 k0.Add( 0.5f, Vector3( -radius*4.0f,0.0f, 0.0f ) );
439 k0.Add( 1.0f, Vector3( -radius, 0.0f, 0.0f ) );
440 animation.AnimateBetween( Property(shader, shader.GetPropertyIndex("uPosition[10]")),k0, AlphaFunction::EASE_IN_OUT_SINE );
442 animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(90.0f) ), Vector3::ZAXIS ) );
443 animation.SetLooping( true );
448 * Main key event handler
450 void OnKeyEvent(const KeyEvent& event)
452 if( event.state == KeyEvent::Down && (IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK )) )
459 Application& mApplication;
463 int DALI_EXPORT_API main( int argc, char **argv )
465 Application application = Application::New( &argc, &argv );
466 AnimatedShapesExample test( application );
467 application.MainLoop();