Tizen Native API
4.0
|
LinearConstrainer applies constraints to objects, given a linear map. More...
Classes | |
struct | Property |
Enumeration for the instance of properties belonging to the LinearConstrainer class. More... | |
Public Member Functions | |
LinearConstrainer () | |
Creates an uninitialized LinearConstrainer handle. | |
~LinearConstrainer () | |
Destructor. | |
LinearConstrainer (const LinearConstrainer &handle) | |
This copy constructor is required for (smart) pointer semantics. | |
LinearConstrainer & | operator= (const LinearConstrainer &rhs) |
This assignment operator is required for (smart) pointer semantics. | |
void | Apply (Dali::Property target, Dali::Property source, const Vector2 &range, const Vector2 &wrap=Vector2(-FLT_MAX, FLT_MAX)) |
Applies the linear constraint to the target property. | |
void | Remove (Dali::Handle &target) |
Removes the linear constraint in the target object. | |
Static Public Member Functions | |
static LinearConstrainer | New () |
Creates an initialized LinearConstrainer handle. | |
static LinearConstrainer | DownCast (BaseHandle handle) |
Downcasts a handle to LinearConstrainer handle. |
LinearConstrainer applies constraints to objects, given a linear map.
A linear map is defined by a set of value-progress pairs. Progress must be normalized between [0,1]. If no progress is defined, the values are considered to be equally spaced along the X axis.
Basically, a linear constrainer allows constraining a property to another property with the changes mapped over a certain range. For example, if you want to change the opacity of an actor depending on its position along the X-axis, so that it's fully transparent on the edges and fully opaque in the center. To do this, an array with values, 0.0f, 1.0f, 0.0f, is created, which means that there are 3 control points. You can add as many control points as you want, but they will be linearly spaced. Then you can apply the linear constrainer by using the alpha of the actor as the target and the source as the actor's position.
Creates an uninitialized LinearConstrainer handle.
This can be initialized with LinearConstrainer::New Calling member functions with an uninitialized LinearConstrainer handle is not allowed.
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
Dali::LinearConstrainer::LinearConstrainer | ( | const LinearConstrainer & | handle | ) |
This copy constructor is required for (smart) pointer semantics.
[in] | handle | A reference to the copied handle |
void Dali::LinearConstrainer::Apply | ( | Dali::Property | target, |
Dali::Property | source, | ||
const Vector2 & | range, | ||
const Vector2 & | wrap = Vector2(-FLT_MAX, FLT_MAX) |
||
) |
Applies the linear constraint to the target property.
[in] | target | Property to be constrained |
[in] | source | Property used as a parameter for the linear map |
[in] | range | The range of values in the source property which will be mapped to [0,1] |
[in] | wrap | Wrapping domain. Source property will be wrapped in the domain [wrap.x,wrap.y] before mapping to [0,1]. See cfloat.h for FLT_MAX |
static LinearConstrainer Dali::LinearConstrainer::DownCast | ( | BaseHandle | handle | ) | [static] |
Downcasts a handle to LinearConstrainer handle.
If handle points to a LinearConstrainer object, the downcast produces valid handle. If not, the returned handle is left uninitialized.
[in] | handle | Handle to an object |
Reimplemented from Dali::Handle.
static LinearConstrainer Dali::LinearConstrainer::New | ( | ) | [static] |
Creates an initialized LinearConstrainer handle.
Reimplemented from Dali::Handle.
LinearConstrainer& Dali::LinearConstrainer::operator= | ( | const LinearConstrainer & | rhs | ) |
This assignment operator is required for (smart) pointer semantics.
[in] | rhs | A reference to the copied handle |
void Dali::LinearConstrainer::Remove | ( | Dali::Handle & | target | ) |
Removes the linear constraint in the target object.
[in] | target | A handle to an object constrained by the LinearConstrainer |