]> git.sesse.net Git - casparcg/blob - deploy/general/server/template/scene/TemplatePack1/AdvancedTemplate1.scene
[scene] Created example scene that tries to emulate AdvancedTemplate1.ft. Uses the...
[casparcg] / deploy / general / server / template / scene / TemplatePack1 / AdvancedTemplate1.scene
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   A scene that tries to mimick the Flash template AdvancedTemplate1
4  -->
5 <scene width="1024" height="576" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/CasparCG/Server/2.1.0/core/producer/scene/scene.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
6   <variables>
7     <variable type="number" id="time" public="true">60</variable>
8     <variable type="number" id="hangaround_time" public="true">3</variable>
9
10     <!-- Controlled by timeline -->
11     <variable type="number" id="plate_x">0</variable>
12
13     <!-- Expressions good for time value between 0 and 3599. Can be extended to support hours as well -->
14     <variable type="number" id="countdown">             ${time - floor(frame / fps)}</variable>
15     <variable type="number" id="countdown_minutes">     ${floor(variable.countdown / 60)}</variable>
16     <variable type="number" id="countdown_seconds">     ${variable.countdown % 60}</variable>
17     <variable type="string" id="countdown_minutes_text">${(variable.countdown_minutes &lt; 10 ? "0" : "") + variable.countdown_minutes}</variable>
18     <variable type="string" id="countdown_seconds_text">${(variable.countdown_seconds &lt; 10 ? "0" : "") + variable.countdown_seconds}</variable>
19     <variable type="string" id="countdown_text">
20         ${variable.countdown &lt; 0
21                 ? "00:00"
22                 : variable.countdown_minutes_text + ":" + variable.countdown_seconds_text}
23     </variable>
24   </variables>
25
26   <layers>
27     <layer id="plate">
28       <!-- A PNG under media -->
29       <producer>scene/TemplatePack1/AdvancedTemplate1_plate</producer>
30       <x>${variable.plate_x}</x>
31       <y>60</y>
32       <anchor_x>${layer.plate.width}</anchor_x>
33     </layer>
34     <layer id="countdown">
35       <!-- Text producer -->
36       <producer>[TEXT] "" 0 0 size 40 color #444444 font LiberationSans</producer>
37       <!-- follow plate with minor adjustments -->
38       <x>${layer.plate.x - 20}</x>
39       <y>${layer.plate.y + layer.plate.height - 8}</y>
40       <anchor_x>${layer.countdown.width}</anchor_x>
41       <parameters>
42         <!-- Bind the text producer's published variable text to our countdown_text -->
43         <text>${variable.countdown_text}</text>
44       </parameters>
45     </layer>
46   </layers>
47
48   <marks>
49     <mark at="0" type="start" label="intro" />
50     <mark at="35" type="stop" />
51     <mark at="35" type="start" label="outro" />
52     <mark at="70" type="remove" />
53   </marks>
54
55   <tasks>
56     <!--
57         stop template automatically after the timer has been at 0 for
58         ${hangaround_time} seconds
59     -->
60     <goto_mark label="outro" when="${variable.countdown &lt;= -hangaround_time}" />
61   </tasks>
62
63   <!--
64     The timeline in this template is only for animating in and out, The actual
65     countdown is done entirely through expressions.
66   -->
67   <timelines>
68     <timeline variable="variable.plate_x">
69       <keyframe at="0">0</keyframe>
70       <keyframe at="35" easing="easeoutsine">250</keyframe>
71       <keyframe at="70" easing="easeinsine">0</keyframe>
72     </timeline>
73   </timelines>
74 </scene>