Skip to content

Instantly share code, notes, and snippets.

@Sudospective
Created May 8, 2022 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sudospective/6e7dfaff7cb6bf2d6d3118fcbcf0fd34 to your computer and use it in GitHub Desktop.
Save Sudospective/6e7dfaff7cb6bf2d6d3118fcbcf0fd34 to your computer and use it in GitHub Desktop.
SM5/OutFox AFTs
-- This is the main AFT which will contain all of our actors.
Def.ActorFrameTexture {
Name = 'MainAFT',
InitCommand = function(self)
MainAFT = self
self
:SetSize(SCREEN_WIDTH, SCREEN_HEIGHT)
:EnableDepthBuffer(false)
:EnableAlphaBuffer(false)
:EnableFloat(false)
:EnablePreserveTexture(true)
:Create()
end,
Def.Sprite {
Name = 'RecursiveSprite',
OnCommand = function(self)
self
:Center()
:SetTexture(RecursiveAFT:GetTexture())
end,
},
-- put all your aft actors here
},
-- And this is the recursive AFT that will redraw our actors to the main AFT.
Def.ActorFrameTexture {
Name = 'RecursiveAFT',
InitCommand = function(self)
RecursiveAFT = self
self
:SetSize(SCREEN_WIDTH, SCREEN_HEIGHT)
:EnableDepthBuffer(false)
:EnableAlphaBuffer(false)
:EnableFloat(false)
:EnablePreserveTexture(true)
:Create()
end,
Def.Sprite {
Name = 'MainSprite',
OnCommand = function(self)
self
:Center()
:SetTexture(MainAFT:GetTexture())
end,
},
},
-- Now a sprite to show it all.
Def.Sprite {
Name = 'ShowActors',
OnCommand = function(self)
self
:Center()
:SetTexture(RecursiveAFT:GetTexture())
end,
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment