hi,
I’m downloading a lot of textures at runtime , the issue im facing that some times different resolution of textures won’t fit on my static texture element (in playcnavas) , So I need a way to resize the texture itself before applying to an element.
My code to download texture:
var Array;
var Asset=SOME URL;
this.app.assets.loadFromUrl(Asset, "texture", function (err, asset) {
Array[1]=asset;//asset is received which I put in an array
});
to assgin this downloaded texture I use: this.image.element.texture=Array[1].resource;
I want to resize downloaded texture to 196 x 196? Can you please help me out ?
It be really slow to do at runtime. If you need different sizes of textures, I would create the most common sizes and down load the one you need at runtime.