first step to change tile
This commit is contained in:
+18
-3
@@ -44,9 +44,10 @@ interface WorkAdventureApi {
|
||||
displayBubble(): void;
|
||||
removeBubble(): void;
|
||||
loadSound(url : string): Sound;
|
||||
registerMenuCommand(commandDescriptor: string, callback: (commandDescriptor: string) => void): void
|
||||
getCurrentUser(): Promise<User>
|
||||
getCurrentRoom(): Promise<Room>
|
||||
registerMenuCommand(commandDescriptor: string, callback: (commandDescriptor: string) => void): void;
|
||||
getCurrentUser(): Promise<User>;
|
||||
getCurrentRoom(): Promise<Room>;
|
||||
changeTile(tiles: TileDescriptor[]): void;
|
||||
//loadTileset(name: string, imgUrl : string, tilewidth : number, tileheight : number, margin : number, spacing : number): void;
|
||||
|
||||
onPlayerMove(callback: (playerMovedEvent: HasPlayerMovedEvent) => void): void
|
||||
@@ -65,6 +66,13 @@ interface Room {
|
||||
startLayer: string | null
|
||||
}
|
||||
|
||||
interface TileDescriptor {
|
||||
x: number
|
||||
y: number
|
||||
tile: number | string
|
||||
layer: string
|
||||
}
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var
|
||||
var WA: WorkAdventureApi
|
||||
@@ -221,6 +229,13 @@ window.WA = {
|
||||
})
|
||||
},
|
||||
|
||||
changeTile(tiles: TileDescriptor[]) {
|
||||
postToParent({
|
||||
type: 'changeTile',
|
||||
data: tiles
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Send a message in the chat.
|
||||
* Only the local user will receive this message.
|
||||
|
||||
Reference in New Issue
Block a user