Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Protected handle

handle: number

Protected loaded

loaded: boolean = false

Protected name

name: string

Accessors

Handle

  • get Handle(): number

IsLoaded

  • get IsLoaded(): boolean

IsValid

  • get IsValid(): boolean

Methods

callFunction

  • callFunction(name: string, ...args: unknown[]): void
  • 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
  • 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
  • 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
  • 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
  • Calls a void method on the scaleform.

    Parameters

    • name: string

      Name of the function

    Returns void

dispose

  • dispose(): void
  • Dispose the scaleform allowing the GTA engine to free memory when wanted.

    Returns void

load

  • load(): Promise<boolean>

render2D

  • render2D(): Promise<void>

render2DScreenSpace

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

render3D

render3DAdditive

setDuration

  • setDuration(duration: number): void
  • 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

Generated using TypeDoc