Debian Codegraph @

examples/kate/demo.kate

raw
1 /* A random selection of what can be done */
2
3 kate {
4
5 defs {
6 /* the entire set of events can be offset */
7 timebase 00:00.50
8
9 /* as in cpp, but no parameters, simple text replacement */
10 define macro bgcol 128 160 255 127
11 define macro lighttransgrey 128 128 128 96
12 define macro white_text 192 192 192 255
13
14 define motion "centerbox_motion" {
15 semantics region size
16 mapping frame
17 curve { none } for 60%
18 curve { linear 4 points { 0.7 0.7 0.2 0.5 0.5 0.2 0.7 0.7 } } for 30%
19 curve { none } for 10%
20 }
21
22 /* multiline macros - beware the spaces after the backslashes */
23 define macro centerbox_text_prologue \
24 00:13.00 --> 00:15.00 \
25 motion "centerbox_motion" \
26 region "centerbox" \
27 style "centerbox" /* namespaces for macros, regions, styles, etc, are separate */
28
29 define motion "321fader_size" {
30 semantics text size
31 curve { static 1 points { 16 16 } } for 50%
32 curve { linear 2 points { 16 16 128 128 } } for 500000m
33 }
34 define motion "321fader_alpha" {
35 semantics text color ba
36 curve { none } for 50%
37 curve { bspline 3 points { 255 255 255 74 255 0 } } for 50%
38 }
39
40 define macro start321fader \
41 region "321" \
42 motion "321fader_size" \
43 motion "321fader_alpha"
44
45 /* really detailed spiral motion */
46 define curve "spiral" {
47 linear 100 points {
48 0.500000 0.500000
49 0.500782 0.504938
50 0.503090 0.509511
51 0.506810 0.513365
52 0.511756 0.516180
53 0.517678 0.517678
54 0.524271 0.517634
55 0.531185 0.515890
56 0.538042 0.512361
57 0.544446 0.507040
58 0.550000 0.500000
59 0.554323 0.491396
60 0.557063 0.481459
61 0.557915 0.470491
62 0.556631 0.458855
63 0.553033 0.446967
64 0.547023 0.435279
65 0.538589 0.424264
66 0.527812 0.414405
67 0.514861 0.406170
68 0.500000 0.400000
69 0.483574 0.396293
70 0.466008 0.395384
71 0.447791 0.397534
72 0.429466 0.402918
73 0.411612 0.411612
74 0.394828 0.423588
75 0.379714 0.438711
76 0.366852 0.456738
77 0.356785 0.477317
78 0.350000 0.500000
79 0.346908 0.524247
80 0.347831 0.549443
81 0.352984 0.574908
82 0.362467 0.599923
83 0.376256 0.623744
84 0.394199 0.645623
85 0.416012 0.664836
86 0.441287 0.680701
87 0.469495 0.692599
88 0.500000 0.700000
89 0.532069 0.702476
90 0.564894 0.699722
91 0.597608 0.691566
92 0.629313 0.677984
93 0.659099 0.659099
94 0.686074 0.635191
95 0.709387 0.606688
96 0.728254 0.574164
97 0.741984 0.538326
98 0.750000 0.500000
99 0.751861 0.460109
100 0.747275 0.419656
101 0.736117 0.379693
102 0.718435 0.341298
103 0.694454 0.305546
104 0.664580 0.273475
105 0.629387 0.246063
106 0.589615 0.224194
107 0.546148 0.208632
108 0.500000 0.200000
109 0.452287 0.198755
110 0.404205 0.205172
111 0.356993 0.219333
112 0.311909 0.241115
113 0.270190 0.270190
114 0.233024 0.306031
115 0.201513 0.347913
116 0.176641 0.394934
117 0.159248 0.446030
118 0.150000 0.500000
119 0.149371 0.555534
120 0.157620 0.611246
121 0.174783 0.665707
122 0.200664 0.717481
123 0.234835 0.765165
124 0.276642 0.807426
125 0.325214 0.843038
126 0.379483 0.870912
127 0.438208 0.890137
128 0.500000 0.900000
129 0.563356 0.900014
130 0.626697 0.889933
131 0.688406 0.869768
132 0.746870 0.839787
133 0.800520 0.800520
134 0.847877 0.752748
135 0.887588 0.697486
136 0.918465 0.635967
137 0.939521 0.569613
138 0.950000 0.500000
139 0.949398 0.428822
140 0.937486 0.357852
141 0.914318 0.288894
142 0.880238 0.223741
143 0.835876 0.164124
144 0.782137 0.111672
145 0.720185 0.067862
146 0.651418 0.033982
147 0.577435 0.011094
148 }
149 }
150
151 /* vorbis comments */
152 comment "foo=bar"
153 comment "baz=quux"
154
155 /* predefined styles to be referenced in data packets */
156 define style "katetv" { text color 128 160 192 192 hright vcenter }
157 define style "scrollbar_band" { background color $bgcol }
158 define style "centerbox" { text color $white_text }
159 define style "centerbox_bg" { background color $lighttransgrey }
160 define style "scrollbar_text" { text color 192 192 192 255 vcenter hcenter }
161 define style "321" { text color 255 255 255 255 vcenter hcenter }
162
163 define style "morph_src" { text color 128 192 240 255 vtop hcenter }
164 define style "morph_dst" { text color 0 0 0 255 vbottom hcenter }
165
166 /* predefined regions to be referenced in data packets */
167 define region "katetv" { percent position -20 5 size 115 5 clip default style "katetv" }
168 define region "scrollbar" { percent position 0 85 size 100 10 clip default style "scrollbar_text" }
169 define region "centerbox" { percent position 15 15 size 70 70 default style "centerbox" }
170 define region "321" { percent position 0 0 size 100 100 default style "321" }
171
172 /* predefined curves to be referenced in data packets */
173 define curve "r2l scroller" { linear 2 points { 1.0 0.0 -1.0 0.0 } } # right to left scroller
174 define curve "l2r scroller" { linear 2 points { -1.0 0.0 1.0 0.0 } } # left to right scroller
175
176 define motion "r2l_scroll_motion" { semantics external text alignment curve "r2l scroller" }
177 }
178
179 /* scrolling text with varying speed */
180 event {
181 //from 0:0.1 to 0:2.0
182 from 0:0.1 to 0:2.0
183 text "KateTV"
184 region "katetv"
185 motion { semantics text alignment curve { linear 2 points { -1 0 1 0 } } }
186 motion { semantics time mapping event duration curve { bspline 3 points { 0 0 0.907 0 1 0 } } }
187 }
188
189 /* zooming/alpha 3-2-1 sequence */
190 event { from 0:0.50 for 1.0 $start321fader text "3" }
191
192 event { from 0:1.50 for 1.0 $start321fader text "2" }
193
194 /* replace the logo once it's settled on the corner */
195 event { from 0:2.0 to 22.50 text "KateTV" region "katetv" }
196
197 event { from 0:2.50 for 1.0 $start321fader text "1" }
198
199 /* GO whips around the screen on a spline */
200 event {
201 00:03.50 --> 00:5.50
202 // /* making the text a long series of dots draws the spline on the screen, good for creating paths */
203 // //text "............................................................."
204 //text "GO !!!!!"
205 text "GO !!!!!\nmultiline path"
206 style { font size 32 }
207 motion {
208 semantics text path
209 mapping frame
210 //curve { catmull_rom 8 points { 1.1 0.7 1.0 0.7 0.3 0.3 0.4 0.66 0.66 0.5 0.4 0.2 0.0 0.6 -0.1 0.6 } }
211 curve { catmull_rom 6 points { 1.0 0.7 0.3 0.3 0.4 0.66 0.66 0.5 0.4 0.2 0.0 0.6 } }
212 }
213 motion {
214 /* slow down in the middle */
215 semantics time
216 mapping event duration
217 //curve { catmull_rom 7 points { 0 0 0.05 0.05 0.3 0.3 0.5 0.5 0.7 0.7 0.95 0.95 1 1 } }
218 curve { catmull_rom 5 points { 0 0 0.3 0.3 0.5 0.5 0.7 0.7 1 1 } }
219 }
220 motion {
221 /* go back through the path */
222 semantics text path section
223 curve { linear 2 points { 1.0 0.95 0.05 0.0 } }
224 }
225 motion {
226 semantics text size
227 curve { linear 3 points { 16 16 64 64 16 16 } }
228 }
229 }
230
231 /* random color animation */
232 event {
233 from 00:04.00 to 00:12.00
234 region { percent position 10 5 size 10 5 }
235 text "COLOR"
236 motion {
237 semantics text color rg
238 curve { catmull_rom 8 points { 255 53 79 129 92 240 56 169 237 78 189 230 120 210 78 32 } }
239 }
240 motion {
241 semantics text color ba
242 curve { catmull_rom 8 points { 90 73 255 12 76 200 78 192 60 70 20 50 255 255 80 127 } }
243 }
244 }
245
246 /* multiline text, and alignment animation */
247 event {
248 from 00:04.00 to 00:06.00
249 region "centerbox"
250 text "
251 A multiline text\n
252 a second line\n
253 and the third and last one
254 "
255 style "centerbox" { hleft vcenter }
256 /* do some move-to-right and move-to-left at the end */
257 motion {
258 semantics text alignment
259 curve { none } for 60%
260 curve "l2r scroller" for 15%
261 curve "r2l scroller" for 15%
262 curve { none } for 10%
263 }
264 }
265
266 event {
267 from 00:04.00 to 00:06.00
268 directionality rtl_ttb
269 language "ar"
270 region "centerbox"
271 text "ﺳﻼﻡ\n"
272 + "ﺳﻼﻡ\n"
273 + "ﺳﻼﻡ\n"
274 style "centerbox" { vcenter hright }
275 /* do some move-to-left and move-to-right at the end */
276 motion {
277 semantics text alignment
278 curve { none } for 60%
279 curve "r2l scroller" for 15%
280 curve "l2r scroller" for 15%
281 curve { none } for 10%
282 }
283 }
284
285 /* arbitrary motion of the text (on a spline) */
286 event {
287 00:05.00 --> 00:10.00
288 text "SPIRAL"
289 motion {
290 semantics text position
291 mapping frame
292 curve "spiral"
293 }
294 }
295
296 /* no text - just to set a style (so we have a colored background shared by all scrolling text) */
297 event {
298 from 00:06.00 to 00:22.50
299 region "scrollbar"
300 style "scrollbar_band"
301 }
302
303 event {
304 00:06.00 --> 00:10.00
305 region "scrollbar"
306 text "This is a scrolling text"
307 motion "r2l_scroll_motion"
308 }
309
310 /* non linear morphing between two styles */
311 event {
312 00:08.0 --> 00:12.0
313 text "style morph"
314 region { percent position 30 30 size 40 30 }
315 style "morph_src"
316 secondary style "morph_dst"
317 motion {
318 semantics style morph
319 curve { none } for 10%
320 curve { linear 4 points { 0 0 0.75 0 0.25 0 1 0 } } for 90%
321 }
322 }
323
324 /* non latin characters, but still likely to be found in a lot of fonts */
325 event {
326 00:09.00 --> 00:13.00
327 region "scrollbar"
328 text "non ASCII latin: ÑÓǨù¿Àß"
329 motion "r2l_scroll_motion"
330 }
331
332 /* Katakana, probably needs a non default font */
333 event {
334 id 123456789
335 00:12.00 --> 00:18.00
336 language "ja"
337 region "scrollbar"
338 text "Katakana (may need another font) ゴウジス"
339 motion "r2l_scroll_motion"
340 }
341
342 event {
343 00:13.00 --> 00:15.00
344 region "centerbox"
345 style "centerbox_bg"
346 }
347
348 /* various alignments */
349 event { $centerbox_text_prologue { vtop hleft } text "T/L" }
350 event { $centerbox_text_prologue { vtop hright } text "T/R" }
351 event { $centerbox_text_prologue { vbottom hleft } text "B/L" }
352 event { $centerbox_text_prologue { vbottom hright } text "B/R" }
353 event { $centerbox_text_prologue { vcenter hright } text "C/R" }
354 event { $centerbox_text_prologue { vcenter hleft } text "C/L" }
355 event { $centerbox_text_prologue { vtop hcenter } text "T/C" }
356 event { $centerbox_text_prologue { vbottom hcenter } text "B/C" }
357 event { $centerbox_text_prologue { vcenter hcenter } text "C/C" }
358
359 event {
360 00:20.00 --> 00:22.50
361 region "scrollbar"
362 text "Still there ? It's over actually"
363 //style "scrollbar_text"
364 motion {
365 semantics external text alignment
366 curve { none } for 80%
367 curve { linear 2 points { 0 0 -1 0 } } for 20%
368 }
369 }
370 }
371
372