Advertisement
Guest User

StepMania 5 - Banner via ActorProxy Problem

a guest
Mar 4th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. Def.ActorProxy {
  2.     Name="BannerProxy";
  3.     BeginCommand=function(self)
  4.         local WF = SCREENMAN:GetTopScreen():GetChild('Banner');
  5.         local CDou, FDou, PGwan;
  6.    
  7.         -- I don't understand WHY these return 1, but they do.
  8.         -- Maybe this is a StepMania bug?
  9.  
  10.         -- this returns 1
  11.         CDou = WF:GetWidth();
  12.         -- this also returns 1
  13.         FDou = WF:GetHeight();
  14.         -- this is 1/1 which evaluates to 1!
  15.         PGwan = CDou/FDou;
  16.    
  17.        
  18.         -- SCREENMAN:SystemMessage() will print out the values
  19.         -- and is a good means of inspecting variables.
  20.         SCREENMAN:SystemMessage("CDou: " .. CDou .. ", FDou: " .. FDou .. ", PGwan: " .. PGwan);
  21.    
  22.    
  23.         -- this will never happen
  24.         if PGwan > 3.17 and PGwan < 3.23 then
  25.             WF:scaletoclipped(256,80);
  26.        
  27.         -- this will also never happen
  28.         elseif PGwan > 2.53 and PGwan < 2.59 then
  29.             WF:scaletoclipped(204.8,80);
  30.        
  31.         -- this will always happen
  32.         else
  33.             WF:scaletoclipped((256,80);
  34.         end;
  35.        
  36.         self:SetTarget(WF);
  37.     end;
  38. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement