Hierarchy

  • Scene

Constructors

  • Returns Scene

Properties

serverConfig: {
    apiKey: any;
    eventId: any;
    spaceId: any;
} = ...

Type declaration

  • apiKey: any
  • eventId: any
  • spaceId: any

Methods

  • add items.

    Example

    If you wanna add a item from [2, 3].

    app.scene.addItem([{left: 2, top: 3, imageURL: 'https://xxxxxx.png'}])
    

    Throws

    Error message

    Parameters

    Returns Promise<string[]>

    If it is successfully sent to the server, it will return ids list. Otherwise it will return an error message

  • Add a portal to the random birth point. You can also set to send directly without confirmation.

    Example

    If you wanna add [2, 2] to [2, 3] as a portal to the random birth point without confirmation.

    app.scene.addSpaceBirthPortal([{x: 2, y: 2}, {x: 2, y: 3}], true)
    

    Throws

    Error message

    Parameters

    • portal: Coordinates[]

      x & y coordinates list

    • skipConfirmation: boolean

      whether to send confirmation

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Add spawn points of maps in batches.

    Example

    If you wanna add [2, 2] and [4, 6] as map spawn points.

    app.scene.addSpaceMapBirth([{x: 2, y: 2}, {x: 4, y: 6}])
    

    Throws

    Error message

    Parameters

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Add materials to map.

    Example

    If you wanna add a picture to [2, 3].

    app.scene.addSpaceMapGridMaterial([{x: 2, y: 3, materialType: 0, content: "https://xxxxxx.png"}])
    

    Throws

    Error message

    Parameters

    • gridMaterialArr: []

      material info, contains {x, y ,materialType, content}. MaterialType must be 0. Because currently only images are supported.

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Add landmark point to the map

    Example

    If you wanna add [2, 3] as a landmark point.

    app.scene.addSpaceMapLandmark([{id: "123", name: "test landmark", x: 2, y: 3, }])
    

    Throws

    Error message

    Parameters

    • landMarkArr: Landmark[]

      landmark info list, every item contains {anchorId, anchorName, x, y}

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Add obstacles to the map

    Example

    
    

    Throws

    Error message

    Parameters

    • obstacleArr: Coordinates[]

      x & y coordinates list If you wanna add [2, 2] and [4, 6] as obstacles.

      app.scene.addSpaceMapObstacle([{x: 2, y: 2}, {x: 4, y: 6}])
      

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Add a portal to the designated landmark. You can also set to send directly without confirmation.

    Example

    If you wanna add [2, 2] to [2, 3] as a portal to the designated landmark with confirmation.

    app.scene.addSpaceMarkPortal([{x: 2, y: 2}, {x: 2, y: 3}], {"123", "test landmark"}, false)
    

    Throws

    Error message

    Parameters

    • portal: []

      x & y coordinates list

    • anchor: {
          anchorId: string;
          anchorName: string;
      }

      designated landmark info, contains {anchorId, anchorName}

      • anchorId: string
      • anchorName: string
    • skipConfirmation: boolean

      whether to send confirmation

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Clear all materials from specify coordinate point.

    Example

    If you wanna remove all materials from [2, 3].

    app.scene.clearSpaceMapGridMaterial([{x: 2, y: 3}])
    

    Throws

    Error message

    Parameters

    • gridArr: []

      x & y coordinates list

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Get space map information.

    Example

    If you wanna get the information of the map.

    app.scene.getSpaceMapInfo()
    

    Throws

    Error message

    Returns Promise<MapData>

  • Obtain the temporary information changed through the API in the space.

    Example

    If you wanna get the temporary information of the map.

    app.scene.getSpaceTempInfo()
    

    Throws

    Error message

    Returns Promise<SpaceMapInfo>

  • remove items.

    Example

    If you wanna remove two items.

    app.scene.removeItem(['id1', 'id2'])
    

    Throws

    Error message

    Parameters

    • ids: string[]

      item's id list.

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Remove spawn points of the map in batches. Not only the birth point added by using the API, but also the original birth point of the map can be removed. But when everyone leaves, the map data will be reset.

    Example

    If you wanna remove the [2, 2] map spawn point.

    app.scene.removeSpaceMapBirth([{x: 2, y: 2}])
    

    Throws

    Error message

    Parameters

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Remove landmark points of the map in batches. Not only the landmark points added by using the API, but also the original landmark points of the map can be removed. But when everyone leaves, the map data will be reset.

    Example

    If you wanna remove the map landmark point by id.

    app.scene.removeSpaceMapLandmark(['123'])
    

    Throws

    Error message

    Parameters

    • landMarkIdArr: string[]

      landmark id list

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Remove obstacles of the map in batches. Not only the obstacles added by using the API, but also the original obstacles of the map can be removed. But when everyone leaves, the map data will be reset.

    Example

    If you wanna remove the [2, 2] map obstacle.

    app.scene.removeSpaceMapObstacle([{x: 2, y: 2}])
    

    Throws

    Error message

    Parameters

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Remove portals of the map in batches. Not only the portals added by using the API, but also the original portals of the map can be removed. But when everyone leaves, the map data will be reset.

    Example

    If you wanna remove the [2, 2] map portals.

    app.scene.removeSpaceMapPortal([{x: 2, y: 2}])
    

    Throws

    Error message

    Parameters

    • portal: []

      x & y coordinates list

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • update items.

    Example

    If you wanna update a item.

    app.scene.updateItem([{left: 2, top: 3, imageURL: 'https://xxxxxx.png'}])
    

    Throws

    Error message

    Parameters

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return ids list. Otherwise it will return an error message

Generated using TypeDoc