local graphic = "Level_G";

local t = Def.ActorFrame {

	Def.ActorFrame {



		LoadActor(graphic)..{
			Name="Gra1";
		};	

		LoadActor(graphic)..{
			Name="Gra2";
		};	

		LoadActor(graphic)..{
			Name="Gra3";
		};	

		LoadActor(graphic)..{
			Name="Gra4";
		};	

		LoadActor(graphic)..{
			Name="Gra5";
		};	

		LoadActor(graphic)..{
			Name="Gra6";
		};	

		LoadActor(graphic)..{
			Name="Gra7";
		};	

		LoadActor(graphic)..{
			Name="Gra8";
		};	

		LoadActor(graphic)..{
			Name="Gra9";
		};	

		LoadActor(graphic)..{
			Name="Gra10";
		};	

		LoadActor(graphic)..{
			Name="Gra11";
		};	

		LoadActor(graphic)..{
			Name="Gra12";
		};	


	
	
		OnCommand=cmd(playcommand,"Set");
		CurrentStepsP1ChangedMessage=cmd(playcommand,"Set");
		CurrentStepsP2ChangedMessage=cmd(playcommand,"Set");
		CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
		SetCommand=function(self)

			local spacing = 36;

			local song = GAMESTATE:GetCurrentSong();
						
			local masternum = GAMESTATE:GetMasterPlayerNumber();			
						
			local steps = GAMESTATE:GetCurrentSteps( masternum );
			local diff = 0;
			
			if song and steps then
				diff = steps:GetMeter();
			end;

			local maxw = diff * spacing;

			for count=1,12 do

				local graname = "Gra" .. count;
				Trace(graname);
				local elem = self:GetChild(graname);

				elem:x(SCREEN_WIDTH/2.04 - 12 + count*spacing - maxw/2);
				elem:y(SCREEN_HEIGHT/2+130);

				if count <= diff then
					elem:visible(true);
				else
					elem:visible(false);
				end;

			end;
		end;


	};
};

return t;		



