Skip to content
ArnoldSmith86 edited this page Jan 15, 2021 · 1 revision

You can provide a JSON object with several properties to the URL to control the behaviour of the site:

Property Description
askID If this property is set, the user will be asked for a room ID instead of reading it from the URL. This is a string that gets prefixed to the ID entered by the player.
css A URL to a CSS file that gets applied on the site level. When embedding VTT into a site, this can be used to make the look and feel of overlays consistent with the parent site.
hideToolbar If set to true the toolbar will be completely hidden. This is useful if VTT shows a fixed game in an iFrame.
load A URL to a VTT file that gets loaded if the current room is empty.

Tutorial example

{
  "load": "https://virtualtabletop.io/library/Tutorials/Tutorial%20-%20Grid.vtt"
}

Use a urlencoder to turn it into this:

%7B%0A%20%20%22load%22%3A%20%22https%3A%2F%2Fvirtualtabletop.io%2Flibrary%2FTutorials%2FTutorial%2520-%2520Grid.vtt%22%0A%7D%0A

Then append it with a # after a VTT URL:

https://virtualtabletop.io/#%7B%0A%20%20%22load%22%3A%20%22https%3A%2F%2Fvirtualtabletop.io%2Flibrary%2FTutorials%2FTutorial%2520-%2520Grid.vtt%22%0A%7D%0A

This link could then be added to the wiki as a direct link to an example.

iFrame example

{
  "askID": "chess-",
  "hideToolbar": true,
  "load": "https://virtualtabletop.io/library/Chess.vtt"
}

Use a urlencoder to turn it into this:

%7B%0A%20%20%22askID%22%3A%20%22chess-%22%2C%0A%20%20%22hideToolbar%22%3A%20true%2C%0A%20%20%22load%22%3A%20%22https%3A%2F%2Fvirtualtabletop.io%2Flibrary%2FChess.vtt%22%0A%7D

Then append it with a # after a VTT URL:

https://virtualtabletop.io/#%7B%0A%20%20%22askID%22%3A%20%22chess-%22%2C%0A%20%20%22hideToolbar%22%3A%20true%2C%0A%20%20%22load%22%3A%20%22https%3A%2F%2Fvirtualtabletop.io%2Flibrary%2FChess.vtt%22%0A%7D

This example hides the toolbar and would be most useful in an iframe:

<iframe src="https://virtualtabletop.io/#%7B%0A%20%20%22askID%22%3A%20%22chess-%22%2C%0A%20%20%22hideToolbar%22%3A%20true%2C%0A%20%20%22load%22%3A%20%22https%3A%2F%2Fvirtualtabletop.io%2Flibrary%2FChess.vtt%22%0A%7D"></iframe>
Clone this wiki locally