efl

Форк
0
/
physics_basic.edc 
86 строк · 2.2 Кб
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

17
collections {
18

19
   images {
20
      image: "bubble-blue.png" COMP;
21
   }
22

23
   group {
24
      name: "example_group";
25

26
      parts {
27
         part {
28
            name: "background";
29
            type: RECT;
30
            physics_body: NONE;
31
            description {
32
               state: "default" 0.0;
33
               color: 255 255 255 255; /* white */
34
               rel1.relative: 0.0 0.0;
35
               rel2.relative: 1.0 1.0;
36
            }
37
         }
38

39
         part {
40
            name: "red_box";
41
            type: RECT;
42
            physics_body: RIGID_BOX;
43
            description {
44
               state: "default" 0.0;
45
               color: 255 0 0 255; /* red */
46
               rel1.relative: 0.75 0.1;
47
               rel2.relative: 0.95 0.3;
48
               aspect: 1 1;
49
               physics {
50
                  restitution: 0.85;
51
               }
52
            }
53
         }
54

55
         part {
56
            name: "blue_circle";
57
            type: IMAGE;
58
            physics_body: RIGID_SPHERE;
59
            description {
60
               state: "default" 0.0;
61
               rel1.relative: 0.25 0.1;
62
               rel2.relative: 0.45 0.3;
63
               aspect: 1 1;
64
               image {
65
                  normal: "bubble-blue.png";
66
               }
67
            }
68
         }
69

70
         part {
71
            name: "floor";
72
            type: RECT;
73
            physics_body: BOUNDARY_BOTTOM;
74
            description {
75
               state: "default" 0.0;
76
               visible: 0;
77
               physics {
78
                  restitution: 0.92;
79
                  friction: 0.6;
80
               }
81
            }
82
         }
83
      }
84

85
   }
86
}
87

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.