Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if GetUserPref("NoteskinType") == "1" then
- local ntype1 = "bottom part arrow.png";
- local ntype2 = "top part arrow";
- elseif GetUserPref("NoteskinType") == "2" then
- local ntype1 = "bottom part circle.png";
- local ntype2 = "top part circle";
- else
- local ntype1 = "bottom part bar.png";
- local ntype2 = "top part bar";
- end;
- local t = Def.ActorFrame {
- -- colour Bar and circle parts
- LoadActor("red.png") .. {
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-118;x,SCREEN_CENTER_X);
- };
- LoadActor("green.png") .. {
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-60;x,SCREEN_CENTER_X);
- };
- LoadActor("blue.png") .. {
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-2;x,SCREEN_CENTER_X);
- };
- LoadActor("dark.png") .. {
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X+180);
- };
- LoadActor("light.png") .. {
- Name="light";
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X+180;diffuse,diffuselight);
- };
- -- colour selectors
- LoadActor("Selector.png") .. {
- Name="pos1";
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-118;x,posred);
- };
- LoadActor("Selector.png") .. {
- Name="pos2";
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-60;x,posgreen);
- };
- LoadActor("Selector.png") .. {
- Name="pos3";
- InitCommand=cmd(zoom,0.5;y,SCREEN_CENTER_Y-2;x,posblue);
- };
- LoadActor("Select round.png") .. {
- Name="circle";
- InitCommand=cmd(zoom,0.5;y,poscircleY;x,poscircleX);
- };
- -- noteskin part
- LoadActor( ntype1 ) .. {
- Name="Fill";
- InitCommand=cmd(y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X-180;diffuse,DiffuseColor);
- };
- Def.Sprite {
- Texture=( ntype2 );
- Frames = Sprite.LinearFrames( 4, 1 );
- InitCommand=cmd(y,SCREEN_CENTER_Y+100;x,SCREEN_CENTER_X-180);
- };
- };
- -- update function to change it actively
- local function Update(self)
- --if GetUserPref("Use10sinsteadof1s") == "1" then
- local red = GetUserPrefN("NoteskinColour4Red")*10/256;
- local green = GetUserPrefN("NoteskinColour4Green")*10/256;
- local blue = GetUserPrefN("NoteskinColour4Blue")*10/256;
- --[[else
- local red = GetUserPrefN("NoteskinColour4Red")/256;
- local green = GetUserPrefN("NoteskinColour4Green")/256;
- local blue = GetUserPrefN("NoteskinColour4Blue")/256;
- end;--]]
- local posred = self:GetChild("pos1"):x((SCREEN_CENTER_X-124)+string.format("%f",red)*255);
- local posgreen = self:GetChild("pos2"):x((SCREEN_CENTER_X-124)+string.format("%f",green)*255);
- local posblue = self:GetChild("pos3"):x((SCREEN_CENTER_X-124)+string.format("%f",blue)*255);
- if red > green and red > blue then
- local diffuselight = self:GetChild("light"):diffuse(color(string.format("%f, %f, %f, %f", "1", "1", "1", red)));
- elseif green > red and green > blue then
- local diffuselight = self:GetChild("light"):diffuse(color(string.format("%f, %f, %f, %f", "1", "1", "1", green)));
- elseif blue > red and blue > green then
- local diffuselight = self:GetChild("light"):diffuse(color(string.format("%f, %f, %f, %f", "1", "1", "1", blue)));
- end;
- local poscircleY = self:GetChild("circle"):y((SCREEN_CENTER_Y+100)-(string.format("%f",red)*62)+(string.format("%f",green)*32)+(string.format("%f",blue)*32));
- local poscircleX = self:GetChild("circle"):x((SCREEN_CENTER_X+180)-(string.format("%f",green)*54)+(string.format("%f",blue)*54));
- local DiffuseColor = self:GetChild("Fill"):diffuse(color(string.format("%f, %f, %f, %f", red, green, blue, "1")));
- end;
- t.InitCommand=cmd(SetUpdateFunction,Update);
- return t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement