Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. --file in the Load() function is the song's BG
  2.  
  3. local t = Def.ActorFrame{
  4.  
  5.     LoseFocusCommand=function(self)
  6.           self:RunCommandsOnChildren(function(child) child:visible(false):finishtweening() end, {})
  7.     end,
  8.  
  9.     Def.Quad{
  10.         OnCommand=function(self)
  11.             self:FullScreen()
  12.         end
  13.     },
  14.  
  15. }
  16.  
  17. local num = #t+1
  18.     t[num] = Def.ActorFrameTexture{}
  19.  
  20. local t_tex = t[num]
  21.  
  22.     for i = 1,4 do
  23.         t_tex[#t_tex+1] = Def.Sprite{
  24.             OnCommand=function(self)
  25.                 self:Load(file, "stretch")
  26.                 self:SetSize(640,480)
  27.                 if i == 2 then
  28.                     self:zoomx(-1)
  29.                     self:x( self:GetX() + self:GetWidth() )
  30.                 elseif i == 3 then
  31.                     self:zoomy(-1)
  32.                     self:y( self:GetY() + self:GetHeight() )
  33.                 elseif i == 4 then
  34.                     self:zoomx(-1)
  35.                     self:zoomy(-1)
  36.                     self:xy( self:GetX() + self:GetWidth(), self:GetY() + self:GetHeight() )
  37.                 end
  38.             end
  39.         }
  40.     end
  41.  
  42.     t_tex.OnCommand = function(self)
  43.         self:SetTextureName( "Example 1" )
  44.         self:SetWidth( 640 * 2 )
  45.         self:SetHeight( 480 * 2 )
  46.         self:Create()
  47.         self:Draw()
  48.         self:hibernate(math.huge)
  49.     end
  50.  
  51.     t[#t+1] = Def.Sprite{
  52.         Texture="Example 1",
  53.         OnCommand=function(self)
  54.         self:Center()
  55.         end
  56.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement