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: 

[INVESTIGATING] new BitmapData(100, 100); crashes application

25 REPLIES 25
Reply
Message 1 of 26
Anonymous
1523 Views, 25 Replies

[INVESTIGATING] new BitmapData(100, 100); crashes application

Pretty much as the title says - I boiled my code down to a single line and it causes: Unity editor to crash; Android app to hang at Unity logo.

Here's all I'm doing to recreate this issue...

new BitmapData(100, 100);


Here are my details...

Scaleform 4.1 for Android (Licensed) - AS4UA_2013_Patch4
Mac OSX 10.7.5
Unity 3.5.5f3
Samsung Galaxy SII (GT-I9100)
Android 2.3.4

Thanks for your help - and keep up the good work! 😉
25 REPLIES 25
Message 21 of 26
am964
in reply to: slice3d

Hey Guys-

 

Thanks for the patience on this bitmapdata issue. The trouble with supporting bitmapdata is related to multithreading. We were able to get the bitmapdata operations (copypixel etc) to work correctly, however there is a hang caused due to deadlock if there is any movie using BMData in the scene when the game simulation is stopped. This is because we need the render thread to tick a few times in order  to safely destroy the rendering context used by BMData operations, however Unity doesn't tick the render thread anymore once the game simulation is stopped. We have no control over Unity multithreading other than rendering Scaleform when they ask us (or any plug-in that does rendering) to do so. 

 

For now, bitmap data operations are not supported in the Unity Integration. We'll likely revisit this issue when we do a major update to the Unity Integration scheduled in a few months. Until then, please design your content to not use BMData (which is slow anyways as it forces synch between advance/display). Sorry for the inconvenience. 

 

-Ankur

Message 22 of 26
slice3d
in reply to: am964

Ankur,

 

I'm sorry but when you say "For now, bitmap data operations are not supported in the Unity Integration" you mean
that it will be completely wiped out from all further releases of Scaleform Unity integration,
or it will stay here 'as is' and will be just 'unsupported feature' until you figure out how to make it fully compatible with Unity?

 

Because I'm happy with how it works in the latest (December 2013) version of Unity integration.
Please don't wipe it out completely - I just can't eliminate the use of BitmapData in my game project.
I'm using BitmapData operations to cut single sprite atlas into a pieces (item icons) only once at runtime on initialization.
Holding and managing hundreds of separate small icons in a single MovieClip without the ability to update them automatically (for example - change registration point when the source icon size have changed) - will be real pain in the ****.

 


@am964 wrote:

(which is slow anyways as it forces synch between advance/display)


Can you explain this in more detail, please?
Using BitmapData operations in my case (only on initialization stage) to dynamically create hundreds of BitmapData instances will lead to a continuous slowdown or not?

 

Thanks!

Message 23 of 26
sushant_p29
in reply to: Anonymous

For me bitmap cropping is essential for using font spritesheets, which solves a lot of problem with respect to localisation. Especially since, using multiple filters on textfields produces inaccurate effects in unity3D. This is one of the biggest issue in scaleform, hope the engineers at unity and autodesk figure out a way to solve this issue. 🙂

Message 24 of 26
unity007
in reply to: Anonymous

Also bitmap getPixel and getPixels (with a rectangle) crashes the IDE (it becomes unresponsive and has to be killed).

 

Will this problem be fixed in Unity 5 ?

 

We also use movieclips with text, using Flash to render certain custom fonts which would take a lot of time in Unity and then a copy of that movieclip (bitmap) which we pass to Unity so it can create a (fast(er)) vertical scrolllist.

 

 

Message 25 of 26
jeromemaurey
in reply to: Anonymous

Same issue here. Trying to use getPixel crashes the Unity IDE. It would be great if you could update the documentation to mention that BitmapData has been disabled in the Unity integration. I wasted quite a bit of time checking the docs and debugging. The Unity Plugin page links the a 4.3 version of the Flash Support PDF http://gameware.autodesk.com/documents/sf_4.3_flash_support.pdf that makes no mention of the issue.

 

Cheers,

 

J.

Message 26 of 26
CarlLooper
in reply to: jeromemaurey

I tried both SetPixel and SetPixel32, both of which are working for me (ie. without crashing Unity).

 

I'm using:

 

Windows8

ScaleForm 4.2

Unity 4.5.1f3

 

And this was code I was using for the test:

 

public function CreateBitmap()
		{
			trace("AS3: CreateBitmap");
			
			if (bm == null)
			{
				bmd = new BitmapData(100, 100, false, 0xFF0000);
				bmd.floodFill(0, 0, 0x00FF00);
				
				bm = new Bitmap(bmd);
				
				this.addChild(bm);
			}
			
			bmd.lock();
			var c:int = 0xFF0000FF;
				
			for (var y:int = 0; y < 100; y++)
			{
				for (var x:int = 0; x < 100; x++)
				{
					bmd.setPixel32(x, y, c);
					//bmd.setPixel(x, y, c);
				}
			}
			bmd.unlock();
			
		}

 

Carl

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

Post to forums  

Autodesk Design & Make Report