#include <dali/dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/mesh-actor.h>
+#include <dali/devel-api/modeling/material.h>
+#include <dali/devel-api/geometry/mesh.h>
+
#include "shared/view.h"
#include <fstream>
#include <sstream>
+#include <limits>
using namespace Dali;
{
}
- Vector2 operator()( const Vector2& current, const PropertyInput& spinAngleProperty)
+ void operator()( Vector2& current, const PropertyInputContainer& inputs )
{
- float spinAngle = spinAngleProperty.GetFloat();
- return Vector2( cos(spinAngle ), sin( spinAngle ) ) * mRadius;
+ float spinAngle = inputs[0]->GetFloat();
+ current.x = cos( spinAngle );
+ current.y = sin( spinAngle );
+
+ current *= mRadius;
}
float mRadius;
/**
* @brief Load an image, scaled-down to no more than the stage dimensions.
*
- * Uses image scaling mode ImageAttributes::ScaleToFill to resize the image at
+ * Uses image scaling mode SCALE_TO_FILL to resize the image at
* load time to cover the entire stage with pixels with no borders,
- * and filter mode ImageAttributes::BoxThenLinear to sample the image with
- * maximum quality.
+ * and filter mode BOX_THEN_LINEAR to sample the image with maximum quality.
*/
ResourceImage LoadStageFillingImage( const char * const imagePath )
{
Size stageSize = Stage::GetCurrent().GetSize();
- ImageAttributes attributes;
- attributes.SetSize( stageSize.x, stageSize.y );
- attributes.SetFilterMode( ImageAttributes::BoxThenLinear );
- attributes.SetScalingMode( ImageAttributes::ScaleToFill );
- return ResourceImage::New( imagePath, attributes );
+ return ResourceImage::New( imagePath, ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
}
} // namespace
handle.SetUniform( "uLightIntensity", 2.5f );
Dali::Property::Index index = handle.RegisterProperty( "uSpinAngle", 0.f );
- Constraint constraint = Constraint::New<Vector2>( handle.GetPropertyIndex("uLightSpinOffset"),
- LocalSource(index),
- LightOffsetConstraint(stageSize.x*0.1f));
- handle.ApplyConstraint( constraint );
+ Constraint constraint = Constraint::New<Vector2>( handle, handle.GetPropertyIndex("uLightSpinOffset"), LightOffsetConstraint(stageSize.x*0.1f) );
+ constraint.AddSource( LocalSource(index) );
+ constraint.Apply();
return handle;
}
// The Init signal is received once (only) during the Application lifetime
void Create(Application& application)
{
- DemoHelper::RequestThemeChange();
-
Stage stage = Stage::GetCurrent();
mStageHalfSize = stage.GetSize() * 0.5f;
// Creates a default view with a default tool bar.
// The view is added to the stage.
Toolkit::ToolBar toolBar;
- Toolkit::View view;
+ Toolkit::Control view;
mContent = DemoHelper::CreateView( application,
view,
toolBar,
int
main(int argc, char **argv)
{
- Application app = Application::New(&argc, &argv);
+ Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH);
RunTest(app);