Tutorial

First create three elements:

Element Clear tutorialelement1 255 0 0 0 1 1 1 0 Clear 100 File 1.BMP 
Element Clear tutorialelement2 0 255 0 0 1 1 1 0 Clear 100 File 2.BMP 
Element Clear tutorialelement3 0 0 255 0 1 1 1 0 Clear 100 File 3.BMP 

Then bind these elements to an InteractionTrigger:

InteractionTrigger tutorialelement1 tutorialelement2 tutorialtrigger 100

Then create the tutorialtrigger:

ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 -10 -10
ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 10 -10
ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 -10 10
ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 10 10

This will draw an “X” at the position the 2 elements hit.

X1 is the X-Coordinate of the first element in the interaction.
Y1 is the Y-Coordinate of the first element in the interaction.
X2 is the X-Coordinate of the second element in the interaction.
Y2 is the Y-Coordinate of the second element in the interaction.
INTERACTION1 is the first element involved in the interaction.
INTERACTION2 is the second element involved in the interaction.

The final script:

Element Clear tutorialelement1 255 0 0 0 1 1 1 0 Clear 100 File 1.BMP 
Element Clear tutorialelement2 0 255 0 0 1 1 1 0 Clear 100 File 2.BMP 
Element Clear tutorialelement3 0 0 255 0 1 1 1 0 Clear 100 File 3.BMP 
InteractionTrigger tutorialelement1 tutorialelement2 tutorialtrigger 100
ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 -10 -10
ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 10 -10
ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 -10 10
ON tutorialtrigger DRAW ELEMENT:tutorialelement3 LINE X1 Y1 10 10

Examples

Filling elements on touch

1. Element Clear tutorialelement 255 255 255 0 1 1 1 0 Clear 100 File 1.BMP 
2. InteractionTrigger tutorialelement Earth tutorialtrigger 10000
3. REMOVETRIGGER tutorialtrigger 
4. ON tutorialtrigger DRAW ELEMENT:tutorialelement FILL X2 Y2
  1. Creates a new Element.
  2. Binds the Trigger tutorialelement to the new element. If tutorialelement touches Earth the trigger tutorialtrigger is executed.
  3. Removes all actions from tutorialtrigger. So you don't get problems if you run the script more than once.
  4. If tutorialtrigger is executed it filles Element2 with tutorialelement

Letting an element go only to the right

1. Element Clear tutorialelement 255 0 0 0 1 1 1 0 Clear 100 File 1.BMP 
2. InteractionTrigger tutorialelement All tutorialtrigger 100 tutorialelement
3. REMOVETRIGGER tutorialtrigger
3. ON tutorialtrigger IF (X2 > X1) tutorialtrigger2
3. REMOVETRIGGER tutorialtrigger2
4. ON tutorialtrigger2 DRAW INTERACTION1 POINT X2 Y2
5. ON tutorialtrigger2 DRAW INTERACTION2 POINT X1 Y1
  1. Creates a new Element.
  2. Binds the Trigger tutorialelement to the new element. If tutorialelement touches anything but itself the trigger tutorialtrigger is executed.
  3. Removes all actions from tutorialtrigger. So you don't get problems if you run the script more than once.
  4. Checks if the second interactionpoint is right of the first one. It then executes tutorialtrigger2
  5. Removes all actions from tutorialtrigger2. So you don't get problems if you run the script more than once.
  6. Draws the first element on the right side.
  7. Draws the second element on the left side.

Creating a box out of an single pixel

1. Element Clear tutorialelement 255 0 0 0 1 1 1 0 Clear 100 File 1.BMP 
2. InteractionTrigger tutorialelement All tutorialtrigger 100 tutorialelement
3. REMOVETRIGGER tutorialtrigger
3. ON tutorialtrigger DRAW ELEMENT:Earth RECT (X1 - 5) (Y1 - 5) 10 10
4. ON tutorialtrigger DRAW ELEMENT:Clear POINT X1 Y1
  1. Creates a new Element.
  2. Binds the Trigger tutorialelement to the new element. If tutorialelement touches anything but itself the trigger tutorialtrigger is executed.
  3. Removes all actions from tutorialtrigger. So you don't get problems if you run the script more than once.
  4. Draws a rect of Earth around the Pixel with width and height of 10. Startingpoint is 5 left and 5 top of the interactioncoordinates.
  5. Erases the Pixel itself.

Let an element catch the cursor

1. Element Clear tutorialelement 255 0 0 0 1 1 1 0 Clear 100 File 1.BMP 
2. InteractionTrigger tutorialelement Clear tutorialtrigger 10000 tutorialtrigger
3. REMOVETRIGGER tutorialtrigger
4. ON tutorialtrigger IF ((X2 > X1) && (X > X1) && (X != 0)) <DRAW 0 SWAPPOINTS X2 Y2 X1 Y1>
5. ON tutorialtrigger IF ((X2 < X1) && (X < X1) && (X != 0)) <DRAW 0 SWAPPOINTS X2 Y2 X1 Y1>
6. ON tutorialtrigger IF ((Y2 > Y1) && (Y > Y1) && (X != 0)) <DRAW 0 SWAPPOINTS X2 Y2 X1 Y1>
7. ON tutorialtrigger IF ((Y2 < Y1) && (Y < Y1) && (X != 0)) <DRAW 0 SWAPPOINTS X2 Y2 X1 Y1>
  1. Creates a new Element.
  2. Binds the Trigger tutorialelement to the new element. If tutorialelement touches clear tutorialtrigger is executed.
  3. Removes all actions from tutorialtrigger. So you don't get problems if you run the script more than once.
  4. If the second the x coordinate of the cursor is bigger than the x coordinate of the element go to the right.
  5. The same as 4, but go to the left.
  6. The same as 4, but go down.
  7. The same as 4, but go up.
 
interactiontriggers.txt · Last modified: 2008/08/08 14:19 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki