summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2012-11-28 22:39:00 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-11-28 22:39:00 +0000
commit951a95c9840b079b4e24162cab89909a5b4472c5 (patch)
tree377773d732f693ab0c21036a811bd203b2fa4971 /legacy
parent5cca2ff0b1507fdbb16da224dd02512aea88a6c4 (diff)
edje: add very basic physics example
Just two bodies falling (a circle and a box) and colliding to the floor. bug: when edje is resized objects will be moved back to original position. SVN revision: 79794
Diffstat (limited to 'legacy')
-rw-r--r--legacy/edje/configure.ac1
-rw-r--r--legacy/edje/src/examples/Makefile.am4
-rw-r--r--legacy/edje/src/examples/physics_basic.edc64
3 files changed, 69 insertions, 0 deletions
diff --git a/legacy/edje/configure.ac b/legacy/edje/configure.ac
index f3179acbb6..2b193b054d 100644
--- a/legacy/edje/configure.ac
+++ b/legacy/edje/configure.ac
@@ -346,6 +346,7 @@ fi
346if test "x${want_ephysics}" = "xyes" -a "x${have_ephysics}" = "xno"; then 346if test "x${want_ephysics}" = "xyes" -a "x${have_ephysics}" = "xno"; then
347 AC_MSG_ERROR([EPhysics required, but not found]) 347 AC_MSG_ERROR([EPhysics required, but not found])
348fi 348fi
349AM_CONDITIONAL([ENABLE_EPHYSICS], [test "x${have_ephysics}" != "xno"])
349 350
350 351
351# Enable Multisense use 352# Enable Multisense use
diff --git a/legacy/edje/src/examples/Makefile.am b/legacy/edje/src/examples/Makefile.am
index 7ad48bf5aa..3f120893c0 100644
--- a/legacy/edje/src/examples/Makefile.am
+++ b/legacy/edje/src/examples/Makefile.am
@@ -52,6 +52,10 @@ if ENABLE_MULTISENSE
52EDCS += multisense.edc 52EDCS += multisense.edc
53endif 53endif
54 54
55if ENABLE_EPHYSICS
56EDCS += physics_basic.edc
57endif
58
55.edc.edj: 59.edc.edj:
56 $(EDJE_CC) $(EDJE_CC_FLAGS) $(SND_DIR) $< $(builddir)/$(@F) 60 $(EDJE_CC) $(EDJE_CC_FLAGS) $(SND_DIR) $< $(builddir)/$(@F)
57 61
diff --git a/legacy/edje/src/examples/physics_basic.edc b/legacy/edje/src/examples/physics_basic.edc
new file mode 100644
index 0000000000..cc98fdc170
--- /dev/null
+++ b/legacy/edje/src/examples/physics_basic.edc
@@ -0,0 +1,64 @@
1collections {
2
3 images {
4 image: "bubble-blue.png" COMP;
5 }
6
7 group {
8 name: "example_group";
9 min: 100 100;
10
11 parts {
12 part {
13 name: "background";
14 type: RECT;
15 physics_body: NONE;
16 description {
17 state: "default" 0.0;
18 color: 255 255 255 255; /* white */
19 rel1.relative: 0.0 0.0;
20 rel2.relative: 1.0 1.0;
21 }
22 }
23
24 part {
25 name: "red_box";
26 type: RECT;
27 physics_body: RIGID_BOX;
28 description {
29 state: "default" 0.0;
30 color: 255 0 0 255; /* red */
31 rel1.relative: 0.55 0.1;
32 rel2.relative: 0.75 0.3;
33 aspect: 1 1;
34 }
35 }
36
37 part {
38 name: "blue_circle";
39 type: IMAGE;
40 physics_body: RIGID_CIRCLE;
41 description {
42 state: "default" 0.0;
43 rel1.relative: 0.25 0.1;
44 rel2.relative: 0.45 0.3;
45 aspect: 1 1;
46 image {
47 normal: "bubble-blue.png";
48 }
49 }
50 }
51
52 part {
53 name: "floor";
54 type: RECT;
55 physics_body: BOUNDARY_BOTTOM;
56 description {
57 state: "default" 0.0;
58 visible: 0;
59 }
60 }
61 }
62
63 }
64}