1 #ifndef __DALI_TOOLKIT_SHADER_EFFECT_BOUNCING_H__
2 #define __DALI_TOOLKIT_SHADER_EFFECT_BOUNCING_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/dali.h>
23 namespace Dali DALI_IMPORT_API
30 * @brief BouncingEffect is a custom overscroll effect with two waves appearing at two sides then moving towards center and overlapping.
34 * // Create the an imageActor, set shader effect, and add it to the stage
35 * ImageActor imageActor = ImageActor::New( BitmapImage::New( 1, 1 ) );
36 * imageActor.SetSize(720.f,58.f);
37 * Toolkit::BouncingEffect bouncingEffect = Toolkit::BouncingEffect::New( Vector4(0.f,1.f,1.f,0.5f) );
38 * imageActor.SetShaderEffect( bouncingEffect );
39 * imageActor.SetParentOrigin( ParentOrigin::CENTER );
40 * Stage::GetCurrent().Add( imageActor );
42 * // Start the animation
43 * Animation animation = Animation::New(1.f);
44 * animation.AnimateTo( Property( bouncingEffect, bouncingEffect.GetProgressRatePropertyName() ),
45 * 1.f, AlphaFunctions::Bounce );
48 class BouncingEffect : public ShaderEffect
53 * @brief Creates an empty BouncingEffect handle
58 * @brief Virtual destructor
60 virtual ~BouncingEffect();
63 * @brief Create a BouncingEffect object
65 * @param[in] color The color used on the bouncing stripe
66 * @return A handle to a newly allocated Dali resource.
68 static BouncingEffect New( const Vector4& color );
71 * @brief Set the progress rate to the effect.
73 * The whole progress ( with progress rate from 0.0 to 1.0 ):
74 * two waves appear at two sides; move towards center and overlap.
75 * @param[in] progressRate The progress rate value.
77 void SetProgressRate( float progressRate );
80 * @brief Get the name for the progress rate property.
82 * @return A std::string containing the property name.
84 const std::string& GetProgressRatePropertyName() const;
87 private: // Not intended for application developers
88 BouncingEffect( ShaderEffect handle );
92 } // namespace Toolkit
96 #endif // __DALI_TOOLKIT_SHADER_EFFECT_BOUNCING_H__