Advertisement
Jousway

the fuck you people with fucking huge cdtitles script

Apr 3rd, 2013
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. --I'ma call it the fuck you people with fucking huge cdtitles script, With Love - Jousway
  2. local t = Def.ActorFrame {
  3.  
  4.     Def.Sprite {
  5.         Name="CDTitle";
  6.         InitCommand=cmd(x,SCREEN_CENTER_X-160+90;y,SCREEN_TOP+160+(36/2)+8);
  7.         OnCommand=cmd(draworder,106;shadowlength,1;zoom,0.75;diffusealpha,1;zoom,0;bounceend,0.35;zoom,0.75;spin;effectmagnitude,0,180,0);
  8.     };
  9.    
  10. };
  11.  
  12. local function Update(self)
  13.     local song = GAMESTATE:GetCurrentSong();
  14.     local cdtitle = self:GetChild("CDTitle");
  15.     local height = cdtitle:GetHeight();
  16.     local width = cdtitle:GetWidth();
  17.    
  18.     if song then
  19.         if song:HasCDTitle() then
  20.             cdtitle:visible(true);
  21.             cdtitle:Load(song:GetCDTitlePath());
  22.         else
  23.             cdtitle:visible(false);
  24.         end;
  25.     else
  26.         cdtitle:visible(false);
  27.     end;
  28.    
  29.     if height >= 80 and width >= 80 then
  30.         if height >= width then
  31.         cdtitle:zoom(80/height);
  32.         else
  33.         cdtitle:zoom(80/width);
  34.         end;
  35.     elseif height >= 80 then
  36.         cdtitle:zoom(80/height);
  37.     elseif width >= 80 then
  38.         cdtitle:zoom(80/width);
  39.     else
  40.         cdtitle:zoom(1);
  41.     end;
  42.  
  43. end;
  44.  
  45. t.InitCommand=cmd(SetUpdateFunction,Update);
  46. return t
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement