Textures
let textureInstance = canvasLayerInstance.createTexture({
attr: {
src: "../images/coinSprite.png",
width: 45,
height: 45,
clip: {
sx: 0,
sy: 0,
swidth: 44,
sheight: 40,
},
onload: function () {},
onerror: function () {}
},
});
var img = canvasLayerInstance.createEl({
el: 'image',
attr: {
src: textureInstance,
width: 100,
height: 100,
x: 300,
y: 0
}
});Last updated