local index = Var("GameCommand"):GetIndex();
local sName = Var("GameCommand"):GetName();
local sText = Var("GameCommand"):GetText();

local genericGainFocusCmd = cmd(stoptweening;visible,true);
local genericLoseFocusCmd = cmd(visible,false);

local t = Def.ActorFrame{
	Name="Item"..index;
	GainFocusCommand=genericGainFocusCmd;
	LoseFocusCommand=genericLoseFocusCmd;

	LoadActor( THEME:GetPathG("","_toasty/"..sName) )..{
		InitCommand=cmd(x,-SCREEN_WIDTH/4);
		BeginCommand=function(self)
			-- zoom out snorlax and foy
			if sName == "Snorlax" or sName == "Foy" then
				self:zoom(0.6);
				self:y(0);
			else
				self:zoom(1);
				self:y(0);
			end;
		end;
	};

	Def.ActorFrame{
		InitCommand=cmd(x,WideScale(SCREEN_WIDTH*0.08,SCREEN_WIDTH*0.1)-36;);
		AutoText("frutiger")..{
			Name="ToastyName"..index;
			InitCommand=cmd(y,-12;halign,0;zoom,0.75;);
			BeginCommand=cmd(settext,ScreenString(sName);strokecolor,color("#22222288");shadowlength,1;shadowcolor,color("#222222CC"););
			OffCommand=cmd(linear,0.2;diffusealpha,0);
		};
		AutoText("frutiger")..{
			Name="ToastyOrigin"..index;
			InitCommand=cmd(y,40;halign,0;zoom,0.7;wrapwidthpixels,356);
			BeginCommand=cmd(settext,ScreenString(sName.."Origin");strokecolor,color("#22222288");shadowlength,1;shadowcolor,color("#222222CC"););
			OffCommand=cmd(linear,0.2;diffusealpha,0);
		};
		AutoText("frutiger")..{
			Name="ToastyDesc"..index;
			InitCommand=cmd(y,90;halign,0;valign,0;zoom,0.7;wrapwidthpixels,256);
			BeginCommand=cmd(settext,ScreenString(sName.."Desc");strokecolor,color("#22222288");shadowlength,1;shadowcolor,color("#222222CC"););
			OffCommand=cmd(linear,0.2;diffusealpha,0);
		};
	};
};

return t;