@kognifai/cogsengine
    Preparing search index...

    Class BillboardComponent

    Renders a square billboard oriented towards the screen, positioned by the transform given by the TransformComponent. The billboard is rendered with constant size, no matter the distance from the camera.

    Hierarchy (View Summary)

    Index

    Constructors

    • Internal: Component constructor

      Parameters

      • type: string

        type of the component. Ex. "TransformComponent"

      • entity: Entity

        Owning entity. Entity only passed when wrapping existing entity.

      Returns BillboardComponent

    Properties

    alwaysOnTop: boolean

    Render billboard on top of normal geometry.

    blendMode: BlendMode

    Blend mode.

    color: vec4

    Color tint of the billboard.

    flipX: boolean

    Flip the billboard horizontally.

    flipY: boolean

    Flip the billboard vertically.

    horizontalAlignment: HorizontalAlignment

    Horizontal alignment of the billboard.

    Image to show.

    imageSize: vec2

    Size of the billboard in pixels.

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    verticalAlignment: VerticalAlignment

    Vertical alignment of the billboard.

    Accessors

    • get entity(): Entity

      Gets the optional owning entity

      Returns Entity

    • set entity(entity: Entity): void

      Internal: set owning entity.

      Parameters

      Returns void

    • get name(): string

      Component name == type. For compatibility

      Returns string

    • get type(): string

      Gets the type of the component. Ex. "TransformComponent", "SceneComponent" etc.

      Returns string

    Methods

    • Internal: Creates a new component of the given type (name). Component is wrapped when adding to an entity.

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      Returns Component

      Created Cogs.js component.

    • Internal: Creates a new component being wrapped as an existing member of the entity

      Parameters

      • type: string

        Type of the component. Ex. "TransformComponent"

      • entity: Entity

        The owning entity

      Returns Component

      Created Cogs.js component.