<ActorFrame FOV="60"> <children>
	<ActorFrame Command="queuecommand,Icon" IconCommand="%function() StyleIcon() end" />
	<ActorFrame Command="%function() if GAMESTATE:GetCoinMode() == 1 and not GetPref('EventMode') then rateMods = rateModsPay else rateMods = rateModsFree end end" />
	
	<Layer Type="Quad"
		InitCommand="%function(self)
		
			function modulo(a, b)
				return a - math.floor(a/b)*b;
			end
			
			function randomXD(t)
				if t == 0 then return 0.5 else
				return modulo(math.sin(t * 3229.3) * 43758.5453, 1) end
			end
		
			theme_ptime = 0
		end"
		OnCommand="hidden,1;queuecommand,Update"
		UpdateCommand="%function(self)
		
			SCREENMAN:GetTopScreen():fov(50)
			
			theme_plasmaShader:uniform1f('ptime',theme_ptime)
			
			theme_ptime = theme_ptime+1/60
			
			for i=1,4 do
				local a = _G['dop_escher_'..i]
				if a then
					a:addx( .06*math.sin(theme_ptime*math.pi*.1 + math.pi*2*randomXD(i*100) ) )
					a:addy( .08*math.cos(theme_ptime*math.pi*.08 + math.pi*2*randomXD(i*100) ) )
					a:rotationz( 10*math.sin(theme_ptime*math.pi*.06 + math.pi*2*randomXD(i*100) ) )
				end
			end
			
			self:sleep(1/60)
			self:queuecommand('Update')
			
		end"
	/>
	
	<ActorFrame OnCommand="fov,60;" ><children>
	
		<Layer Var="dop_escher_sky" File="escher/sky" OnCommand="stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT;hidden,0" />
		
		<Layer File="tex_bayer" Var="tex_bayer" OnCommand="hidden,1" />
		<Layer
			Shader="shader/plasma.frag"
			File="_black"
			OnCommand="%function(self) theme_plasmaShader = self:GetShader() theme_plasmaShader:uniformTexture('bayer',tex_bayer:GetTexture()) end"
			InitCommand="stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT;hidden,0;diffusealpha,.5"
		/>
		
		<Layer Type="ActorFrame" OnCommand="fov,60;hidden,0" ><children>
			
			<Layer File="escher/1" Var="dop_escher_1" OnCommand="xy,SCREEN_CENTER_X-90,SCREEN_CENTER_Y-110;zoom,.4;diffuse,.5,.5,.5,1;" />
			<Layer File="escher/2" Var="dop_escher_2" OnCommand="xy,SCREEN_CENTER_X+130,SCREEN_CENTER_Y-50;zoom,.7;diffuse,.5,.5,.5,1;" />
			<Layer File="escher/3" Var="dop_escher_3" OnCommand="xy,SCREEN_CENTER_X-180,SCREEN_CENTER_Y+20;zoom,.8;diffuse,.5,.5,.5,1;" />
			<Layer File="escher/4" Var="dop_escher_4" OnCommand="xy,SCREEN_CENTER_X+190,SCREEN_CENTER_Y+90;zoom,.8;diffuse,.5,.5,.5,1;" />
			
			<Layer File="escher/5" Var="dop_escher_5" OnCommand="hidden,1;xy,SCREEN_CENTER_X-250,SCREEN_CENTER_Y-200;zoom,.9;diffuse,.5,.5,.5,1;" />
			
		</children></Layer>
		
		<Layer Type="Quad" OnCommand="stretchto,0,0,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,0,0,0,.5" />
	
	</children></ActorFrame>
	
	
		
	<ActorFrame OnCommand="hidden,0;fov,60;xy,SCREEN_CENTER_X+160,SCREEN_CENTER_Y-138;rotationy,15;rotationx,-15;" FarDist="100000" Var="theme_portal_1" ><children>
		<Layer Type="Polygon"
			DrawMode="quads"
			OnCommand="%function(self)
			
				self:spin()
				self:effectmagnitude(0,0,180)
			
				self:zoom(120)
				self:zoomz(40)
				
				local rings = 16
				local strips = 16
				
				self:diffuse(.7,.7,.7,.7)
				
				--self:SetPolygonMode(1)
				
				self:SetNumVertices(rings*strips*4)
				
				for j=0,rings-1 do
					
					for i=0,strips-1 do
						
						local v = strips*j*4 + i*4
						
						local ang1 = (i/strips)*2*math.pi
						local ang2 = ((i+1)/strips)*2*math.pi
						
						local r1 = 1-(j/rings)
						local r2 = 1-((j+1)/rings)
						
						local jadd1 = math.pi*0.5*(j)/rings
						local jadd2 = math.pi*0.5*(j+1)/rings
						
						local z1 = (1-math.pow(j,2))/50
						local z2 = (1-math.pow(j+1,2))/50
						
						self:SetVertexPosition(v+0,r1*math.sin(ang1+jadd1),-r1*math.cos(ang1+jadd1),z1)
						self:SetVertexPosition(v+1,r1*math.sin(ang2+jadd1),-r1*math.cos(ang2+jadd1),z1)
						self:SetVertexPosition(v+2,r2*math.sin(ang2+jadd2),-r2*math.cos(ang2+jadd2),z2)
						self:SetVertexPosition(v+3,r2*math.sin(ang1+jadd2),-r2*math.cos(ang1+jadd2),z2)
						
						local r1,g1,b1 = .3*(1-(j/rings)),.0*(1-(j/rings)),.5*(1-(j/rings))
						local r2,g2,b2 = .3*(1-((j+1)/rings)),.0*(1-((j+1)/rings)),.5*(1-((j+1)/rings))
						if math.mod(i,2) == 0 then
							r1,g1,b1 = .4*(1-(j/rings)),.1*(1-(j/rings)),.6*(1-(j/rings))
							r2,g2,b2 = .4*(1-((j+1)/rings)),.1*(1-((j+1)/rings)),.6*(1-((j+1)/rings))
						end
						self:SetVertexColor(v+0,r1,g1,b1,1)
						self:SetVertexColor(v+1,r1,g1,b1,1)
						self:SetVertexColor(v+2,r2,g2,b2,1)
						self:SetVertexColor(v+3,r2,g2,b2,1)
						
					end
					
				end
				
			end"
		/>
	</children></ActorFrame>
	
	<ActorFrame OnCommand="hidden,0;fov,60;xy,SCREEN_CENTER_X-160,SCREEN_CENTER_Y+138;rotationy,-15;rotationx,-20" FarDist="100000" Var="theme_portal_2" ><children>
		<Layer Type="Polygon"
			DrawMode="quads"
			OnCommand="%function(self)
			
				self:spin()
				self:effectmagnitude(0,0,180)
			
				self:zoom(120)
				self:zoomz(40)
				
				local rings = 16
				local strips = 16
				
				self:diffuse(.7,.7,.7,.7)
				
				--self:SetPolygonMode(1)
				
				self:SetNumVertices(rings*strips*4)
				
				for j=0,rings-1 do
					
					for i=0,strips-1 do
						
						local v = strips*j*4 + i*4
						
						local ang1 = (i/strips)*2*math.pi
						local ang2 = ((i+1)/strips)*2*math.pi
						
						local r1 = 1-(j/rings)
						local r2 = 1-((j+1)/rings)
						
						local jadd1 = math.pi*0.5*(j)/rings
						local jadd2 = math.pi*0.5*(j+1)/rings
						
						local z1 = (1-math.pow(j,2))/50
						local z2 = (1-math.pow(j+1,2))/50
						
						self:SetVertexPosition(v+0,r1*math.sin(ang1+jadd1),-r1*math.cos(ang1+jadd1),z1)
						self:SetVertexPosition(v+1,r1*math.sin(ang2+jadd1),-r1*math.cos(ang2+jadd1),z1)
						self:SetVertexPosition(v+2,r2*math.sin(ang2+jadd2),-r2*math.cos(ang2+jadd2),z2)
						self:SetVertexPosition(v+3,r2*math.sin(ang1+jadd2),-r2*math.cos(ang1+jadd2),z2)
						
						local r1,g1,b1 = .3*(1-(j/rings)),.0*(1-(j/rings)),.5*(1-(j/rings))
						local r2,g2,b2 = .3*(1-((j+1)/rings)),.0*(1-((j+1)/rings)),.5*(1-((j+1)/rings))
						if math.mod(i,2) == 0 then
							r1,g1,b1 = .4*(1-(j/rings)),.1*(1-(j/rings)),.6*(1-(j/rings))
							r2,g2,b2 = .4*(1-((j+1)/rings)),.1*(1-((j+1)/rings)),.6*(1-((j+1)/rings))
						end
						self:SetVertexColor(v+0,r1,g1,b1,1)
						self:SetVertexColor(v+1,r1,g1,b1,1)
						self:SetVertexColor(v+2,r2,g2,b2,1)
						self:SetVertexColor(v+3,r2,g2,b2,1)
						
					end
					
				end
				
			end"
		/>
	</children></ActorFrame>
		
	<ActorFrame OnCommand="x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y-138;draworder,-5;rotationz,10;wag;effectperiod,2;effectmagnitude,0,0,5;" ><children>
	
	<Layer 
		Type="BitmapText"
		Font="_misoreg small"
		Text="ARTIST"
		OnCommand="horizalign,right;ShadowLength,0;diffuse,#FFFFFF66;zoom,0.5;x,-105;y,58"
	/>
	<Layer 
		Type="BitmapText"
		Font="_misoreg small"
		Text="BPM"
		OnCommand="horizalign,right;ShadowLength,0;diffuse,#FFFFFF66;zoom,0.5;x,-105;y,78"
	/>
	<Layer 
		Type="BitmapText"
		Font="_misoreg small"
		Text="LENGTH"
		OnCommand="ShadowLength,0;diffuse,#FFFFFF66;zoom,0.5;x,0;y,78"
	/>
	
	</children></ActorFrame>
	
	<ActorFrame InitCommand="%SelectMusicInit" FirstUpdateCommand="%SelectMusic" CaptureCommand="%SongInfo" CurrentSongChangedMessageCommand="queuecommand,Capture" CurrentStepsP1ChangedMessageCommand="queuecommand,Capture" CurrentStepsP2ChangedMessageCommand="queuecommand,Capture" />
	
</children> </ActorFrame>