efl
1/* This example demonstrates the most basic usage of physics.
2*
3* To make a part behaves like a body in a physics simulation,
4* all that is needed is to set its attribute part.physics_body
5* to something different from NONE. For example, RIGID_BOX,
6* or CLOTH. It will define the shape of the part, and how it
7* will interact with the environment.
8*
9* The remaining body attributes should be set inside the physics
10* block of description. In this example we are customizing
11* the restitution, that is how much the body bounces, and friction.
12*
13* It can be tested with edje_player
14* $ edje_player physics_basic.edj
15*/
16
17collections {
18
19images {
20image: "bubble-blue.png" COMP;
21}
22
23group {
24name: "example_group";
25
26parts {
27part {
28name: "background";
29type: RECT;
30physics_body: NONE;
31description {
32state: "default" 0.0;
33color: 255 255 255 255; /* white */
34rel1.relative: 0.0 0.0;
35rel2.relative: 1.0 1.0;
36}
37}
38
39part {
40name: "red_box";
41type: RECT;
42physics_body: RIGID_BOX;
43description {
44state: "default" 0.0;
45color: 255 0 0 255; /* red */
46rel1.relative: 0.75 0.1;
47rel2.relative: 0.95 0.3;
48aspect: 1 1;
49physics {
50restitution: 0.85;
51}
52}
53}
54
55part {
56name: "blue_circle";
57type: IMAGE;
58physics_body: RIGID_SPHERE;
59description {
60state: "default" 0.0;
61rel1.relative: 0.25 0.1;
62rel2.relative: 0.45 0.3;
63aspect: 1 1;
64image {
65normal: "bubble-blue.png";
66}
67}
68}
69
70part {
71name: "floor";
72type: RECT;
73physics_body: BOUNDARY_BOTTOM;
74description {
75state: "default" 0.0;
76visible: 0;
77physics {
78restitution: 0.92;
79friction: 0.6;
80}
81}
82}
83}
84
85}
86}
87