Created
May 8, 2022 01:49
-
-
Save Sudospective/6e7dfaff7cb6bf2d6d3118fcbcf0fd34 to your computer and use it in GitHub Desktop.
SM5/OutFox AFTs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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