<?xml version="1.0" encoding="utf-8"?>
<m3danim length="10">
  <video-clips>
    <random-movie-clip-playlist name="movie0" only-from="movie0" length="10" clip-length="3.33"/>
    <random-movie-clip-playlist name="movie1" only-from="movie1" length="10" clip-length="3.33"/>
    <random-movie-clip-playlist name="movie2" only-from="movie2" length="10" clip-length="3.33"/>    
  </video-clips>

  <render-targets>
    <render-target texture="label_movie0" size="256"/>
    <render-target texture="label_movie1" size="256"/>
    <render-target texture="label_movie2" size="256"/>
  </render-targets>
  
  <viewports>
    <viewport name="menu" world="menu">
      <projection-transform>
        <menu-screen/>
      </projection-transform>
    </viewport>
    <viewport name="label_movie0" world="label_movie0">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="label_movie1" world="label_movie1">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    <viewport name="label_movie2" world="label_movie2">
      <projection-transform>
        <orthogonal/>
      </projection-transform>
    </viewport>
    
  </viewports>
  <worlds>

    <world name="label_movie0">
      <container>
        <text text-id="button.movie0" font-weight="bold" font-name="Arial Bold" font-size="30" align="center" valign="top" font-color="#FFACD4EF">
        </text>
        <transforms>
          <scale x="1" y="1" />
          <translate y="-1" />
        </transforms>
      </container>
    </world>

    <world name="label_movie1">
      <container>
        <text text-id="button.movie1" font-weight="bold" font-name="Arial Bold" font-size="30" align="center" valign="top" font-color="#FFACD4EF">
        </text>
        <transforms>
          <scale x="1" y="1" />
          <translate y="-1" />
        </transforms>
      </container>
    </world>

    <world name="label_movie2">
      <container>
        <text text-id="button.movie2" font-weight="bold" font-name="Arial Bold" font-size="30" align="center" valign="top" font-color="#FFACD4EF">
        </text>
        <transforms>
          <scale x="1" y="1" />
          <translate y="-1" />
        </transforms>
      </container>
    </world>
    
    
    <world name="menu">
      <trianglestrip>
        <xyz>
          0.5   -0.5  0.0
          -0.5  -0.5  0.0
          0.5   0.5   0.0
          -0.5  0.5   0.0
        </xyz>
        <texcoord>
          1 0 
		  0 0 
		  1 1 
		  0 1
        </texcoord>
        <texture static-src="background.png"/>
        <transforms>
          <translate x="0.5" y="0.5"/>
          <scale x="1.640625" y="1.2"/>
        </transforms>
      </trianglestrip>

		<container>
		<transforms>
			<translate y="-0.07"/>				
		</transforms>
		  		  
		  <if video-clip="movie0">
	      <container>
	        <rect>
	          <texture video-clip="movie0"/>
	          <transforms>
	            <scale x="0.12890625" y="-0.171875"/>
	          </transforms>
	        </rect>
	        <trianglestrip>
	          <xyz>
	            .5   -.5  0.0
	            -.5  -.5  0.0
	            .5   .5   0.0
	            -.5  .5   0.0
	          </xyz>
	          <texcoord>
	            1 0 
				0 0 
				1 1 
				0 1
	          </texcoord>
	          <texture static-src="frame.png"/>
	          <transforms>
	            <scale x="0.3125" y="0.4166666666"/>
	          </transforms>
	        </trianglestrip>

          <trianglestrip>
            <xyz>
              0.2		-0.2666666666	0.0
              -0.2	-0.2666666666	0.0
              0.2		0.2666666666	0.0
              -0.2	0.2666666666	0.0
            </xyz>
            <texcoord>
              1.0   0.0
              0.0   0.0
              1.0   1.0
              0.0   1.0
            </texcoord>
            <texture render-target="label_movie0"/>
            <transforms>
              <translate y="-0.04" />
              <scale y="-0.7" x="0.7" />
            </transforms>
          </trianglestrip>

          <transforms>
            <translate x="0.2" y="0.5"/>
          </transforms>
        </container>
      </if>

      <if video-clip="movie1">
        <container>
          <rect>
            <texture video-clip="movie1"/>
            <transforms>
              <scale x="0.12890625" y="-0.171875"/>
            </transforms>
          </rect>

          <trianglestrip>
            <xyz>
              .5   -.5  0.0
              -.5  -.5  0.0
              .5   .5   0.0
              -.5  .5   0.0
            </xyz>
            <texcoord>
              1 0
              0 0
              1 1
              0 1
            </texcoord>
            <texture static-src="frame.png"/>
            <transforms>
              <scale x="0.3125" y="0.4166666666"/>
            </transforms>
          </trianglestrip>

          <trianglestrip>
            <xyz>
              0.2		-0.2666666666	0.0
              -0.2	-0.2666666666	0.0
              0.2		0.2666666666	0.0
              -0.2	0.2666666666	0.0
            </xyz>
            <texcoord>
              1.0   0.0
              0.0   0.0
              1.0   1.0
              0.0   1.0
            </texcoord>
            <texture render-target="label_movie1"/>
            <transforms>
              <translate y="-0.04" />
              <scale y="-0.7" x="0.7" />
            </transforms>
          </trianglestrip>

          <transforms>
            <translate x="0.5" y="0.5"/>
          </transforms>
        </container>
      </if>

      <if video-clip="movie2">
        <container>
          <rect>
            <texture video-clip="movie2"/>
            <transforms>
              <scale x="0.12890625" y="-0.171875"/>
            </transforms>
          </rect>
          <trianglestrip>
            <xyz>
              .5   -.5  0.0
              -.5  -.5  0.0
              .5   .5   0.0
              -.5  .5   0.0
            </xyz>
            <texcoord>
              1 0
              0 0
              1 1
              0 1
            </texcoord>
            <texture static-src="frame.png"/>
            <transforms>
              <scale x="0.3125" y="0.4166666666"/>
            </transforms>
          </trianglestrip>

          <trianglestrip>
            <xyz>
              0.2		-0.2666666666	0.0
              -0.2	-0.2666666666	0.0
              0.2		0.2666666666	0.0
              -0.2	0.2666666666	0.0
            </xyz>
            <texcoord>
              1.0   0.0
              0.0   0.0
              1.0   1.0
              0.0   1.0
            </texcoord>
            <texture render-target="label_movie2"/>
            <transforms>
              <translate y="-0.04" />
              <scale y="-0.7" x="0.7" />
            </transforms>
          </trianglestrip>
          
          
	        <transforms>
	          <translate x="0.8" y="0.5"/>
	        </transforms>
	      </container>
		  </if>
		</container>
		
		<!-- Nav Buttons -->
		<container>
			<transforms>
				<translate y="0.6" x="0.5"/>
			</transforms>
			<if bool="prevpage">
				<trianglestrip>
					<xyz>
						0.0		0.0 	0.0
						-0.2	0.0 	0.0
						0.0		0.26666 0.0
						-0.2	0.26666 0.0
					</xyz>
					
					<texcoord>
			            1.0 0.0 
						0.0 0.0
						1.0 1.0 
						0.0 1.0				
					</texcoord>
					
					<texture static-src="button_prev.png"/>
					<transforms>
						<translate x="-0.06"/>
					</transforms>				
				</trianglestrip>
			</if>
			<if bool="pageup">
				<trianglestrip>
					<xyz>
						0.1 	0.0 	0.0
						-0.1 	0.0 	0.0
						0.1 	0.26666 0.0
						-0.1	0.26666 0.0
					</xyz>
					
					<texcoord>
			            1.0 0.0 
						0.0 0.0
						1.0 1.0 
						0.0 1.0				
					</texcoord>
					
					<texture static-src="button_up.png"/>
				</trianglestrip>
			</if>
			<if bool="nextpage">
				<trianglestrip>
					<xyz>
						0.0 	0.0 	0.0
						0.2 	0.0 	0.0
						0.0 	0.26666 0.0
						0.2		0.26666 0.0
					</xyz>
					
					<texcoord>
			            1.0 0.0 
						0.0 0.0
						1.0 1.0 
						0.0 1.0				
					</texcoord>
					
					<texture static-src="button_prev.png"/>
					<transforms>
						<translate x="0.06"/>
					</transforms>
				</trianglestrip>
			</if>
		</container>
	  
    </world>
  </worlds>
  <initial-render-instructions>
    <render-to clear-color="#00FFFFFF" texture="label_movie0" viewport="label_movie0"/>
    <render-to clear-color="#00FFFFFF" texture="label_movie1" viewport="label_movie1"/>
    <render-to clear-color="#00FFFFFF" texture="label_movie2" viewport="label_movie2"/>
  </initial-render-instructions>
  <render-instructions>  
    <render-to clear-color="#FF00FFAA" buffer="back" viewport="menu"/>
  </render-instructions>
</m3danim>
