Created on September 03, 2019, Last modified on May 19, 2022

An image texture accepts a src property that is subsequently fetched, loaded and rendered. The src property refers to an URI to an image.


you can listen to texture Events to see if a image loaded successfully or not.


class BasicUsageExample extends lng.Application {
    static _template(){
        return {
            UsingShorthand:{ x: 250, y: 100, src: '/Lightning/img/LngDocs_LilLightningIdle.png' },
            UsingTexture:{ x: 250, y: 300, texture: {type: lng.textures.ImageTexture, src: '/Lightning/img/LngDocs_LilLightningIdle.png'}}

const options = {stage: {w: window.innerWidth, h: window.innerHeight, useImageWorker: false}};
const app = new BasicUsageExample(options);

Give feedback

Rating - 4.2 / 5. . Reviews - 5

No votes so far! Be the first to rate this post.

Go To Top