Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Zone

An zone that changes game behavior in a defined part of the playing area

Hierarchy

  • Zone

Index

Properties

onBeginOverlap

onBeginOverlap: MulticastDelegate<(zone: this, object: GameObject) => void>

Called when an object enters the zone

onDestroyed

onDestroyed: MulticastDelegate<(zone: this) => void>

Called when the zone is destroyed

param

The destroyed zone

onEndOverlap

onEndOverlap: MulticastDelegate<(zone: this, object: GameObject) => void>

Called when an object leaves the zone

onTick

onTick: MulticastDelegate<(zone: this, deltaTime: number) => void>

Called every tick.

param

The reference zone

param

Duration of the previous tick

Methods

destroy

  • destroy(): void

getColor

getCursorHidden

  • getCursorHidden(): number

getId

  • getId(): string

getInserting

  • getInserting(): number

getObjectInteraction

  • getObjectInteraction(): number

getObjectVisibility

  • getObjectVisibility(): number

getOverlappingObjects

  • Return all objects in the zone. Any object that touches a zone is considered to be in it.

    Returns GameObject[]

getOwningSlots

  • getOwningSlots(): number[]
  • Return a list of the owning player slots of the zone

    Returns number[]

getPosition

getRotation

getSavedData

  • getSavedData(): string

getScale

getShape

  • getShape(): number

getSnapping

  • getSnapping(): number

getStacking

  • getStacking(): number

isAlwaysVisible

  • isAlwaysVisible(): boolean
  • Return whether the zone is visible when players are not in zone mode

    Returns boolean

isOverlapping

  • Return whether an object overlaps the zone. Any object that touches a zone is considered to be in it.

    Parameters

    • object: GameObject

      The object to check for an overlap

    Returns boolean

isSlotOwner

  • isSlotOwner(playerIndex: number): boolean
  • Return whether a given player slot is an owner of the zone

    Parameters

    • playerIndex: number

    Returns boolean

isValid

  • isValid(): boolean
  • Return whether the zone is valid. A zone becomes invalid after it has been destroyed or deleted by a player

    Returns boolean

setAlwaysVisible

  • setAlwaysVisible(alwaysVisible: boolean): void
  • Set whether the zone is visible when players are not in zone mode

    Parameters

    • alwaysVisible: boolean

      The new color

    Returns void

setColor

  • setColor(color: Color | [r: number, g: number, b: number, a: number]): void
  • Set the zone's color

    Parameters

    • color: Color | [r: number, g: number, b: number, a: number]

      The new color. The alpha channel determines the zone's translucency. It can't be lower than 0.1, zone translucency will not be updated if the alpha channel is below 0.1

    Returns void

setCursorHidden

  • setCursorHidden(permission: number): void
  • Set which cursors are hidden from other players while in the zone

    Parameters

    Returns void

setId

  • setId(iD: string): boolean
  • Set the zone's unique id. Returns whether the id was changed successfully. Fails if the id is already used by another zone.

    Parameters

    • iD: string

    Returns boolean

setInserting

  • setInserting(permission: number): void
  • Set which players are allowed to insert into containers in the zone

    Parameters

    Returns void

setObjectInteraction

  • setObjectInteraction(permission: number): void
  • Set which players are allowed to interact with objects in the zone

    Parameters

    Returns void

setObjectVisibility

  • setObjectVisibility(permission: number): void
  • Set for which players objects in the zone are visible

    Parameters

    Returns void

setPosition

  • setPosition(position: Vector | [x: number, y: number, z: number]): void
  • Set the zone's position.

    Parameters

    • position: Vector | [x: number, y: number, z: number]

      The new position

    Returns void

setRotation

  • setRotation(rotation: Rotator | [pitch: number, yaw: number, roll: number]): void
  • Set the zone's rotation.

    Parameters

    • rotation: Rotator | [pitch: number, yaw: number, roll: number]

      The new rotation

    Returns void

setSavedData

  • setSavedData(data: string): void
  • Set the data that will be stored in save game states. The data is available using getSavedData when the object script is run after loading a save state. Try to keep this data small and don't change it frequently, it needs to be sent over the network to all clients.

    Parameters

    • data: string

      Data to store, maximum length 1023 characters

    Returns void

setScale

  • setScale(scale: Vector | [x: number, y: number, z: number]): void
  • Set the zone's scale. At scale 1 the size is 1cm in each direction, so the scale also corresponds to the size in cm.

    Parameters

    • scale: Vector | [x: number, y: number, z: number]

      The new scale

    Returns void

setShape

  • setShape(shape: number): void
  • Set the shape of the zone

    Parameters

    • shape: number

      The new shape, as defined by ZoneShape

    Returns void

setSlotOwns

  • setSlotOwns(playerSlot: number, owner: boolean): void
  • Set whether a player slot is an owner of the zone

    Parameters

    • playerSlot: number
    • owner: boolean

    Returns void

setSnapping

  • setSnapping(permission: number): void
  • Set which players are allowed to snap objects in the zone

    Parameters

    Returns void

setStacking

  • setStacking(permission: number): void
  • Set which players are allowed to stack cards in the zone

    Parameters

    Returns void