Tizen Native API
5.5
|
Functions that deal with 3D projection of an 2D object.
Perspective is a graphical tool that makes objects represented in 2D look like they have a 3D appearance.
Edje allows us to use perspective on any edje object. This group of functions deal with the use of perspective, by creating and configuring a perspective object that must set to a edje object or a canvas, affecting all the objects inside that have no particular perspective set already.
Functions | |
Edje_Perspective * | edje_perspective_new (Evas *e) |
Creates a new perspective in the given canvas. | |
void | edje_perspective_free (Edje_Perspective *ps) |
Deletes the given perspective object. | |
void | edje_perspective_set (Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc) |
Sets up the transform for this perspective object. | |
void | edje_perspective_global_set (Edje_Perspective *ps, Eina_Bool global) |
Makes this perspective object be global for its canvas. | |
Eina_Bool | edje_perspective_global_get (const Edje_Perspective *ps) |
Gets whether the given perspective object is global or not. | |
const Edje_Perspective * | edje_evas_global_perspective_get (const Evas *e) |
Gets the global perspective object set for this canvas. | |
void | edje_object_perspective_set (Evas_Object *obj, Edje_Perspective *ps) |
Sets the given perspective object on this Edje object. | |
const Edje_Perspective * | edje_object_perspective_get (const Evas_Object *obj) |
Gets the current perspective used on this Edje object. | |
Eina_Bool | edje_file_text_class_set (const char *file, const char *text_class, const char *font, Evas_Font_Size size) |
Sets Edje text class for edje file (if loaded) | |
Eina_Bool | edje_file_text_class_del (const char *file, const char *text_class) |
Delete the file text class. | |
Eina_Bool | edje_file_text_class_get (const char *file, const char *text_class, const char **font, Evas_Font_Size *size) |
Gets font and font size from edje file if loaded. |
const Edje_Perspective* edje_evas_global_perspective_get | ( | const Evas * | e | ) |
Gets the global perspective object set for this canvas.
e | The given canvas (Evas). |
NULL
if there is no global perspective set and on errors.This function will return the perspective object that was set as global with edje_perspective_global_set().
Eina_Bool edje_file_text_class_del | ( | const char * | file, |
const char * | text_class | ||
) |
Delete the file text class.
This function deletes any values at the file level for the specified file and text class.
[in] | text_class | The text class to be deleted. |
Eina_Bool edje_file_text_class_get | ( | const char * | file, |
const char * | text_class, | ||
const char ** | font, | ||
Evas_Font_Size * | size | ||
) |
Gets font and font size from edje file if loaded.
This function gets the font and the font size from the file text class.
[in] | text_class | The text class name |
[out] | font | Font name |
[out] | size | Font Size |
true
, on success or false
, on error Eina_Bool edje_file_text_class_set | ( | const char * | file, |
const char * | text_class, | ||
const char * | font, | ||
Evas_Font_Size | size | ||
) |
Sets Edje text class for edje file (if loaded)
This function sets the text class for All Edje Objects created from Edje file. (if edje file loaded before)
[in] | file | edje file path |
[in] | text_class | The text class name |
[in] | font | Font name |
[in] | size | Font Size |
true
, on success or false
, on error const Edje_Perspective* edje_object_perspective_get | ( | const Evas_Object * | obj | ) |
Gets the current perspective used on this Edje object.
See also edje_object_perspective_set()
[in] | obj | The object. |
void edje_object_perspective_set | ( | Evas_Object * | obj, |
Edje_Perspective * | ps | ||
) |
Sets the given perspective object on this Edje object.
Make the given perspective object be the default perspective for this Edje object.
There can be only one perspective object per Edje object, and if a previous one was set, it will be removed and the new perspective object will be used.
An Edje perspective will only affect a part if it doesn't point to another part to be used as perspective.
edje_object_perspective_new() See also edje_object_perspective_get() edje_perspective_set()
[in] | obj | The object. |
[in] | ps | The perspective object that will be used. 2.3 |
void edje_perspective_free | ( | Edje_Perspective * | ps | ) |
Deletes the given perspective object.
ps | A valid perspective object, or NULL . |
This function will delete the perspective object. If the perspective effect was being applied to any Edje object or part, this effect won't be applied anymore.
Eina_Bool edje_perspective_global_get | ( | const Edje_Perspective * | ps | ) |
Gets whether the given perspective object is global or not.
ps | The given perspective object. |
EINA_TRUE
if this perspective object is global, EINA_FALSE
otherwise.void edje_perspective_global_set | ( | Edje_Perspective * | ps, |
Eina_Bool | global | ||
) |
Makes this perspective object be global for its canvas.
ps | The given perspective object |
global | EINA_TRUE if the perspective should be global, EINA_FALSE otherwise. |
The canvas which this perspective object is being set as global is the one given as argument upon the object creation (the evas
parameter on the function edje_perspective_new(evas)
).
There can be only one global perspective object set per canvas, and if a perspective object is set to global when there was already another global perspective set, the old one will be set as non-global.
A global perspective just affects a part if its Edje object doesn't have a perspective object set to it, and if the part doesn't point to another part to be used as perspective.
Edje_Perspective* edje_perspective_new | ( | Evas * | e | ) |
Creates a new perspective in the given canvas.
e | The given canvas (Evas). |
NULL
on errors.This function creates a perspective object that can be set on an Edje object, or globally to all Edje objects on this canvas.
void edje_perspective_set | ( | Edje_Perspective * | ps, |
Evas_Coord | px, | ||
Evas_Coord | py, | ||
Evas_Coord | z0, | ||
Evas_Coord | foc | ||
) |
Sets up the transform for this perspective object.
This sets the parameters of the perspective transformation. X, Y and Z values are used. The px and py points specify the "infinite distance" point in the 3D conversion (where all lines converge to like when artists draw 3D by hand). The z0
value specifies the z value at which there is a 1:1 mapping between spatial coordinates and screen coordinates. Any points on this z value will not have their X and Y values modified in the transform. Those further away (Z value higher) will shrink into the distance, and those less than this value will expand and become bigger. The foc
value determines the "focal length" of the camera. This is in reality the distance between the camera lens plane itself (at or closer than this rendering results are undefined) and the "z0" z value. This allows for some "depth" control and foc
must be greater than 0.
ps | The perspective object |
px | The perspective distance X coordinate |
py | The perspective distance Y coordinate |
z0 | The "0" z plane value |
foc | The focal distance 2.3 |