@kognifai/cogsengine
    Preparing search index...

    Class OverlayComponent

    Overlay component.

    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 OverlayComponent

    Properties

    blendMode: BlendMode

    Blend mode of the overlay.

    color: vec4

    Color to tint the overlay image with.

    Image to display.

    imageTransform: mat4

    Image transform matrix that can be used to manipulate the appearance of the overlay without performing complex calculations for size and position. As an example one can apply transitions like "pop in" by combining animation of the alpha value of the material used for the component and applying an image transform animating from scaling the [x, y] axes from [0, 0] to [1, 1]. Note that image transforms might interact poorly with overlays depending on exact pixel positioning and size to look good, since the resulting pixel positions will most likely no longer line up at pixel borders.

    isTyped: boolean

    Internal flag set if component is a Cogs Core component.

    positionMode: PositionMode

    Positioning mode of the overlay.

    size: vec2

    Size of the overlay.

    sizeMode: SizeMode

    Size mode of the overlay.

    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.