Announcements
The Scaleform forum is now read-only. Please head to the Gamedev site for product support.
Scaleform Forum (Read Only)
Scaleform enables developers to leverage the power of the Adobe® Flash® tool set to create powerful user interface environments for video games.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

load bytearray image

4 REPLIES 4
Reply
Message 1 of 5
davidbarreto_
453 Views, 4 Replies

load bytearray image

I'm been stuck for a while trying to load an image into a UI in Unity, I checked documentation before to make a plan for create an application that will be required load images stored into the device.

So I used Loader.load(url), its didn't works thought, because i can't acces to another directory different to "StreaningAssets".

Trying to figure out an other way to load an image now I'm using Loader.loadBytes(bytes); and BitmapData.draw(LoaderInfo.loader); that in flash it's works fine but in scaleform nothing happens, no error message is displayed and image never is shown.

Now I can't imagine another way to solve this issue.

 

Documentation says:
Loader.load - supported
Loader.loadBytes - supported
LoaderInfo.bytes- supported

But seems it's not all true, now I'm disapointed with this annoying issues.

 

I hope some one can help to clarify the proper way to get load an image that is not in the "StreamingAssets", it is a requeriment for mi app, I don't want to dispense with scaleform for development the studio's uis but this is a big issue for us.

4 REPLIES 4
Message 2 of 5
unity007
in reply to: davidbarreto_

BitMap operations are kinda fuzzy regarding support ; read http://forums.autodesk.com/t5/Scaleform-Unity-Development/INVESTIGATING-new-BitmapData-100-100-crash...

 

Don't try to depend on it.

Message 3 of 5
davidbarreto_
in reply to: unity007

Thanks, currently we abandon the idea to use scaleform in a few sections our app were some images are needed to be updated as news, it´s a shame this issue in scaleform, now we are using Unity GUI to solve this requirement.

Message 4 of 5
RichMC
in reply to: davidbarreto_

Hello,
Are you viewing docs that correspond to the Unity Scaleform version? Even then, they could be out of date.
 
As a workaround, you can load images from Unity and use SFManager.ReplaceTexture to swap them out in your swf. Just be aware, you’ll need to flip the image vertically before you swap it. There’s an example in our ReplaceTexture demo.
Richard Mc
Autodesk Gameware
Scaleform Division
Message 5 of 5
davidbarreto_
in reply to: RichMC

Hi Richard Mc!

 

Seems using "SFManager.ReplaceTexture" as you suggest we can solve our request to show images that are not compiled with the app.
Just instead to use 'Texture t1 = Resources.Load("texture") as Texture2D;' as the demo suggest, I changed that by 'WWW www = new WWW("file://" + Application.persistentDataPath.ToString() + "texture.png"); t1 = new Texture2D(128, 128, TextureFormat.DXT5, false); www.LoadImageIntoTexture(t1 as Texture2D);' and these works for us.

 

Thanks for your help.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report