[SOLVED] Load image asset from device gallery

Hi,
Is this possible in run time to open and select multiple images, upload them, assign to materials and use those materials? if yes please explain how do i open gallery and select images from there.
thanks :slight_smile:

Looks like there is a web API for this https://developers.google.com/web/fundamentals/media/capturing-images/

Once you have the image, you can create a new texture asset and apply to a material.

Things to keep in mind are the sizes of the images you may get, you may have to resize them if they are to large. Also, if they are not power of 2, they may be some performance penalties.

ok, but this method forces me to create a html element, here i want to stay within the webgl, is it possible?

I believe there was a JS example on that page but if not, you can see add an invisible HTML element to the page via JS and call click on it.

GOT THIS THANKS! got another issue though, i need to transfer a js object i get into playcanvas asset, and im kinda lost in this one…

i need help in this if this issue is solved @yaustar @Dimulamas1 can you people help me with this

Hi @usama.jalal01, what problem are you having?

There is a new AssetListLoader class that allows you load a list of remote resources and add them to the assets registry:

https://developer.playcanvas.com/en/api/pc.AssetListLoader.html