开发者

Managing depth in actinscript3

开发者 https://www.devze.com 2023-01-09 11:33 出处:网络
I have a 3D field with many MovieClips in it, and seems like the one last added is the onethat overlaps others and not the one with highest z value.

I have a 3D field with many MovieClips in it, and seems like the one last added is the one that overlaps others and not the one with highest z value.

Is there any property/function that sets z-index? (sorting childre开发者_如何学JAVAn by z value seems too much like a hack).

A 3D engine that can place MovieClips will be helpful(but not one that requires custom drawing).

I'm using Flash CS5 with ActionScript 3


You're looking for parent.setChildIndex. You can use that or swapChildren to move the z-index of children around.


flash itself has no z-index sorting with the 3D space, so you have to either pull a completely new 3D engine or sort it manually every frame.

no matter what happens you will always get some problem when trying to overlap two planes on the same z co-ordinate, even in full 3D engines, you have to decide which one you want to be in front of the others or you will get flickering as each frame they change places.

personally i work with Away3D as an engine, and that has the possibilities for 'MovieMaterial' to a plane (which is probably what you are meaning) but it think this is a pretty general use and can be used in Papervision etc. too.

0

精彩评论

暂无评论...
验证码 换一张
取 消