Scene Portal

Scene Portal extends Game Object. Every option available in Game Object is available in Scene Portal.

Use it to move players from one Scenes to another. Think: a door.

Usage

The tag should be added inside the <body> tag, and outside the The Stage element, usually inside a Scenes file.

It accepts two unique attributes, scene and triggering-actions. Use scene to specify the scene link ID you want the player to move to. Use triggering verbs to specify which verbs should trigger the scene move. The verbs listed here must be one of the verbs listed in Actions Menu.

Example

<scene-portal x="200" y="800" scene="my-scene" triggering-actions="push open">
  <span slot="graphic">
    <img alt="Door" src="door.gif">
  </span>
</scene-portal>

HTML attributes

x

X position of the Game Object in pixels, relative to the The Stage. Required.

y

Y position of the Game Object in pixels, relative to the The Stage. Required.

scene

The id of the Scenes <link> to move to. Required.

triggering-actions

A list of space-seperated verbs and/or items that will trigger the scene move. Required.

slot=”graphic”

Used inside the Game Object to define the visual representation. Place a <img> or other graphic tag inside. Can be used on any element type, although <span> or <div> are generally used since they are generic containers. Required.

slot=”text”

Used inside the Game Object to define text responses to player actions. Can be used on any element type, although <span> or <div> are generally used since they are generic containers.

data-action-trigger

Used to signal which verb or item the element’s text should apply to. Can be applied to as many elements as there are defined verbs or items, plus the default action. Must live inside Game Object and inside an element with slot="text".

JavaScript code signature

Scene Portal extends Game Object.

class ScenePortal()

Class that loads a new scene when specified. Pass in the id of the scene to scene, and optionally triggering-actions to specify actions that trigger moving to the new scene. If left unspecified the default action will be used.

Create the scene portal.

ScenePortal.ScenePortal

Create the scene portal.

ScenePortal.sceneCallback()

Load given scene when given action is applied to this element.

Returns

void