MouseTest theme covered.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
return Def.Quad{
|
return Def.Quad{
|
||||||
InitCommand=cmd(Center;FullScreen;diffuse,HSV(192,1,0.8);diffusebottomedge,HSV(192,0.625,0.25));
|
InitCommand=function(self)
|
||||||
|
self:Center();
|
||||||
|
self:FullScreen();
|
||||||
|
self:diffuse(HSV(192,1,0.8));
|
||||||
|
self:diffusebottomedge(HSV(192,0.625,0.25));
|
||||||
|
end;
|
||||||
};
|
};
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
local t = Def.ActorFrame{
|
local t = Def.ActorFrame{
|
||||||
LoadActor(THEME:GetPathG("_click","target"))..{
|
LoadActor(THEME:GetPathG("_click","target"))..{
|
||||||
InitCommand=cmd(diffusealpha,0;Real);
|
InitCommand=function(self)
|
||||||
|
self:diffusealpha(0);
|
||||||
|
self:Real();
|
||||||
|
end;
|
||||||
LeftClickMessageCommand=function(self)
|
LeftClickMessageCommand=function(self)
|
||||||
MESSAGEMAN:Broadcast("MouseInput", { Input = "Left" });
|
MESSAGEMAN:Broadcast("MouseInput", { Input = "Left" });
|
||||||
end;
|
end;
|
||||||
@@ -31,7 +34,11 @@ local t = Def.ActorFrame{
|
|||||||
};
|
};
|
||||||
LoadFont("common normal")..{
|
LoadFont("common normal")..{
|
||||||
Name="Coords";
|
Name="Coords";
|
||||||
InitCommand=cmd(shadowlength,1;zoom,0.5;align,0,1);
|
InitCommand=function(self)
|
||||||
|
self:shadowlength(1);
|
||||||
|
self:zoom(0.5);
|
||||||
|
self:align(0, 1);
|
||||||
|
end;
|
||||||
MouseInputMessageCommand=function(self,param)
|
MouseInputMessageCommand=function(self,param)
|
||||||
local cX = INPUTFILTER:GetMouseX()
|
local cX = INPUTFILTER:GetMouseX()
|
||||||
local cY = INPUTFILTER:GetMouseY()
|
local cY = INPUTFILTER:GetMouseY()
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ local t = Def.ActorFrame{};
|
|||||||
local mou = Def.ActorFrame{
|
local mou = Def.ActorFrame{
|
||||||
LoadFont("common normal")..{
|
LoadFont("common normal")..{
|
||||||
Name="Coords";
|
Name="Coords";
|
||||||
InitCommand=cmd(align,0,0;x,SCREEN_LEFT+8;y,SCREEN_BOTTOM-48);
|
InitCommand=function(self)
|
||||||
|
self:align(0, 0);
|
||||||
|
self:x(SCREEN_LEFT + 8);
|
||||||
|
self:y(SCREEN_BOTTOM - 48);
|
||||||
|
end;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
local function UpdateMouse(self)
|
local function UpdateMouse(self)
|
||||||
@@ -13,19 +17,33 @@ local function UpdateMouse(self)
|
|||||||
local text = "[Mouse] X: ".. mouseX .." Y: ".. mouseY;
|
local text = "[Mouse] X: ".. mouseX .." Y: ".. mouseY;
|
||||||
coords:settext(text)
|
coords:settext(text)
|
||||||
end
|
end
|
||||||
mou.InitCommand=cmd(SetUpdateFunction,UpdateMouse);
|
mou.InitCommand=function(self)
|
||||||
|
self:SetUpdateFunction();
|
||||||
|
UpdateMouse();
|
||||||
|
end;
|
||||||
t[#t+1] = mou;
|
t[#t+1] = mou;
|
||||||
|
|
||||||
t[#t+1] = Def.ActorFrame{
|
t[#t+1] = Def.ActorFrame{
|
||||||
LoadFont("Common normal")..{
|
LoadFont("Common normal")..{
|
||||||
Name="Title";
|
Name="Title";
|
||||||
Text=THEME:GetString("MouseTest","Title");
|
Text=THEME:GetString("MouseTest","Title");
|
||||||
InitCommand=cmd(CenterX;y,SCREEN_TOP+28;diffuse,color("#333333"));
|
InitCommand=function(self)
|
||||||
|
self:CenterX();
|
||||||
|
self:y(SCREEN_TOP + 28);
|
||||||
|
self:diffuse(color("#333333"));
|
||||||
|
end;
|
||||||
};
|
};
|
||||||
LoadFont("Common normal")..{
|
LoadFont("Common normal")..{
|
||||||
Name="Instructions";
|
Name="Instructions";
|
||||||
Text=THEME:GetString("MouseTest","Instructions");
|
Text=THEME:GetString("MouseTest","Instructions");
|
||||||
InitCommand=cmd(x,SCREEN_LEFT+12;align,0,0;y,SCREEN_TOP+42;diffuse,color("#333333");zoom,16/24;wrapwidthpixels,SCREEN_WIDTH*1.5);
|
InitCommand=function(self)
|
||||||
|
self:x(SCREEN_LEFT + 12);
|
||||||
|
self:align(0, 0);
|
||||||
|
self:y(SCREEN_TOP + 42);
|
||||||
|
self:diffuse(color("#333333"));
|
||||||
|
self:zoom(2 / 3);
|
||||||
|
self:wrapwidthpixels(SCREEN_WIDTH * 1.5);
|
||||||
|
end;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -12,30 +12,50 @@ local itemColors = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
local t = Def.ActorFrame{
|
local t = Def.ActorFrame{
|
||||||
--[[
|
|
||||||
Def.Actor{
|
|
||||||
Name="TitleMenuController";
|
|
||||||
GainFocusCommand=function(self)
|
|
||||||
MESSAGEMAN:Broadcast("TitleChange",{NewColor=itemColors[index+1]});
|
|
||||||
end;
|
|
||||||
};
|
|
||||||
]]
|
|
||||||
LoadFont("Common Normal")..{
|
LoadFont("Common Normal")..{
|
||||||
Text=Screen.String(text);
|
Text=Screen.String(text);
|
||||||
InitCommand=cmd(diffuse,color("1,1,1,1"));
|
InitCommand=function(self)
|
||||||
DisabledCommand=cmd(diffuse,color("0.5,0.5,0.5,0.85"));
|
self:diffuse(color("1,1,1,1"));
|
||||||
--GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,itemColors[index+1]);
|
end;
|
||||||
GainFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,0.2,0.2,1"));
|
DisabledCommand=function(self)
|
||||||
LoseFocusCommand=cmd(stoptweening;linear,0.25;diffuse,color("1,1,1,1"));
|
self:diffuse(color("0.5,0.5,0.5,0.85"));
|
||||||
|
end;
|
||||||
|
GainFocusCommand=function(self)
|
||||||
|
self:stoptweening();
|
||||||
|
self:linear(0.25);
|
||||||
|
self:diffuse(color("1,0.2,0.2,1"));
|
||||||
|
end;
|
||||||
|
LoseFocusCommand=function(self)
|
||||||
|
self:stoptweening();
|
||||||
|
self:linear(0.25);
|
||||||
|
self:diffuse(color("1,1,1,1"));
|
||||||
|
end;
|
||||||
};
|
};
|
||||||
--[[ begin triangle ]]
|
--[[ begin triangle ]]
|
||||||
Def.Quad{
|
Def.Quad{
|
||||||
InitCommand=cmd(x,-SCREEN_WIDTH*0.105;zoomto,8,24;zwrite,true;blend,'BlendMode_NoEffect');
|
InitCommand=function(self)
|
||||||
|
self:x(-SCREEN_WIDTH * 0.105);
|
||||||
|
self:zoomto(8, 24);
|
||||||
|
self:zwrite(true);
|
||||||
|
self:blend('BlendMode_NoEffect');
|
||||||
|
end;
|
||||||
};
|
};
|
||||||
Def.Quad{
|
Def.Quad{
|
||||||
InitCommand=cmd(x,-SCREEN_WIDTH*0.1;zoomto,12,12;rotationz,45;diffuselowerleft,color("0,0,0,0");ztest,true);
|
InitCommand=function(self)
|
||||||
GainFocusCommand=cmd(stoptweening;visible,true);
|
self:x(-SCREEN_WIDTH * 0.1);
|
||||||
LoseFocusCommand=cmd(stoptweening;visible,false);
|
self:zoomto(12, 12);
|
||||||
|
self:rotationz(45);
|
||||||
|
self:diffuselowerleft(color("0,0,0,0"));
|
||||||
|
self:ztest(true);
|
||||||
|
end;
|
||||||
|
GainFocusCommand=function(self)
|
||||||
|
self:stoptweening();
|
||||||
|
self:visible(true);
|
||||||
|
end;
|
||||||
|
LoseFocusCommand=function(self)
|
||||||
|
self:stoptweening();
|
||||||
|
self:visible(false);
|
||||||
|
end;
|
||||||
};
|
};
|
||||||
--[[ end triangle ]]
|
--[[ end triangle ]]
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user