Advertisement
Jousway

Load BGA .avi from BMS file

Aug 1st, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local song = GAMESTATE:GetCurrentSong();
  2. local startoffset = song:GetFirstBeat(); --There is no proper way to get video offset sadly
  3.  
  4. return Def.ActorFrame {
  5.  
  6.     Def.Sprite {
  7.         InitCommand=cmd(stretchto,0,0,SCREEN_WIDTH/550,SCREEN_HEIGHT/294;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y-32);
  8.         OnCommand=cmd(sleep,startoffset;queuecommand,"Second");
  9.         SecondCommand=function(self)
  10.             if song then
  11.                 local songDir = song:GetSongDir();
  12.                 local dir = FILEMAN:GetDirListing(songDir);
  13.                 local fileToLoad = nil;
  14.                 local wat = 1;
  15.            
  16.                 for i=1,#dir do
  17.                     if  string.find(dir[i],".avi") then
  18.                         fileToLoad = dir[i];
  19.                         wat = 0;
  20.                         self:Load(songDir..fileToLoad);
  21.  
  22.                     elseif string.find(dir[i],".png") and wat == 1 then
  23.                         fileToLoad = dir[i];
  24.                         self:Load(songDir..fileToLoad);
  25.                         self:zoomx((SCREEN_WIDTH/2.15)/self:GetWidth());
  26.                         self:zoomy((416)/self:GetHeight());
  27.                     end;
  28.                 end;               
  29.             else
  30.                 -- fallback crap for not having a song
  31.             end
  32.         end,
  33.     };
  34.    
  35. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement