Assign texture to image element

I have nine image elements in my scene that I want to apply one of six textures to at random. I have two arrays created, one for the image assets and one for the image elements. How would I apply the selected textures to the elements?

So far I’ve tried:

RandomImage.attributes.add('images', {type: 'asset', assetType: 'texture', array: true, title: 'Images'});

// initialize code called once per entity
RandomImage.prototype.initialize = function() 
    var image;
    var planes ="symbol"); //Image elements in scene
        image = this.images[Math.floor(Math.random()*this.images.length)];
        planes[i].element.texture = image;

But planes[i].element.texture = image; returns a seemingly endless amount of errors/warnings.

Images is an array of texture assets. Try using image.resource

Yep, that was it. I know I had seen something about that somewhere, don’t know why I didn’t try it.

Hello @yaustar
I have 9 different entity with 9 different texture. I choose one of the entity and apply that entity texture to my other 15 entities. Basically what is the way to change the entity texture from the canvas existing entities. I want to pic any of the entity from my 9 entities and apply there texture to other 15 entities on my canvas. Entities texture apply one by one.


I want to select the element texture from button 1, 5, 10, 25, 50, 100. (one of them). and apply it to choose entity on canvas.