rapid-render
    Preparing search index...

    Class Scene

    Scene class representing a game scene with entities.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    children: Entity[] = []
    game: Game
    globalZindex: number = 0
    localZindex: number = 0
    parent: null | Entity = null
    position: Vec2
    rapid: Rapid
    rotation: number
    scale: Vec2
    tags: string[]
    transform: MatrixStack = ...

    Accessors

    • get x(): number

      Returns number

    • set x(nx: number): void

      Parameters

      • nx: number

      Returns void

    • get y(): number

      Returns number

    • set y(ny: number): void

      Parameters

      • ny: number

      Returns void

    Methods

    • Initializes the scene.

      Returns void

    • Finds descendant entities matching a predicate.

      Parameters

      • predicate: (entity: Entity) => boolean

        Function to test each entity.

      • onlyFirst: boolean = true

        If true, returns only the first match; otherwise, returns all matches.

      Returns null | Entity | Entity[]

      A single entity, an array of entities, or null if no matches are found.

    • Finds descendant entities with all specified tags.

      Parameters

      • tags: string[]

        Array of tags to match.

      • onlyFirst: boolean = false

        If true, returns only the first match; otherwise, returns all matches.

      Returns null | Entity | Entity[]

      A single entity, an array of entities, or null if no matches are found.

    • Hook for custom rendering logic.

      Parameters

      • render: Rapid

        The rendering engine instance.

      Returns void

    • Hook for custom update logic.

      Parameters

      • deltaTime: number

        Time elapsed since the last update in seconds.

      Returns void

    • Updates the entity and its children.

      Parameters

      • deltaTime: number

        Time elapsed since the last update in seconds.

      Returns void

    • Updates the entity's transform, optionally updating parent transforms.

      Parameters

      • deep: boolean = false

        If true, recursively updates parent transforms.

      Returns void