From: Bruno Dilly Date: Wed, 28 Nov 2012 22:39:00 +0000 (+0000) Subject: edje: add very basic physics example X-Git-Tag: submit/devel/efl/20131022.203902~3204 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=951a95c9840b079b4e24162cab89909a5b4472c5;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/legacy/edje/configure.ac b/legacy/edje/configure.ac index f3179ac..2b193b0 100644 --- a/legacy/edje/configure.ac +++ b/legacy/edje/configure.ac @@ -346,6 +346,7 @@ fi if test "x${want_ephysics}" = "xyes" -a "x${have_ephysics}" = "xno"; then AC_MSG_ERROR([EPhysics required, but not found]) fi +AM_CONDITIONAL([ENABLE_EPHYSICS], [test "x${have_ephysics}" != "xno"]) # Enable Multisense use diff --git a/legacy/edje/src/examples/Makefile.am b/legacy/edje/src/examples/Makefile.am index 7ad48bf..3f12089 100644 --- a/legacy/edje/src/examples/Makefile.am +++ b/legacy/edje/src/examples/Makefile.am @@ -52,6 +52,10 @@ if ENABLE_MULTISENSE EDCS += multisense.edc endif +if ENABLE_EPHYSICS +EDCS += physics_basic.edc +endif + .edc.edj: $(EDJE_CC) $(EDJE_CC_FLAGS) $(SND_DIR) $< $(builddir)/$(@F) diff --git a/legacy/edje/src/examples/physics_basic.edc b/legacy/edje/src/examples/physics_basic.edc new file mode 100644 index 0000000..cc98fdc --- /dev/null +++ b/legacy/edje/src/examples/physics_basic.edc @@ -0,0 +1,64 @@ +collections { + + images { + image: "bubble-blue.png" COMP; + } + + group { + name: "example_group"; + min: 100 100; + + parts { + part { + name: "background"; + type: RECT; + physics_body: NONE; + description { + state: "default" 0.0; + color: 255 255 255 255; /* white */ + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + + part { + name: "red_box"; + type: RECT; + physics_body: RIGID_BOX; + description { + state: "default" 0.0; + color: 255 0 0 255; /* red */ + rel1.relative: 0.55 0.1; + rel2.relative: 0.75 0.3; + aspect: 1 1; + } + } + + part { + name: "blue_circle"; + type: IMAGE; + physics_body: RIGID_CIRCLE; + description { + state: "default" 0.0; + rel1.relative: 0.25 0.1; + rel2.relative: 0.45 0.3; + aspect: 1 1; + image { + normal: "bubble-blue.png"; + } + } + } + + part { + name: "floor"; + type: RECT; + physics_body: BOUNDARY_BOTTOM; + description { + state: "default" 0.0; + visible: 0; + } + } + } + + } +}