rorypicko
rorypicko

Reputation: 4234

hiding movieclip, rendering performance

I'm developing a rendering engine for a game i am currently building..

I have a main camera (rectangle) that determines what needs to be rendered (thing within it's boundaires)

I am using a bitmap rendering method for the background and that all works fine.

but for the character i am using a movieclip over the top.

when the character goes out of the camera's view is it 100% neccesary to set visible=false?

atm the game is running at 30 FPS (as intended) and everything is sweet, i just wanted to ask out of curiosity.

Is flash clever enough to not bother with movieclip outside of the scene boundaires?

Thanks in advance, Rory

Upvotes: 3

Views: 646

Answers (2)

Strille
Strille

Reputation: 5781

In my experience display objects added to the stage cause a performance hit even if they are not rendered.

Setting visible to false causes a much lower performance hit, but still a small hit.

Removing unnecessary display objects from the display list is a documented performance tip from adobe as well.

Of course, if you only have a few dislay objects it might not be worth the effort, but if we talk about large amounts of display objects I strongly recommend removing them from the display list.

Upvotes: 2

Pixel Elephant
Pixel Elephant

Reputation: 21403

According to http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e3e.html Flash won't render if an object is outside of Stage boundaries:

Display list

The hierarchy of display objects that will be rendered as visible screen content by Flash Player and AIR. The Stage is the root of the display list, and all the display objects that are attached to the Stage or one of its children form the display list (even if the object isn’t actually rendered, for example if it’s outside the boundaries of the Stage).

Upvotes: 3

Related Questions