Options
All
  • Public
  • Public/Protected
  • All
Menu

Class World

Class with common world manipulations.

This class includes methods for creating entities and common world rendering.

Hierarchy

  • World

Index

Accessors

Static Blackout

  • set Blackout(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

Static CloudHat

Static CloudHatOpacity

  • get CloudHatOpacity(): number
  • set CloudHatOpacity(value: number): void

Static CurrentDate

  • get CurrentDate(): Date
  • set CurrentDate(date: Date): void

Static NextWeather

Static RenderingCamera

  • get RenderingCamera(): Camera
  • set RenderingCamera(value: Camera): void

Static Weather

Static WeatherTransition

  • get WeatherTransition(): [string | Weather, string | Weather, number]
  • set WeatherTransition(transition: [string | Weather, string | Weather, number]): void

Methods

Static createBlip

  • Parameters

    • position: Vector3

      World coordinate of blip.

    • Optional radius: number

      (Optional) Radius of where blip should be shown.

    Returns Blip

    A Blip object.

Static createCamera

Static createPed

  • createPed(model: Model, position: Vector3, heading?: number): Promise<Ped>
  • Create a ped at a desired location.

    Parameters

    • model: Model

      Ped model to be spawned.

    • position: Vector3

      World position (coordinates) of Ped spawn.

    • Default value heading: number = 0

      Heading of Ped when spawning.

    Returns Promise<Ped>

Static createRandomPed

Static createRandomVehicle

  • createRandomVehicle(position: Vector3, heading?: number): Promise<Vehicle>
  • Create a random vehicle at a desired location.

    Parameters

    • position: Vector3

      World position (coordinates) of Vehicle spawn.

    • Default value heading: number = 0

      Heading of Vehicle when spawning.

    Returns Promise<Vehicle>

    Vehicle object.

Static createVehicle

  • Create a vehicle at a desired location.

    Parameters

    • model: Model

      Vehicle model to be spawned.

    • position: Vector3

      World position (coordinates) of Vehicle spawn.

    • Default value heading: number = 0

      Heading of Vehicle when spawning.

    Returns Promise<Vehicle>

    Vehicle object.

Static destroyAllCameras

  • destroyAllCameras(): void

Static drawLightWithRange

  • drawLightWithRange(pos: Vector3, color: Color, range: number, intensity: number): void

Static drawLine

Static drawMarker

  • drawMarker(type: MarkerType, position: Vector3, direction: Vector3, rotation: Vector3, scale: Vector3, color: Color, bobUpAndDown?: boolean, faceCamera?: boolean, rotateY?: boolean, textureDict?: string, textureName?: string, drawOnEntity?: boolean): void
  • Draw a marker at a desired location.

    Parameters

    • type: MarkerType

      Type of marker.

    • position: Vector3

      Location of marker.

    • direction: Vector3

      Direction facing.

    • rotation: Vector3

      World rotation.

    • scale: Vector3

      Size of marker.

    • color: Color

      Color of marker.

    • Default value bobUpAndDown: boolean = false

      Animated movement along marker's own X axis.

    • Default value faceCamera: boolean = false

      Rendering marker facing rendering camera.

    • Default value rotateY: boolean = false

      Rotate along Y axis.

    • Default value textureDict: string = null

      Custom texture dictionary for custom marker.

    • Default value textureName: string = null

      Custom texture name for custom marker.

    • Default value drawOnEntity: boolean = false

      Render the marker on an entity.

    Returns void

Static drawPoly

Static drawSpotLight

  • drawSpotLight(pos: Vector3, dir: Vector3, color: Color, distance: number, brightness: number, roundness: number, radius: number, fadeOut: number): void
  • Parameters

    • pos: Vector3
    • dir: Vector3
    • color: Color
    • distance: number
    • brightness: number
    • roundness: number
    • radius: number
    • fadeOut: number

    Returns void

Static drawSpotLightWithShadow

  • drawSpotLightWithShadow(pos: Vector3, dir: Vector3, color: Color, distance: number, brightness: number, roundness: number, radius: number, fadeOut: number): void
  • Parameters

    • pos: Vector3
    • dir: Vector3
    • color: Color
    • distance: number
    • brightness: number
    • roundness: number
    • radius: number
    • fadeOut: number

    Returns void

Static raycast

Static transitionToWeather

  • transitionToWeather(weather: Weather, duration: number): void

Generated using TypeDoc