Auto Draft

3
(2)
Created on September 03, 2019, Last modified on June 08, 2021

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

Events

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

Example


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);
document.body.appendChild(app.stage.getCanvas());

Give feedback

Rating - 3 / 5. . Reviews - 2

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

Go To Top