How to get a Image URL and make it an Texture2D in UE4?

Howdy!

I’ve been bang my head over this trying to add this feature into my plugin. I want to get an image url (Like This) and loaded in game on runtime.

I have the HTTP and JSON Module implemented in and I’ve been using these to get data from a server.

If you’ve received your HTTP reply with a populated dataset, you might be able to follow the procedures here to serialize the data into a texture asset. I haven’t personally experimented with this in Unreal, but have done something similar in cocos2d-x using a method similar to what’s described here:

In any case, the principles would probably be about the same:

  • Send an HTTP request to the server holding the image, and identify the method to be called back when a response arrives.
  • In the callback method, validate that the HTTP response indicates that it’s carrying good data.
  • Transform the raw data contained within the response into a usable format and save it to local storage
  • Create an asset on-the-fly using the newly-saved data and use it.