Camera FocusTarget width and height are now optional
This commit is contained in:
parent
d99930a67e
commit
a164cedf3f
6 changed files with 31 additions and 25 deletions
|
@ -4,8 +4,8 @@ export const isCameraSetViewportEvent = new tg.IsInterface()
|
|||
.withProperties({
|
||||
x: tg.isNumber,
|
||||
y: tg.isNumber,
|
||||
width: tg.isNumber,
|
||||
height: tg.isNumber,
|
||||
width: tg.isOptional(tg.isNumber),
|
||||
height: tg.isOptional(tg.isNumber),
|
||||
lock: tg.isBoolean,
|
||||
smooth: tg.isBoolean,
|
||||
})
|
||||
|
|
|
@ -211,6 +211,7 @@ class IframeListener {
|
|||
} else if (payload.type === "setProperty" && isSetPropertyEvent(payload.data)) {
|
||||
this._setPropertyStream.next(payload.data);
|
||||
} else if (payload.type === "cameraSetViewport" && isCameraSetViewportEvent(payload.data)) {
|
||||
console.log(payload.data);
|
||||
this._cameraSetViewportStream.next(payload.data);
|
||||
} else if (payload.type === "cameraFollowPlayer" && isCameraFollowPlayerEvent(payload.data)) {
|
||||
this._cameraFollowPlayerStream.next(payload.data);
|
||||
|
|
|
@ -20,11 +20,12 @@ export class WorkAdventureCameraCommands extends IframeApiContribution<WorkAdven
|
|||
public setViewport(
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
width?: number,
|
||||
height?: number,
|
||||
lock: boolean = false,
|
||||
smooth: boolean = false
|
||||
): void {
|
||||
console.log({ x, y, width, height, lock, smooth });
|
||||
sendToWorkadventure({
|
||||
type: "cameraSetViewport",
|
||||
data: { x, y, width, height, lock, smooth },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue