Skip to content

Commit

Permalink
Adding LeftToRight Effect (Fixes #125)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Jul 6, 2023
1 parent 7d3fead commit d948976
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Effects/LeftToRight.OBS.FX.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<#
.SYNOPSIS
Moves an item from left to right
.DESCRIPTION
Moves an item from -50% to 150% width.
#>
param(
# The name of the scene.
[string]
$SceneName,

# The name
[string]
$SceneItemID,

# The duration (by default, one second)
[timespan]
$Duration = "00:00:01"
)

if (-not $SceneName -and $this -and $this.SceneName) {
$SceneName = $this.SceneName
}

if (-not $SceneItemID -and $this -and $this.SceneItemID) {
$SceneItemID = $this.SceneItemID
}

if (-not $SceneItemID -and $SceneName) { return }

$sceneItem = if ($this.SceneName -and $this.SceneItemID) {
$this
} elseif ($SceneItemID) {
Get-OBSSceneItem -SceneName $this.SceneName |
Where-Object {
$_.SceneItemID -eq $SceneItemID -or
$_.SourceName -eq $SceneItemID
}
}

$this.Animate(@{x="-50%"}, @{x='150%'}, $Duration, $true)

0 comments on commit d948976

Please sign in to comment.