@lightningjs/renderer
    Preparing search index...

    Interface TextureOptions

    Universal options for all texture types

    Texture Options provide a way to specify options that are relevant to the texture loading process (including caching) and specifically for how a texture is rendered within a specific Node (or set of Nodes).

    They are not used in determining the cache key for a texture (except if the cacheKey option is provided explicitly to oveerride the default cache key for the texture instance) nor are they stored/referenced within the texture instance itself. Instead, the options are stored/referenced within individual Nodes. So a single texture instance can be used in multiple Nodes each using a different set of options.

    interface TextureOptions {
        flipX?: boolean;
        flipY?: boolean;
        maxRetryCount?: null | number;
        preload?: boolean;
        preventCleanup?: boolean;
        resizeMode?: ResizeModeOptions;
    }
    Index

    Properties

    flipX?: boolean

    Flip the texture horizontally when rendering

    false

    flipY?: boolean

    Flip the texture vertically when rendering

    false

    maxRetryCount?: null | number

    Number of times to retry loading a failed texture

    When a texture fails to load, Lightning will retry up to this many times before permanently giving up. Each retry will clear the texture ownership and then re-establish it to trigger a new load attempt.

    Set to null to disable retries. Set to 0 to always try once and never retry. This is typically only used on ImageTexture instances.

    preload?: boolean

    Preload the texture immediately even if it's not being rendered to the screen.

    This allows the texture to be used immediately without any delay when it is first needed for rendering. Otherwise the loading process will start when the texture is first rendered, which may cause a delay in that texture being shown properly.

    false

    preventCleanup?: boolean

    Prevent clean up of the texture when it is no longer being used.

    This is useful when you want to keep the texture in memory for later use. Regardless of whether the texture is being used or not, it will not be cleaned up.

    false

    resizeMode?: ResizeModeOptions

    You can use resizeMode to determine the clipping automatically from the width and height of the source texture. This can be convenient if you are unsure about the exact image sizes but want the image to cover a specific area.

    The resize modes cover and contain are supported