1 #ifndef DEMO_FRAME_CALLBACK_H
2 #define DEMO_FRAME_CALLBACK_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/devel-api/update/frame-callback-interface.h>
23 #include <dali/devel-api/update/update-proxy.h>
24 #include <dali/public-api/common/dali-vector.h>
27 * @brief Implementation of the FrameCallbackInterface.
29 * When this is used, it will expand the size of the actors the closer they get to the horizontal edge
30 * and make the actor transparent the closer it gets to the middle.
32 class FrameCallback : public Dali::FrameCallbackInterface
42 * @brief Sets the stage width.
43 * @param[in] stageWidth The stage width.
45 void SetStageWidth( float stageWidth );
48 * @brief The actor with the specified ID will be changed when Update() is called.
49 * @param[in] id Actor ID of actor which should be changed by the FrameCallback.
51 void AddId( unsigned int id );
56 * @brief Called when every frame is updated.
57 * @param[in] updateProxy Used to set the world-matrix and sizes.
58 * @param[in] elapsedSeconds Time elapsed time since the last frame (in seconds)
60 virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds );
64 Dali::Vector< unsigned int > mActorIdContainer; ///< Container of Actor IDs.
65 float stageHalfWidth; ///< Half the width of the stage. Center is 0,0 in the world matrix.
67 constexpr static float SIZE_MULTIPLIER = 2.0f; ///< Multiplier for the size to set as the actors hit the edge.
70 #endif // DEMO_FRAME_CALLBACK_H