efl/legacy/edje/src/examples/physics_soft_bodies.edc

181 lines
4.3 KiB
Plaintext

collections {
images {
image: "bubble-blue.png" COMP;
}
group {
name: "example_group";
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: SOFT_BOX;
description {
state: "default" 0.0;
color: 255 0 0 255; /* red */
rel1.relative: 0.75 0.1;
rel2.relative: 0.95 0.3;
aspect: 1 1;
physics {
ignore_part_pos: 0;
restitution: 0.85;
}
}
description {
state: "soft" 0.0;
inherit: "default" 0.0;
physics {
hardness: 0.5;
}
}
description {
state: "very_soft" 0.0;
inherit: "default" 0.0;
physics {
hardness: 0.2;
}
}
}
part {
name: "blue_circle";
type: IMAGE;
physics_body: SOFT_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";
}
physics {
ignore_part_pos: 0;
restitution: 0.85;
hardness: 1;
}
}
description {
state: "soft" 0.0;
inherit: "default" 0.0;
physics.hardness: 0.5;
}
description {
state: "very_soft" 0.0;
inherit: "default" 0.0;
physics.hardness: 0.2;
}
}
part {
name: "floor";
type: RECT;
physics_body: BOUNDARY_BOTTOM;
description {
state: "default" 0.0;
visible: 0;
physics {
restitution: 0.7;
}
}
}
part {
name: "right_wall";
type: RECT;
physics_body: BOUNDARY_RIGHT;
description {
state: "default" 0.0;
visible: 0;
physics {
restitution: 1.0;
}
}
}
part {
name: "left_wall";
type: RECT;
physics_body: BOUNDARY_LEFT;
description {
state: "default" 0.0;
visible: 0;
physics {
restitution: 1.0;
}
}
}
}
programs {
program {
name: "stop,go_soft";
signal: "load";
in: 3 0;
action: PHYSICS_STOP;
target: "red_box";
target: "blue_circle";
after: "go_soft";
}
program {
name: "go_soft";
action: STATE_SET "soft" 0.0;
target: "red_box";
target: "blue_circle";
after: "stop,go_very_soft";
}
program {
name: "stop,go_very_soft";
in: 3 0;
action: PHYSICS_STOP;
target: "red_box";
target: "blue_circle";
after: "go_very_soft";
}
program {
name: "go_very_soft";
action: STATE_SET "very_soft" 0.0;
target: "red_box";
target: "blue_circle";
after: "stop,go_default";
}
program {
name: "stop,go_default";
in: 3 0;
action: PHYSICS_STOP;
target: "red_box";
target: "blue_circle";
after: "go_default";
}
program {
name: "go_default";
action: STATE_SET "default" 0.0;
target: "red_box";
target: "blue_circle";
after: "stop,go_soft";
}
}
}
}