Examples

Creating a clock

1. REMOVETRIGGER writetime 
2. ON writetime WRITE ELEMENT:Fire 50 100 50 NUMBER HOUR 
3. ON writetime WRITE ELEMENT:Fire 150 100 50 NUMBER MINUTE 
4. ON writetime WRITE ELEMENT:Fire 250 100 50 NUMBER SECOND 
5. ON writetime TIMER 1 FRAMES writetime 
6. EXEC writetime
  1. Removes all actions from writetime. So you don't get problems if you run the script more than once.
  2. Writes the current hour at 50 100 with a size of 50.
  3. Writes the current minute at 150 100 with a size of 50.
  4. Writes the current second at 250 100 with a size of 50.
  5. This will call the writetime every frame.
  6. Run the script now.

Replacing a rect

1. REMOVETRIGGER REPACEFILLEDRECT 
2. ON REPACEFILLEDRECT SET tmp 0
3. ON REPACEFILLEDRECT WHILE (tmp < $5) REPACEFILLEDRECT2
4. REMOVETRIGGER REPACEFILLEDRECT2 
5. ON REPACEFILLEDRECT2 DRAW $0 REPLACELINE $2 ($3 + tmp) $4 0 $1
6. ON REPACEFILLEDRECT2 SET tmp (tmp + 1)
7. EXEC REPACEFILLEDRECT ELEMENT:Fire ELEMENT:Water 100 100 50 70
  1. Removes all actions from REPACEFILLEDRECT. So you don't get problems if you run the script more than once.
  2. Sets the variable tmp to 0.
  3. While tmp is smaller than the 6th parameter of the function execute REPACEFILLEDRECT2.
  4. Removes all actions from REPACEFILLEDRECT2. So you don't get problems if you run the script more than once.
  5. Draws a REPLACELINE at every line.
  6. Increases the variable tmp by 1.
  7. Executed the script and replaces every Water by Fire in the rect 100/100 with the width 50 and height 70.
 
drawing.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