Private
serveritem info list.
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.
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)
Error message
x & y coordinates list
whether to send confirmation
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.
If you wanna add [2, 2] and [4, 6] as map spawn points.
app.scene.addSpaceMapBirth([{x: 2, y: 2}, {x: 4, y: 6}])
Error message
x & y coordinates list
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Add materials to map.
If you wanna add a picture to [2, 3].
app.scene.addSpaceMapGridMaterial([{x: 2, y: 3, materialType: 0, content: "https://xxxxxx.png"}])
Error message
material info, contains {x, y ,materialType, content}. MaterialType must be 0. Because currently only images are supported.
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
If you wanna add [2, 3] as a landmark point.
app.scene.addSpaceMapLandmark([{id: "123", name: "test landmark", x: 2, y: 3, }])
Error message
landmark info list, every item contains {anchorId, anchorName, x, y}
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Add obstacles to the map
Error message
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}])
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.
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)
Error message
x & y coordinates list
designated landmark info, contains {anchorId, anchorName}
whether to send confirmation
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.
If you wanna remove all materials from [2, 3].
app.scene.clearSpaceMapGridMaterial([{x: 2, y: 3}])
Error message
x & y coordinates list
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Obtain the temporary information changed through the API in the space.
If you wanna get the temporary information of the map.
app.scene.getSpaceTempInfo()
Error message
remove items.
If you wanna remove two items.
app.scene.removeItem(['id1', 'id2'])
Error message
item's id list.
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.
If you wanna remove the [2, 2] map spawn point.
app.scene.removeSpaceMapBirth([{x: 2, y: 2}])
Error message
x & y coordinates list
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.
If you wanna remove the map landmark point by id.
app.scene.removeSpaceMapLandmark(['123'])
Error message
landmark id list
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.
If you wanna remove the [2, 2] map obstacle.
app.scene.removeSpaceMapObstacle([{x: 2, y: 2}])
Error message
x & y coordinates list
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.
If you wanna remove the [2, 2] map portals.
app.scene.removeSpaceMapPortal([{x: 2, y: 2}])
Error message
x & y coordinates list
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
update items.
If you wanna update a item.
app.scene.updateItem([{left: 2, top: 3, imageURL: 'https://xxxxxx.png'}])
Error message
item info list.
If it is successfully sent to the server, it will return ids list. Otherwise it will return an error message
Generated using TypeDoc
add items.
Example
If you wanna add a item from [2, 3].
Throws
Error message