Skip to content

Commit 44e12b2

Browse files
authored
Merge pull request #218 from dysonreturns/observer-distance-field
Adds `ActionObserverCameraMove.distance` enabling wide zoom-out
2 parents a1795cf + d9623b6 commit 44e12b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sc2/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ async def move_camera(self, position: Unit | Units | Point2 | Point3) -> None:
432432
)
433433
)
434434

435-
async def obs_move_camera(self, position: Unit | Units | Point2 | Point3) -> None:
435+
async def obs_move_camera(self, position: Unit | Units | Point2 | Point3, distance: float = 0) -> None:
436436
"""Moves observer camera to the target position. Only works when observing (e.g. watching the replay).
437437
438438
:param position:"""
@@ -444,7 +444,9 @@ async def obs_move_camera(self, position: Unit | Units | Point2 | Point3) -> Non
444444
await self._execute(
445445
obs_action=sc_pb.RequestObserverAction(
446446
actions=[
447-
sc_pb.ObserverAction(camera_move=sc_pb.ActionObserverCameraMove(world_pos=position.as_Point2D))
447+
sc_pb.ObserverAction(
448+
camera_move=sc_pb.ActionObserverCameraMove(world_pos=position.as_Point2D, distance=distance)
449+
)
448450
]
449451
)
450452
)

0 commit comments

Comments
 (0)