Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Scene

The visual representation of a Space.

Scene methods allow you to

  • Create items
  • Create Scene properties
  • Access existing items in the Scene

See Space

See Scene.createItem

Index

Variables

Const index

index: number
returns

index of this Scene.

Const name

name: string
returns

name of this Scene.

Functions

createCamera

  • Creates a new CameraItem in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns CameraItem

    created CameraItem.

createCapsule

  • Creates a new Capsule in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Capsule

    created Capsule.

  • Creates a new Capsule in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Capsule

    created Capsule.

createCone

  • Creates a new Cone in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cone

    created Cone.

createConeFrustum

  • Creates a new ConeFrustum in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns ConeFrustum

    created ConeFrustum.

createCuboid

  • createCuboid(posX: number, posY: number, posZ: number): Cuboid
  • createCuboid(pos: Vector3): Cuboid
  • Creates a new Cuboid in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Cuboid

    created Cuboid.

  • Creates a new Cuboid in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cuboid

    created Cuboid.

createCylinder

  • Creates a new Cylinder in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cylinder

    created Cylinder.

createEllipsoid

  • Creates a new Ellipsoid in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Ellipsoid

    created Ellipsoid.

  • Creates a new Ellipsoid in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Ellipsoid

    created Ellipsoid.

createFrustum

  • Creates a new Frustum in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Frustum

    created Frustum.

createFrustum4

  • Creates a new Frustum4 in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Frustum4

    created Frustum4.

createHemiellipsoid

  • Creates a new HemiEllipsoid in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns HemiEllipsoid

    created HemiEllipsoid.

  • Creates a new HemiEllipsoid in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns HemiEllipsoid

    created HemiEllipsoid.

createItem

  • createItem(modelId: string, posX: number, posY: number, posZ: number): BaseItem
  • createItem(modelId: string, pos: Vector3): BaseItem
  • createItem(modelId: string, pos: Vector3, slot: string): BaseItem
  • Creates a new BaseItem in this Scene.

    deprecated

    Parameters

    • modelId: string

      unique model id.

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns BaseItem

    created item.

  • Creates a new BaseItem in this Scene.

    deprecated

    Parameters

    • modelId: string

      unique model id.

    • pos: Vector3

      initial position in world space.

    Returns BaseItem

    created item.

  • Creates a new BaseItem in this Scene, using its slot as pivot for positioning.

    Note: Method will be deprecated. Use Scene.createItem.

    deprecated

    Parameters

    • modelId: string

      unique model id.

    • pos: Vector3

      initial position in world space.

    • slot: string

      slot to use as pivot for placement.

    Returns BaseItem

    created item.

createSemiTorus

  • Creates a new SemiTorus in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns SemiTorus

    created SemiTorus.

  • Creates a new SemiTorus in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns SemiTorus

    created SemiTorus.

createText

  • createText(posX: number, posY: number, posZ: number, text: string): TextItem
  • createText(pos: Vector3, text: string): TextItem
  • Creates a TextItem in this Scene.

    deprecated

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    • text: string

      label to display.

    Returns TextItem

    created TextItem.

  • Creates a TextItem in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    • text: string

      label to display.

    Returns TextItem

    created TextItem.

createTextBillboard

  • createTextBillboard(posX: number, posY: number, posZ: number): Cuboid
  • createTextBillboard(pos: Vector3): Cuboid
  • Creates a new TextBillboard in this Scene.

    The TextBillboard is a combination of a parent Cuboid with child TextItem

    deprecated

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Cuboid

    the parent Cuboid.

  • Creates a new TextBillboard in this Scene.

    The _TextBillboard_ is a combination of a parent Cuboid with child TextItem

    Parameters

    • pos: Vector3

      position in world space.

    Returns Cuboid

    the parent Cuboid.

createTorus

  • createTorus(posX: number, posY: number, posZ: number): Torus
  • createTorus(pos: Vector3): Torus
  • Creates a new Torus in this Scene.

    Parameters

    • posX: number

      x position in world space.

    • posY: number

      y position in world space.

    • posZ: number

      z position in world space.

    Returns Torus

    created Torus.

  • Creates a new Torus in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Torus

    created Torus.

createTube

  • Creates a new Tube in this Scene.

    Parameters

    • pos: Vector3

      position in world space.

    Returns Tube

    created Tube.

currentTime

  • currentTime(): number
  • deprecated

    Use Time.currentTime property instead.

    Returns number

deleteItems

  • deleteItems(): void
  • Deletes all items in this Scene.

    Returns void

getItem

  • Finds an item by its id or name.

    Parameters

    • id: string

      name or id to search for.

    Returns BaseItem

    found item. Returns null if none is found.

    See BaseItem.name

    See BaseItem.id

getItems

  • Returns Array<BaseItem>

    all items in this Scene.

getProperty

  • getProperty(key: string): string
  • Gets a custom property from this object. Returns null if the property can not be found.

    Parameters

    • key: string

      name of property to search.

    Returns string

loadSound

  • loadSound(s: string): Sound
  • loadSound(s: string, callback: function): void
  • deprecated

    Use Sound.load instead.

    Parameters

    • s: string

    Returns Sound

  • deprecated

    Use Sound.load instead.

    Parameters

    • s: string
    • callback: function
        • Parameters

          Returns void

    Returns void

onExit

  • onExit(onExit: function): void
  • deprecated

    Use Application.onSceneExit instead.

    Parameters

    • onExit: function
        • (): void
        • Returns void

    Returns void

onPropertyChanged

  • onPropertyChanged(id: string, handler: function): void
  • Handles property value changes in this object.

    Parameters

    • id: string

      property to listen to.

    • handler: function

      function that's called when property value is changed.

        • (t: string): void
        • Parameters

          • t: string

          Returns void

    Returns void

renderShadows

  • renderShadows(b: boolean): void
  • deprecated

    Parameters

    • b: boolean

    Returns void

schedule

  • schedule(func: function, delay: number): Disposable
  • deprecated

    Use Time.schedule instead.

    Parameters

    • func: function
        • (): void
        • Returns void

    • delay: number

    Returns Disposable

scheduleRepeating

  • scheduleRepeating(func: function, period: number): Disposable

setProperty

  • setProperty(key: string, value: any): void
  • Sets a custom property to this object.

    Properties are saved as strings.

    Parameters

    • key: string

      property name.

    • value: any

      property value.

    Returns void

Generated using TypeDoc