Using a Portal
Web, Web VR and AR environments
<portal href="www.website.com/portal"/>
Once you include our reference implementation JavaScript library, you can use <portal />
as a web component in your HTML or JavaScript. The href attribute points to a JSON file describing the portal’s characteristics, written in MHTTP’s Open Portal Schema.
Attribute | Description | Type | Required/optional |
---|---|---|---|
url | A URL pointing to a JSON file in MHTTP’s Open Portal Schema | string | required |
max-width | Specifies the maximum width of the portal when rendered and presented to user | integer | optional |
max-height | Specifies the maximum height of the portal when rendered | integer | optional |
Game Engine Environments
For C# or C++ environments like Unity and Unreal
class Portal {
public Portal(Uri portalHref){...}
public Portal(string portalHref){...}
}
Once you include our Portal class library, you can call the Portal constructor with a portalURL. This leads to the portal being initialized, rendered and ready for user events such as teleportation, according to the portal characteristics defined in portalURL JSON.