DALI_TEST_EQUALS( vector.a, actor.GetCurrentColor().a, TEST_LOCATION );
+ actor.SetProperty( DevelActor::Property::OPACITY, 0.2f );
+
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( 0.2f, actor.GetCurrentColor().a, TEST_LOCATION );
+
END_TEST;
}
END_TEST;
}
+int UtcDaliActorConstrainedToOpacity(void)
+{
+ TestApplication app;
+ tet_infoline(" UtcDaliActorConstrainedToOpacity");
+
+ Actor parent = Actor::New();
+ parent.SetOpacity( 0.7f );
+ Stage::GetCurrent().Add( parent );
+
+ Actor child = Actor::New();
+ Constraint opacityConstraint = Constraint::New<float>( child, DevelActor::Property::OPACITY, EqualToConstraint() );
+ opacityConstraint.AddSource( Source( parent, DevelActor::Property::OPACITY ) );
+ opacityConstraint.Apply();
+
+ Stage::GetCurrent().Add( child );
+
+ app.SendNotification();
+ app.Render(0);
+ app.Render();
+ app.SendNotification();
+
+ DALI_TEST_EQUALS( child.GetCurrentOpacity(), parent.GetCurrentOpacity(), 0.001f, TEST_LOCATION );
+
+ parent.SetOpacity( 0.3f );
+
+ app.SendNotification();
+ app.Render(0);
+ app.Render();
+ app.SendNotification();
+
+ DALI_TEST_EQUALS( child.GetCurrentOpacity(), parent.GetCurrentOpacity(), 0.001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliActorUnparent(void)
{
TestApplication app;
{ "maximumSize", Actor::Property::MAXIMUM_SIZE, Property::VECTOR2 },
{ "inheritPosition", Actor::Property::INHERIT_POSITION, Property::BOOLEAN },
{ "clippingMode", Actor::Property::CLIPPING_MODE, Property::STRING },
+ { "opacity", DevelActor::Property::OPACITY, Property::FLOAT },
};
const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] );
} // unnamed namespace
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali-test-suite-utils.h>
using std::max;
// Apply animation to actor
animation.AnimateTo( Property(actor, Actor::Property::POSITION), Vector3( 100.f, 90.f, 80.f ), AlphaFunction::LINEAR );
+ animation.AnimateTo( Property(actor, DevelActor::Property::OPACITY), 0.3f, AlphaFunction::LINEAR );
animation.Play();
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/object/handle-devel.h>
#include "dali-test-suite-utils/dali-test-suite-utils.h"
#include <mesh-builder.h>
DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_GREEN ) );
DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_BLUE ) );
DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_ALPHA ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyWritable( DevelActor::Property::OPACITY ) );
// World-properties are not writable:
DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_POSITION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_GREEN ) );
DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_BLUE ) );
DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_ALPHA ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( DevelActor::Property::OPACITY ) );
// World-properties can not be animated
DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_POSITION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_GREEN ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_BLUE ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_ALPHA ) );
+ DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( DevelActor::Property::OPACITY ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_POSITION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_ORIENTATION ) );
DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_SCALE ) );
INHERIT_POSITION = Dali::Actor::Property::INHERIT_POSITION,
CLIPPING_MODE = Dali::Actor::Property::CLIPPING_MODE,
- SIBLING_ORDER = CLIPPING_MODE + 1,
+ SIBLING_ORDER = CLIPPING_MODE + 1,
+
+ /**
+ * @brief The opacity of the actor.
+ * @details Name "opacity", type Property::FLOAT.
+ * @SINCE_1_2.28
+ */
+ OPACITY = CLIPPING_MODE + 2,
};
} // namespace Property
DALI_PROPERTY( "inheritPosition", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_POSITION )
DALI_PROPERTY( "clippingMode", STRING, true, false, false, Dali::Actor::Property::CLIPPING_MODE )
DALI_PROPERTY( "siblingOrder", INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER )
+DALI_PROPERTY( "opacity", FLOAT, true, true, true, Dali::DevelActor::Property::OPACITY )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
// Signals
}
case Dali::Actor::Property::COLOR_ALPHA:
+ case Dali::DevelActor::Property::OPACITY:
{
- SetOpacity( property.Get< float >() );
+ float value;
+ if( property.Get( value ) )
+ {
+ SetOpacity( value );
+ }
break;
}
}
case Dali::Actor::Property::COLOR_ALPHA:
+ case Dali::DevelActor::Property::OPACITY:
{
value = GetCurrentColor().a;
break;
break;
case Dali::Actor::Property::COLOR_ALPHA:
+ case Dali::DevelActor::Property::OPACITY:
property = &mNode->mColor;
break;
break;
case Dali::Actor::Property::COLOR_ALPHA:
+ case Dali::DevelActor::Property::OPACITY:
+ {
property = &mNode->mColor;
break;
+ }
case Dali::Actor::Property::WORLD_COLOR:
property = &mNode->mWorldColor;
}
case Dali::Actor::Property::COLOR_ALPHA:
+ case Dali::DevelActor::Property::OPACITY:
{
componentIndex = 3;
break;