This commit is contained in:
Glenn Maynard
2007-05-04 18:41:55 +00:00
parent 464356151d
commit 1af23e291e
6 changed files with 60 additions and 69 deletions
@@ -1,4 +1,4 @@
local children = { local t = Def.ActorFrame {
Def.ActorFrame { Def.ActorFrame {
OnCommand=function(self) OnCommand=function(self)
local width=136 local width=136
@@ -21,30 +21,28 @@ local children = {
self:GetChild("right"):zoomtoheight(height+thickness) self:GetChild("right"):zoomtoheight(height+thickness)
end; end;
children = { Def.Quad {
Def.Quad { Name="middle";
Name="middle"; InitCommand=cmd(diffuse,0,0,0,1;shadowlength,6);
InitCommand=cmd(diffuse,0,0,0,1;shadowlength,6); OnCommand=cmd();
OnCommand=cmd(); };
}; Def.Quad {
Def.Quad { Name="top";
Name="top"; InitCommand=cmd(zoomtoheight,3);
InitCommand=cmd(zoomtoheight,3); };
}; Def.Quad {
Def.Quad { Name="bottom";
Name="bottom"; InitCommand=cmd(zoomtoheight,3;diffuse,0.2,0.2,1,1);
InitCommand=cmd(zoomtoheight,3;diffuse,0.2,0.2,1,1); };
}; Def.Quad {
Def.Quad { Name="left";
Name="left"; InitCommand=cmd(zoomtowidth,3;diffusebottomedge,0.2,0.2,1,1);
InitCommand=cmd(zoomtowidth,3;diffusebottomedge,0.2,0.2,1,1); };
}; Def.Quad {
Def.Quad { Name="right";
Name="right"; InitCommand=cmd(zoomtowidth,3;diffusebottomedge,0.2,0.2,1,1);
InitCommand=cmd(zoomtowidth,3;diffusebottomedge,0.2,0.2,1,1);
};
}; };
}; };
} }
return Def.ActorFrame { children = children }; return t;
@@ -1,9 +1,7 @@
local t = Def.ActorFrame { local t = Def.ActorFrame {
children = { LoadActor( THEME:GetPathS("", "_swoosh normal") ) .. {
LoadActor( THEME:GetPathS("", "_swoosh normal") ) .. { StartTransitioningCommand=cmd(play);
StartTransitioningCommand=cmd(play);
};
LoadActor( THEME:GetPathB("", "_fade out normal") );
}; };
LoadActor( THEME:GetPathB("", "_fade out normal") );
}; };
return t; return t;
@@ -1,9 +1,7 @@
local t = Def.ActorFrame { local t = Def.ActorFrame {
children = { LoadActor( THEME:GetPathS("", "_swoosh normal") ) .. {
LoadActor( THEME:GetPathS("", "_swoosh normal") ) .. { StartTransitioningCommand=cmd(play);
StartTransitioningCommand=cmd(play);
};
Def.Actor { OnCommand=cmd(sleep,0.5); };
}; };
Def.Actor { OnCommand=cmd(sleep,0.5); };
}; };
return t; return t;
@@ -1,8 +1,8 @@
local children = { local t = Def.ActorFrame { };
LoadActor( THEME:GetPathB("","_shared background normal") );
LoadActor( THEME:GetPathB("","_fade in normal") ) .. { t[#t+1] = LoadActor( THEME:GetPathB("","_shared background normal") );
OnCommand=cmd(playcommand,"StartTransitioning"); t[#t+1] = LoadActor( THEME:GetPathB("","_fade in normal") ) .. {
}; OnCommand=cmd(playcommand,"StartTransitioning");
}; };
return Def.ActorFrame { children=children }; return t;
@@ -2,32 +2,30 @@ local frame = Def.ActorFrame
{ {
OnCommand=cmd(x,SCREEN_CENTER_X+180;y,SCREEN_CENTER_Y);--;addx,SCREEN_WIDTH/2;decelerate,0.5;addx,-SCREEN_WIDTH/2); OnCommand=cmd(x,SCREEN_CENTER_X+180;y,SCREEN_CENTER_Y);--;addx,SCREEN_WIDTH/2;decelerate,0.5;addx,-SCREEN_WIDTH/2);
OffCommand=cmd(accelerate,0.5;addx,SCREEN_WIDTH/2); OffCommand=cmd(accelerate,0.5;addx,SCREEN_WIDTH/2);
children = { LoadFont("Common", "normal") .. {
LoadFont("Common", "normal") .. { OnCommand=cmd(horizalign,left;x,-80;y,-130;zoom,0.65;playcommand,"CurrentCourseChanged");
OnCommand=cmd(horizalign,left;x,-80;y,-130;zoom,0.65;playcommand,"CurrentCourseChanged"); CurrentCourseChangedMessageCommand=function(self)
CurrentCourseChangedMessageCommand=function(self) local c = GAMESTATE:GetCurrentCourse()
local c = GAMESTATE:GetCurrentCourse() if c then
if c then self:settext( c:GetDisplayFullTitle() )
self:settext( c:GetDisplayFullTitle() ) else
else self:settext( "" )
self:settext( "" ) end
end end;
end; };
}; LoadFont("Common", "normal") .. {
LoadFont("Common", "normal") .. { OnCommand=cmd(horizalign,left;x,-80;y,-100;zoom,0.65;playcommand,"CurrentTrailP1Changed");
OnCommand=cmd(horizalign,left;x,-80;y,-100;zoom,0.65;playcommand,"CurrentTrailP1Changed"); CurrentTrailP1ChangedMessageCommand=function(self)
CurrentTrailP1ChangedMessageCommand=function(self) local t = GAMESTATE:GetCurrentTrail( PLAYER_1 )
local t = GAMESTATE:GetCurrentTrail( PLAYER_1 ) if t then
if t then local st = GAMEMAN:StepsTypeToLocalizedString( t:GetStepsType() )
local st = GAMEMAN:StepsTypeToLocalizedString( t:GetStepsType() ) local cd = CourseDifficultyToLocalizedString( t:GetDifficulty() )
local cd = CourseDifficultyToLocalizedString( t:GetDifficulty() ) self:settext( st .. ", " .. cd )
self:settext( st .. ", " .. cd ) else
else self:settext( "" )
self:settext( "" ) end
end end;
end;
};
}; };
}; };
return Def.ActorFrame { children = { frame } }; return Def.ActorFrame { frame };
@@ -28,13 +28,12 @@ local p, a = ...
assert( (#p%2) == 1 ); assert( (#p%2) == 1 );
local t = Def.ActorFrame { local t = Def.ActorFrame {
children = { }
}; };
local Widths = { } local Widths = { }
local TextureXPos = 0 local TextureXPos = 0
for i = 1,#p do for i = 1,#p do
t.children[i] = a .. { t[i] = a .. {
Name = tostring(i); Name = tostring(i);
InitCommand = function(self) InitCommand = function(self)
if i < math.ceil(#p/2) then self:horizalign("HorizAlign_Right"); if i < math.ceil(#p/2) then self:horizalign("HorizAlign_Right");
@@ -52,7 +51,7 @@ for i = 1,#p do
}; };
local Width = p[i]; local Width = p[i];
t.children[i].Frames = t[i].Frames =
{ {
{ -- state 0 { -- state 0
{ x=TextureXPos, y=0 }, -- top-left { x=TextureXPos, y=0 }, -- top-left