Scaleforms will automatically load when calling any of the render functions.

Example:

    import { Scaleform } from '@nativewrappers/client/ui';

    const scaleform = new Cfx.Scaleform("MIDSIZED_MESSAGE");

    scaleform.callFunction("SHOW_MIDSIZED_MESSAGE", ["Title", "Message"]);

    setTick(() => {
     await scaleform.render2D();
    });

### Hierarchy

- Scaleform

## Index

### Constructors

- constructor

### Properties

- handle
- loaded
- name

### Accessors

- Handle
- IsLoaded
- IsValid

### Methods

- callFunction
- callNumberMethod
- callSharedMethod
- callStringMethod
- callVoidMethod
- dispose
- load
- render2D
- render2DScreenSpace
- render3D
- render3DAdditive
- setDuration
- render2DMasked

## Constructors

### constructor

- new Scaleform(name: string): Scaleform

- - Defined in ui/Scaleform.ts:44

  #### Parameters

  - ##### name: string

  #### Returns Scaleform

## Properties

### Protected handle

handle: number

- Defined in ui/Scaleform.ts:40

### Protected loaded

loaded: boolean = false

- Defined in ui/Scaleform.ts:42

### Protected name

name: string

- Defined in ui/Scaleform.ts:41

## Accessors

### Handle

- get Handle(): number

- - Defined in ui/Scaleform.ts:52

  Get the handle of the scaleform.

  #### Returns number

### IsLoaded

- get IsLoaded(): boolean

- - Defined in ui/Scaleform.ts:66

  Get whether the scaleform is loaded.

  #### Returns boolean

### IsValid

- get IsValid(): boolean

- - Defined in ui/Scaleform.ts:59

  Get whether the handle is a valid handle.

  #### Returns boolean

## Methods

### callFunction

- callFunction(name: string, ...args: unknown[]): void

- - Defined in ui/Scaleform.ts:90

  Call a function on the scaleform.

  #### Parameters

  - ##### name: string

    Name of the function

  - ##### Rest ...args: unknown[]

    Additional arguments

  #### Returns void

### callNumberMethod

- callNumberMethod(name: string, param1?: number, param2?: number, param3?: number, param4?: number, param5?: number): void

- - Defined in ui/Scaleform.ts:147

  Calls a number method on the scaleform.

  #### Parameters

  - ##### name: string

    Name of the function

  - ##### param1: number = -1.0

  - ##### param2: number = -1.0

  - ##### param3: number = -1.0

  - ##### param4: number = -1.0

  - ##### param5: number = -1.0

  #### Returns void

### callSharedMethod

- callSharedMethod(name: string, fParam1?: number, fParam2?: number, fParam3?: number, fParam4?: number, fParam5?: number, sParam1?: string, sParam2?: string, sParam3?: string, sParam4?: string, sParam5?: string): void

- - Defined in ui/Scaleform.ts:166

  Calls a number & string method on the scaleform.

  #### Parameters

  - ##### name: string

    Name of the function

  - ##### fParam1: number = -1.0

  - ##### fParam2: number = -1.0

  - ##### fParam3: number = -1.0

  - ##### fParam4: number = -1.0

  - ##### fParam5: number = -1.0

  - ##### sParam1: string = ""

  - ##### sParam2: string = ""

  - ##### sParam3: string = ""

  - ##### sParam4: string = ""

  - ##### sParam5: string = ""

  #### Returns void

### callStringMethod

- callStringMethod(name: string, param1?: string, param2?: string, param3?: string, param4?: string, param5?: string): void

- - Defined in ui/Scaleform.ts:133

  Calls a string method on the scaleform.

  #### Parameters

  - ##### name: string

    Name of the function

  - ##### param1: string = ""

  - ##### param2: string = ""

  - ##### param3: string = ""

  - ##### param4: string = ""

  - ##### param5: string = ""

  #### Returns void

### callVoidMethod

- callVoidMethod(name: string): void

- - Defined in ui/Scaleform.ts:119

  Calls a void method on the scaleform.

  #### Parameters

  - ##### name: string

    Name of the function

  #### Returns void

### dispose

- dispose(): void

- - Defined in ui/Scaleform.ts:77

  Dispose the scaleform allowing the GTA engine to free memory when wanted.

  #### Returns void

### load

- load(): Promise<boolean>

- - Defined in ui/Scaleform.ts:284

  #### Returns Promise<boolean>

### render2D

- render2D(): Promise<void>

- - Defined in ui/Scaleform.ts:194

  #### Returns Promise<void>

### render2DScreenSpace

- render2DScreenSpace(location: PointF, size: PointF): Promise<void>

- - Defined in ui/Scaleform.ts:205

  #### Parameters

  - ##### location: PointF

  - ##### size: PointF

  #### Returns Promise<void>

### render3D

- render3D(position: Vector3, rotation: Vector3, scale: Vector3): Promise<void>

- - Defined in ui/Scaleform.ts:232

  #### Parameters

  - ##### position: Vector3

  - ##### rotation: Vector3

  - ##### scale: Vector3

  #### Returns Promise<void>

### render3DAdditive

- render3DAdditive(position: Vector3, rotation: Vector3, scale: Vector3): Promise<void>

- - Defined in ui/Scaleform.ts:258

  #### Parameters

  - ##### position: Vector3

  - ##### rotation: Vector3

  - ##### scale: Vector3

  #### Returns Promise<void>

### setDuration

- setDuration(duration: number): void

- - Defined in ui/Scaleform.ts:179

  Sets a duration the scaleform should be shown. Useful for showing a scaleform for a known amount of time, such as messages.

  This only works for any scaleform using `render2D`;

  #### Parameters

  - ##### duration: number

    Duration in milliseconds

  #### Returns void

### Static render2DMasked

- render2DMasked(scaleform1: Scaleform, scaleform2: Scaleform): Promise<void>

- - Defined in ui/Scaleform.ts:21

  #### Parameters

  - ##### scaleform1: Scaleform

  - ##### scaleform2: Scaleform

  #### Returns Promise<void>

Generated using TypeDoc