Skip to main content
Known Participant
September 14, 2014
Answered

Background stage question

  • September 14, 2014
  • 1 reply
  • 526 views

Hello Developers,

I normally use the stage colour as the background, but I want to change the colour of the background for one scene in a new IOS app I am coding.  This scene will have some objects that are animated.  I just want to use a solid colour.

Is the best way to do this is to use bitmaps of small dimensions (say 64 by 64) or to use small vectors shapes, from an efficiency standpoint?  I normally set the app with GPU mode and not Direct.

Any links or tips is most appreciated.

Thanks,

Justin

This topic has been closed for replies.
Correct answer Colin Holgate

Hi Colin, thank you for your response.

In my app, there are some animations in front of the object that I will use for the background.  I was thinking of having a series of tiles in the background like maybe 200 so that only a few tiles are redrawn each frame.  If I have a single tile and scale it up to the entire stage size, will the entire tile be redrawn each frame?

I don't know much about the underpinnings of flash and gpu so I am a bit lost with this.

Thank you,

Justin


I believe that Flash takes the 100% sized version of the bitmap and sends that over to the GPU. The GPU then scales it to the desired size. One way we use that ability is with Retina graphics, we'll have a 1024 wide stage with a movieclip at 50% size, and inside is a bitmap that is 2048 wide. On Retina screens you get the full quality, not a doubled up 50% version.

As for redraws, you'll only get a hit if the symbol that was sent to the GPU changes. Your scaled or tiled background won't have changed, and so won't have to reload, even if things are moving around on top of it.

If you did tile a bitmap that would take up a little bit more RAM, but not more GPU memory. So, if it's a flat color backdrop it shouldn't matter whether it's scaled or tiled, and if the background has some texture, then a repeating tile would be the better option.

If you haven't played with it yet you should give Scout a try. One thing it can show you is which areas of the screen are having to be reloaded.

Adobe Scout on the App Store on iTunes

and

Free Scout CC | Download Adobe Scout free trial

1 reply

Colin Holgate
Inspiring
September 14, 2014

Don't think it makes any difference whether you use a scaled bitmap or a scaled vector. By the time it's on the GPU it's a bitmap. For peace of mind you could use a vector and set it to Cache as Bitmap, or even Export as Bitmap. I think it's only a fraction of a second difference to leave is at vector.

A vector at 2048x1536 will take more GPU memory than a vector in a scaled movieclip, where the vector is say 64x64, and the movieclip is cached as bitmap, and then scaled to 2048x1536.

Colin Holgate
Inspiring
September 14, 2014

I just started to doubt myself. If the 2048x1536 movielcip was cache as bitmap. it may well take up that much GPU memory. If the 64x64 vector was a symbol cached as bitmap, and them in another movielcip that was scaled to 2048x1536, it should just take the 64x64 amount of memory.

Known Participant
September 15, 2014

Hi Colin, thank you for your response.

In my app, there are some animations in front of the object that I will use for the background.  I was thinking of having a series of tiles in the background like maybe 200 so that only a few tiles are redrawn each frame.  If I have a single tile and scale it up to the entire stage size, will the entire tile be redrawn each frame?

I don't know much about the underpinnings of flash and gpu so I am a bit lost with this.

Thank you,

Justin