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
This commit is contained in:
Bruno Dilly 2012-11-28 22:39:00 +00:00
parent 5cca2ff0b1
commit 951a95c984
3 changed files with 69 additions and 0 deletions

View File

@ -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

View File

@ -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)

View File

@ -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;
}
}
}
}
}