Created
March 24, 2023 01:18
-
-
Save monsieuroeuf/6a0593ea51916a03530587d4d3904e7c to your computer and use it in GitHub Desktop.
Change the position of a Text+ node in Fusion depending on the comp's aspect ratio
This file contains hidden or 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
:local w = tonumber( comp:GetPrefs("Comp.FrameFormat.Width")) | |
local h = tonumber(comp:GetPrefs("Comp.FrameFormat.Height")) | |
-- add the colon at the start of first line to allow multiline expression | |
if (w / h) > 1 then return Point(0.0, 0.0) | |
elseif (w / h) < 1 then return Point(0.5, 0.5) | |
else return Point(1, 1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy and paste this straight into Fusion to see it in action.