Skip to content

Commit 76bde8a

Browse files
StartAutomatingStartAutomating
authored andcommitted
Adding .FitToScreen() (Fixes #46)
1 parent e2246d3 commit 76bde8a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

obs-powershell.types.ps1xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ $this |
3737

3838
</Script>
3939
</ScriptMethod>
40+
<ScriptMethod>
41+
<Name>FitToScreen</Name>
42+
<Script>
43+
$videoSettings = Get-OBSVideoSettings
44+
45+
$this | Set-OBSSceneItemTransform -SceneItemTransform ([PSCustomObject][Ordered]@{
46+
alignment = 0
47+
height = $videoSettings.outputHeight
48+
positionX = [int]($videoSettings.outputWidth / 2)
49+
positionY = [int]($videoSettings.outputHeight / 2)
50+
width = $videoSettings.outputWidth
51+
})
52+
</Script>
53+
</ScriptMethod>
4054
<ScriptMethod>
4155
<Name>Lock</Name>
4256
<Script>

0 commit comments

Comments
 (0)