|
|
|
NavigationPersonal tools |
Edje Image Part
An "image" part type is one of the most featureful types of the Edje libraries and make possible to display any image file type supported by Evas in an interface.
part {
name: "part_name";
type: IMAGE;
description {
state: "default" INDEX;
image {
}
fill {
}
rel1 {
}
rel2 {
}
}
}
[edit] Image
image {
normal: "filename.ext";
tween: "filename.ext";
border: left right top bottom;
middle: 0-1;
}
The image block contains information about the image files that the part is going to display.
[edit] Fill
fill {
smooth: 0-1;
origin {
relative: X-axis Y-axis;
offset: X-axis Y-axis;
}
size {
relative: width height;
offset: width height;
}
}
The fill block is optional and it sets the way an image is going to be displayed inside it's container. By default, the image will be stretched to occupy the whole container, but when used, the fill block allows the designer to create a tile of a given image.
[edit] origin
origin {
relative: X-axis Y-axis;
offset: X-axis Y-axis;
}
The origin block is used to place the starting point, inside the image, that will be used to render the tile, by default, the origin is set at the image left-up corner.
[edit] size
size {
relative: width height;
offset: width height;
}
This block defines the size of the tile relatively to the size of the image container, by default, the size is the 100% of the image.
[edit] Tips[edit] Visibility and EventsInvisible parts don't receive mouse events, but in some cases a image part that's used to retrieve events might need turn invisible while retaining this capability.
part {
name: "part_name";
type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
}
description {
inherit: "default" 0.0;
state: "invisible" 0.0;
color: 0 0 0 0;
}
}
Defining an invisible color property inside the description where the image turns invisible allows this to happen. Keep in mind, that if the alpha channel is greater than 0 a rect will be displayed instead of the image. Note: For the sake of clarity some required image properties have been omitted in this example. |