Small World Engine API Reference - v0.46.1
    Preparing search index...

    Class RenderTarget

    A specialized texture that can be rendered to by a Renderer.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    addressModeU: TextureWrap = TextureWrap.REPEAT

    The wrapping mode for the U coordinate.

    addressModeV: TextureWrap = TextureWrap.REPEAT

    The wrapping mode for the V coordinate.

    anisotropy: number = 1

    Desired anisotropic filtering level for this texture.

    depth: boolean

    Whether this render target includes a depth buffer.

    generateMipmaps: boolean = true

    Whether mipmaps should be generated for this texture.

    height: number

    The height of the render target in pixels.

    image: ImageBitmap | HTMLImageElement | undefined = undefined

    The underlying image or bitmap data.

    isLoaded: boolean = false

    Whether the texture is fully loaded and ready for use.

    magFilter: TextureFilter = TextureFilter.LINEAR

    The magnification filter.

    minFilter: TextureFilter = TextureFilter.LINEAR

    The minification filter.

    offset: { x: number; y: number } = ...

    The UV offset.

    repeat: { x: number; y: number } = ...

    The UV repeat factors.

    width: number

    The width of the render target in pixels.

    Methods

    • Flips the texture horizontally by modifying the UV offset and repeat.

      Returns this

      This texture instance for chaining.

    • Flips the texture vertically by modifying the UV offset and repeat.

      Returns this

      This texture instance for chaining.

    • Resizes the render target. Note: The underlying renderer will recreate the GPU resources on the next frame.

      Parameters

      • width: number

        The new width.

      • height: number

        The new height.

      Returns void