Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Tropical Cyborg on July 28, 2013, 06:14:18 PM
-
I am trying to load a user's avatar picture captured from the web and load it on a NGUI sprite using Playmaker. I am using a Get property action to save the picture. But when I try to load it on the NGUI sprite with a Set Property->UISprite->Texture action it messes my texture Atlas completely. I believe the reason is that the avatar picture texture is not contained on the Atlas. Is there a workaround for this problem or an action with which I could include the avatar picture on the texture Atlas to use it?
-
Hi,
You need to use a special ngui sprite for this. it's in the ngui menu "Create texture", and the component is a UITexture. then it's not linked to any atlas, it justs shows the texture as is.
bye,
Jean
-
Thanks, Jean. I'll try it!
-
I am able to get the texture from the web and save it as an Object variable -> UnityEngine -> Texture2D. I can't save it as a Texture variable, the GetProperty action I am using to talk to my script doesn't recognises the texture variable. But when I use a Set property to the NGUI texture, it doesn't recognises the Texture 2D object as a variable, it just recognises Texture variables. This way I cannot set the texture of the NGUI texture to the texture loaded from the web. Can anybody help me?
-
Hi,
Here's an example of a UITexture that I set its texture with a FsmTexture variable. Now if, your texture is empty when you get it from a url, it means the url is not a valid texture, that would be another problem.
Bye,
Jean
-
That's exactly what I was doing but for some reason it was not working. The problem was when I was trying to Get the texture from the web and save it as a FSM Texture. Actually I solved the issue with a workaround. I've loaded the texture from the web on a GUITexture Game object. Used the Get property action to save the texture from the GUItexture object on a FSMTexture variable. And only them I was able to load it on the NGUI texture. It worked but it would be nice if there was a more intuitive way of do it.
-
Hi,
that's very odd indeed... I am using www texture loading and it works fine. could you share ( pm me if it's private) the url to that image and I'll test.
bye,
Jean
-
Actually it is my avatar from Facebook. I am developing a Facebook App and I need to load the user's avatars on the game GUI. I'm don't think you would be able to load my avatar but you can try with your own.
-
Hi,
I think you need to use Fb graph to access that kind of data, where did you get the url from?
bye,
Jean
-
I am using the Unity Facebook App package from the Asset Store.
-
Hi,
have you contacted the author to see about getting a texture from facebook api? he may very well have a solution and tips for this.
bye,
Jean
-
The package sends a URL for a WWWTexture with a GetUnity call. The script than saves the texture as a variable. It worked loading this variable on a GUITexture with this script but could not save this texture variable from the script with a Get Property Action.
-
Hi,
If you have your texture in a FsmTexture, why are using "Get Property" action? to what component your "Get property" action is pointing?
bye,
Jean
-
To the script that loads the texture from the url sent from facebook.