forked from stepmania/stepmania
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Checkerboard2File2x2.lua
42 lines (38 loc) · 1.4 KB
/
Checkerboard2File2x2.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local Color1 = color(Var "Color1");
local Color2 = color(Var "Color2");
local a1 = LoadActor(Var "File1") .. {
OnCommand= function(self)
self:cropto(SCREEN_WIDTH/2,SCREEN_HEIGHT/2):diffuse(Color1)
:effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
local a2 = LoadActor(Var "File2") .. {
OnCommand= function(self)
self:cropto(SCREEN_WIDTH/2,SCREEN_HEIGHT/2):diffuse(Color2):effectclock("music")
-- Explanation in StretchNoLoop.lua.
if self.GetTexture then
self:GetTexture():rate(self:GetParent():GetUpdateRate())
end
end,
GainFocusCommand=cmd(play);
LoseFocusCommand=cmd(pause);
};
local t = Def.ActorFrame {
a1 .. { OnCommand=cmd(x,scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a2 .. { OnCommand=cmd(x,scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT);y,scale(1,0,4,SCREEN_TOP,SCREEN_BOTTOM)); };
a2 .. { OnCommand=function(self)
self:x(scale(1,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
a1 .. { OnCommand=function(self)
self:x(scale(3,0,4,SCREEN_LEFT,SCREEN_RIGHT)):y(scale(3,0,4,SCREEN_TOP,SCREEN_BOTTOM))
if self.SetDecodeMovie then self:SetDecodeMovie(false) end
end };
};
return t;