[473] | 1 | function init
|
---|
| 2 | movespeed = 40
|
---|
| 3 | rotaspeed = 10
|
---|
| 4 | timeappear = 8
|
---|
| 5 | timedisapp = 6
|
---|
| 6 |
|
---|
| 7 | load_tool Pencil, Template\Pencil.swf
|
---|
| 8 | load_tool Pen, Template\Pencil.swf
|
---|
| 9 | load_tool Burin, Template\Burin.swf
|
---|
| 10 | load_tool TSquare, Template\TSquare.swf
|
---|
| 11 | load_tool Ruler, Template\Ruler.swf
|
---|
| 12 | load_tool Protractor, Template\Protractor.swf
|
---|
| 13 | load_tool MeasurerRuler, Template\Measurer.swf, MRuler
|
---|
| 14 | load_tool MeasurerProt, Template\Measurer.swf, MProt
|
---|
| 15 | load_tool Compa, Template\Compa.swf
|
---|
| 16 | end
|
---|
| 17 |
|
---|
| 18 | function drag_along Ruler, Pencil, x1, y1, x2, y2, time
|
---|
| 19 | local angle
|
---|
| 20 | get_angle &angle, x1, y1, x2, y2
|
---|
| 21 | appear Ruler
|
---|
| 22 | move Ruler, x1, y1, angle
|
---|
| 23 | appear Pencil
|
---|
| 24 | move Pencil, x1, y1
|
---|
| 25 | delay 3
|
---|
| 26 | drag_pen Pencil, x1, y1, x2, y2
|
---|
| 27 | delay time
|
---|
| 28 | disappear Pencil
|
---|
| 29 | disappear Ruler
|
---|
| 30 | end
|
---|
| 31 |
|
---|
| 32 | function create_line x1, y1, x2, y2
|
---|
| 33 | drag_along Ruler, Pencil, x1, y1, x2, y2, 3
|
---|
| 34 | end
|
---|
| 35 |
|
---|
| 36 | function create_line2 x1, y1, x2, y2
|
---|
| 37 | drag_along Ruler, Pencil, x1, y1, x2, y2, 18
|
---|
| 38 | end
|
---|
| 39 |
|
---|
| 40 | function create_line3 x1, y1, x2, y2
|
---|
| 41 | drag_along TSquare, Pencil, x1, y1, x2, y2, 12
|
---|
| 42 | end
|
---|
| 43 |
|
---|
| 44 | function create_corner x1, y1, angle, len
|
---|
| 45 | set_paper Draft
|
---|
| 46 | appear Protractor
|
---|
| 47 | move Protractor, x1, y1
|
---|
| 48 | delay 6
|
---|
| 49 | get_point &px, &py, x1, y1, angle, prot_radius
|
---|
| 50 | appear Point, px, py, ""
|
---|
| 51 | get_point &px, &py, x1, y1, angle, 3.5
|
---|
| 52 | appear TextDegree, px, py, angle
|
---|
| 53 | delay 18
|
---|
| 54 | disappear Protractor, TextDegree
|
---|
| 55 | delay 6
|
---|
| 56 | local x2, y2
|
---|
| 57 | get_point &x2, &y2, x1, y1, angle, len
|
---|
| 58 | create_line x1, y1, x2, y2
|
---|
| 59 | disappear Point
|
---|
| 60 | set_paper Paper
|
---|
| 61 | end
|
---|
| 62 |
|
---|
| 63 | function drag_pen Pencil, x1, y1, x2, y2
|
---|
| 64 | movespeed = movespeed / 2
|
---|
| 65 | attach_pen Pencil
|
---|
| 66 | set_pos Pencil, x1, y1
|
---|
| 67 | move Pencil, x2, y2
|
---|
| 68 | detach_pen Pencil
|
---|
| 69 | movespeed = movespeed * 2
|
---|
| 70 | end
|
---|
| 71 |
|
---|
| 72 | function rotate_compa Compa, radius, angle
|
---|
| 73 | local x, y
|
---|
| 74 | rotaspeed = rotaspeed/2
|
---|
| 75 | attach_pen Compa, radius, 0
|
---|
| 76 | get_pos &x, &y, Compa
|
---|
| 77 | set_pos Compa, x, y
|
---|
| 78 | move Compa, x, y, angle
|
---|
| 79 | detach_pen Compa
|
---|
| 80 | rotaspeed = rotaspeed*2
|
---|
| 81 | end
|
---|
| 82 |
|
---|
| 83 | function create_arc x1, y1, radius, start, end
|
---|
| 84 | appear Ruler, 1, 9
|
---|
| 85 | appear Compa
|
---|
| 86 | move Compa, 1, 9
|
---|
| 87 | call Compa.OpenCompa, radius
|
---|
| 88 | delay 18
|
---|
| 89 | disappear Ruler
|
---|
| 90 | move Compa, x1, y1, start
|
---|
| 91 | delay 3
|
---|
| 92 | rotate_compa Compa, radius, end
|
---|
| 93 | delay 12
|
---|
| 94 | disappear Compa
|
---|
| 95 | end
|
---|
| 96 |
|
---|
| 97 | function cut_polygon x1, y1, x2, y2
|
---|
| 98 | set_paper newPaper, 1, 0
|
---|
| 99 | get_angle &angle, x1, y1, x2, y2
|
---|
| 100 | appear Burin
|
---|
| 101 | move Burin, x1, y1, angle
|
---|
| 102 | delay 6
|
---|
| 103 | drag_pen Burin, x1, y1, x2, y2
|
---|
| 104 | delay 12
|
---|
| 105 | disappear Burin
|
---|
| 106 | clip x1, y1, x2, y2
|
---|
| 107 | disappear newPaper
|
---|
| 108 | set_paper Paper
|
---|
| 109 | end
|
---|
| 110 |
|
---|
| 111 | function show_bigtext TextName, TextData
|
---|
| 112 | disappear all
|
---|
| 113 | set_text Verdana, 18
|
---|
| 114 | appear TextName, 8, 4, TextData
|
---|
| 115 | set_text Arial, 15
|
---|
| 116 | wait_click
|
---|
| 117 | end
|
---|
| 118 |
|
---|
| 119 | function show_movie Picture, x1, y1, fileName, frame
|
---|
| 120 | disappear all
|
---|
| 121 | load_movie Picture, x1, y1, fileName, frame, "center"
|
---|
| 122 | wait_click
|
---|
| 123 | end
|
---|