Advertisement
EESweetieBot

Untitled

Apr 16th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. -- What the original code looks like [SM5]
  2.  
  3. Def.ActorFrameTexture{
  4. Name = "Memory",
  5. InitCommand=function(self)
  6. self:SetTextureName( "Memory" )
  7. self:SetWidth( SCREEN_WIDTH )
  8. self:SetHeight( SCREEN_HEIGHT )
  9. self:EnableAlphaBuffer( true )
  10. self:Create()
  11. end,
  12. -- Cannot call the second AFT's texture by name as it has not been created when this Sprite loads.
  13. Def.Sprite{ Name = "Sprite", InitCommand=cmd(Center), },
  14. },
  15. Def.ActorFrameTexture{
  16. InitCommand=function(self)
  17. self:SetTextureName( "Output" )
  18. self:SetWidth( SCREEN_WIDTH )
  19. self:SetHeight( SCREEN_HEIGHT )
  20. self:EnableAlphaBuffer( true )
  21. self:Create()
  22. -- Set the first AFT's child's texture to this AFT's texture, now that it has been created.
  23. self:GetParent():GetChild("Memory"):GetChild("Sprite"):SetTexture( self:GetTexture() )
  24. end,
  25. -- A sprite to draw the 'trail' with.
  26. Def.Sprite{ Texture = "Memory",
  27. InitCommand=cmd(Center);
  28. OnCommand=function(self)
  29. self:diffusealpha(0)
  30. end;
  31. StartBlueTrailMessageCommand=cmd(blend,"normal";diffuse,color("#9600D1");diffusealpha,1;),
  32. MoreTrailsMessageCommand=cmd(blend,"normal";diffuse,color("#0000FF");diffusealpha,0.96;),
  33. StopBlueTrailMessageCommand=cmd(smooth,0.2;diffusealpha,0;),
  34. },
  35.  
  36. -- Then I tried porting it. [NITG]
  37.  
  38. <Layer Type="ActorFrameTexture"
  39. InitCommand="%function(self)
  40. -- What's up with ponies and putting spaces on the ()'s?
  41. self:SetTextureName('Memory')
  42. self:SetWidth(DISPLAY:GetDisplayWidth())
  43. self:SetHeight(DISPLAY:GetDisplayHeight())
  44. self:EnableAlphaBuffer(true)
  45. self:Create()
  46.  
  47. memory_aft = self
  48. end"
  49. />
  50. <Layer Type="ActorFrameTexture"
  51. InitCommand="%function(self)
  52. self:SetTextureName('Output')
  53. self:SetWidth(DISPLAY:GetDisplayWidth())
  54. self:SetHeight(DISPLAY:GetDisplayHeight())
  55. self:EnableAlphaBuffer(true)
  56. self:Create()
  57. self:hidden(0)
  58.  
  59. output_aft = self
  60. end"
  61. />
  62.  
  63. <Layer Type="Sprite"
  64. OnCommand="%function(self)
  65. self:SetTexture(memory_aft:GetTexture())
  66. self:xy(cx,cy)
  67. self:basezoomx(sw/DISPLAY:GetDisplayWidth())
  68. self:basezoomy(-1*(sh/DISPLAY:GetDisplayHeight()))
  69. self:diffusealpha(0)
  70. end"
  71. StartBlueTrailMessageCommand="%function(self) self:cmd('blend,normal;diffuse,150/255,0,209/255,'..(1*alphamult)) end"
  72. MoreTrailsMessageCommand="%function(self) self:cmd('blend,normal;diffuse,0,0,1,'..(0.96*alphamult)) end"
  73. />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement