8dd37864b5c64a07a0e2fb2fa356508d8b48cd4e
[swftools.git] / doc / Bugs / BadPins.sc
1 # Pins.sc
2 # tutorial on Pins for the user.
3
4 .swf bbox=autocrop version=4 fps=25 name="Pins.swf"
5
6 .sprite reticle
7         .box box width=5 height=5 color=yellow
8         .put b1=box 0 0
9         .put b2=box 5 0
10         .put b3=box 0 5
11         .put b4=box 5 5
12 .end
13 #
14 .circle pin 8 color=blue fill=blue
15 #
16 .font helv "HelveticaBold.swf"
17 #
18 .text mesg1 text="(1) This tutorial explains \"pins\" . . ." font=helv color=yellow size=25%
19 .text mesg2 text="(2) Every object such as this simple box ..." font=helv color=red size=25%
20 .text mesg3 text="(3) ... is \"pinned\" to a screen x,y." font=helv color=yellow size=25%
21 .text mesg4 text="(4) The yellow reticle is at 100,100..." font=helv color=yellow size=25%
22 .text mesg5 text="(5) The box's \"pin\" is at (relative to the box) 0,0." font=helv color=green size=25%
23 .text mesg6 text="(6) When we .put the box at 100,100, its pin lands..." font=helv color=blue size=25%
24 .text mesg7 text="(7) ... on 100,100." font=helv color=yellow size=25%
25 #
26 .text mesg8 text="(8) Relative 0,0 is the default pin for placement." font=helv color=yellow size=25%
27 .text mesg9 text="(9) If we rotate..." font=helv color=red size=25%
28
29 .box box1 width=100 height=100 color=red line=5     # a simple red box
30     
31 .frame 0  
32         .put mesg1 x=0 y=10             # mesg1 bright 
33         .put box1 x=100 y=100 alpha=0
34 .frame 20
35         .change mesg1                   # mesg 1 hold
36 .frame 40
37         .change mesg1 alpha=0           # mesg 1 fade
38         .put mesg2 x=0 y=10 alpha=0     # mesg 2 placed  (new message placed during old fade)
39 .frame 60
40         .del mesg1                      # mesg 1 gone
41         .change mesg2 alpha=100%        # MESG 2 bright  *** a "slide" lasts 40 frames
42         .change box1 alpha=100%         # box bright
43 .frame 80
44         .change mesg2                   # mesg 2 hold 
45         .change box1                    # box hold
46         .change box1 alpha=0            # box fade
47 .frame 100
48         .change mesg2 alpha=0           # mesg 2 fade
49         .put mesg3 x=0 y=10 alpha=0     # mesg 3 placed
50 .frame 120
51         .del mesg2                      # mesg 2 gone
52         .change mesg3 alpha=100%        # mesg 3 bright ***
53         .jump box1 alpha=100%           # make the box appear suddenly and leap around a bit
54 .frame 125
55         .jump box1 x+=20 y+=20          # BUG?  why doesn't this work?  am I confused?
56 .frame 130
57         .jump box1 x-=20                # shouldn't the box be dancing around the screen?
58 .frame 135
59         .jump box1 x-=20 y-=20
60 .frame 140
61         .change mesg3                   # mesg 3 hold
62         .jump box1 x=100 y=100          # put box bck where it belongs
63 .frame 160
64         .change mesg3 alpha=0           # mesg 3 fade
65         .put mesg4 x=0 y=10 alpha=0     # mesg 4 placed
66         .put pin 100 100 alpha=0 pin=center     # pin placed (dark, bottom layer)
67         .put reticle 100 100 alpha=0 pin=center # place reticle (dark, top layer)
68         .change box1 alpha=0            # box fade
69 .frame 180
70         .del mesg3                      # mesg 3 gone
71         .change mesg4 alpha=100         # mesg 4 bright ***
72         .change reticle alpha=100%      # reticle bright
73 .frame 200
74         .change mesg4                   # mesg 4 hold
75         .change reticle                 # hold reticle
76 .frame 220
77         .change mesg4 alpha=0           # mesg 4 fade
78         .put mesg5 x=0 y=10 alpha=0     # mesg 5 placed
79         .change reticle alpha=0         # reticle dark
80 .frame 240
81         .del mesg4                      # mesg 4 gone
82         .change mesg5 alpha=100%        # mesg 5 bright ***
83         .change box1 alpha=100%         # box bright
84         .change pin alpha=100%          # pin bright
85 .frame 260
86         .change mesg5                   # mesg 5 hold
87 .frame 280
88         .change mesg5 alpha=0           # mesg 5 fade
89         .put mesg6 x=0 y=10 alpha=0     # mesg 6 placed
90 .frame 300
91         .del mesg5                      # mesg 5 gone
92         .change mesg6 alpha=100%        # mesg 6 bright  ***
93         .jump pin blue=0 red=+100%      # blink the pin
94 .frame 305
95         .jump pin blue=100% red=0
96 .frame 310
97         .jump pin blue=0 red=+100%
98 .frame 315
99         .jump pin blue=100% red=0
100 .frame 320
101         .change mesg6                   # mesg 6 hold
102 .frame 340
103         .change mesg6 alpha=0           # mesg 6 fade
104         .put mesg7  x=0 y=10 alpha=0    # mesg7 placed
105         .change reticle                 # hold that reticle!
106 .frame 360
107         .change mesg7 alpha=100%        # mesg7 bright  ***
108         .change reticle alpha=100%
109 .frame 380
110         .change mesg7                   # mesg 7 hold
111 .frame 400
112         .change mesg7 alpha=0           # mesg 7 fade
113         .put mesg8 x=0 y=10 alpha=0     # mesg 8 placed
114 .frame 420
115         .del mesg7                      # mesg 7 gone
116         .change mesg8 alpha=100%        # mesg 8 bright ***
117 .frame 440
118         .change mesg8                   # mesg 8 hold
119 .frame 460
120         .change mesg8 alpha=0           # mesg 8 fade
121 .frame 480
122         .del mesg8                      # mesg 8 gone
123 .frame 500
124 .frame 520
125 .end
126
127
128 # life cycle of text
129 #       .put mesg6 x=0 y=10 alpha=0     # mesg 6 placed
130 #       .change mesg6 alpha=100%        # mesg 6 bright
131 #       .change mesg6                   # mesg 6 hold
132 #       .change mesg6 alpha=0           # mesg 6 fade
133 #       .del mesg6                      # mesg 6 gone