Uses the current player position rather than the starting one to position iframe
This commit is contained in:
parent
e39e341ab7
commit
516d756db1
4 changed files with 36 additions and 0 deletions
|
@ -77,6 +77,13 @@ export class WorkadventurePlayerCommands extends IframeApiContribution<Workadven
|
|||
return uuid;
|
||||
}
|
||||
|
||||
async getPosition(): Promise<Position> {
|
||||
return await queryWorkadventure({
|
||||
type: "getPlayerPosition",
|
||||
data: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
get userRoomToken(): string | undefined {
|
||||
if (userRoomToken === undefined) {
|
||||
throw new Error(
|
||||
|
@ -119,4 +126,10 @@ export class WorkadventurePlayerCommands extends IframeApiContribution<Workadven
|
|||
}
|
||||
}
|
||||
|
||||
//TODO: move or delete
|
||||
type Position = {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
|
||||
export default new WorkadventurePlayerCommands();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue