Dynamic EL

Synopsis

A new feature has been added to javahase in order to provide dynamic layout.
You can use it by specifying a variable instead of an integer in the position field of an EL file. This variable must have the name of a parameter specified in the EDL file for the same ENTITY.

Example

With the following EDL ENTITY description :
ENTITY myCar (
DESCRIPTION ("car pilot")
PARAMS (
RENUM (car_state, dir, 0)
RINT (x, 520)
RINT (y, 80)
)
)
...
AENTITY myCar yahoo ( DESCRIPTION ("My car") )
A part of the car.edl file
One can specify the following dynamic EL file :
yahoo : position (x,y)
A part of the car.elf file
This means that the x and y position of the entity depends on the value of the x and y parameters. If those values change, the entity will move on the screen.

Then with a simple hase code like that :
$body

for (int i=0; i<5; i++) {
dir = i%2==0?to_left:to_right;
dump_state();

for (int j=0; j<25; j++) {
sim_hold(1);
if (dir == to_left)
x -= 20;
else
x += 20;
dump_state();
}
}
myCar.hase
One will obtain the following result:


Frederic Mallet
Last modified: Wed Dec 5 09:59:18 GMT 2001