- Home /
GUILayout.BeginScrollView - How to load images downloaded from http ?
I have a list of image urls downloaded from http. I just want to show these images on GUILayout.BeginScrollView. I searched About it from few days but not get any appropriate answer.
Here is my code Sample,
public void OnSuccess(object responseFromServer)
{
File imageObj = (File)responseFromServer;
IList imageList = imageObj.GetFileList();
for (int i = 0; i < imageList.Count; i++)
{
Debug.Log ("Downloaded Image Url Is : " + imageList[i].GetUrl());
}
}
Now, I have a number of Image Urls, But how to show images of these urls on GUILayout.BeginScrollview. Thanx for any help.
Answer by ArkaneX · Nov 29, 2013 at 08:25 AM
Having an URL, you can use WWW class to download the resource it points to, and if it is JPG/PNG image, you can access the texture with WWW.texture. Having textures, you can then display them using for example GUI.DrawTexture.
you can also just put the texture in a Label if you want to use GUILayout.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
ListView scrolling with swipe 2 Answers
Not Showing Tools Option in Unity Editor 3 Answers
Alpha Transparency Shader Issue 1 Answer
Smooth scroll with touch? 1 Answer